byCoder
byCoder

Reputation: 9184

What type of relation it is?

I have table Customer, CreditCard, TypeOfCreditCard. CreditCard belongs to customer (every customer coul'd have one or more credit cards, so relation is one-to-many). Then table CreditCard (IdCustomer, IdCard(PK), NumberCard, IdTypeOfCard). Then TypeOfCard table have (IdType(PK), Name). CreditCard and TypeOfCreditCard have relation, i decide. that if type can change name, it what be bad to change db, so added new table Type... But what relation is between this 2 tables? I think taht is one-to-one, is that right?

Upvotes: 0

Views: 52

Answers (1)

Nathan Cox
Nathan Cox

Reputation: 1349

Sounds like every credit card can only have one type, but every type can have multiple credit cards, if I'm reading your question correctly. So that would be one to many.

Upvotes: 1

Related Questions