A common example that will help me better understand the relationship with the database:
3 tables:
| Credit Card |
| ID |
| Card # |
| Credit Card Type |
| ID |
| Type |
where CreditCardType.Type can be AMEX, Visa, MasterCard.
| Customer |
| (PK) ID |
1.) It seems that I do not need an ID field for CreditCardType, because Type is the primary key defactor. Is it useful to have a numeric field for a PC, even if there is a unique varchar?
2.) Since each credit card must have one and only type ... Do I establish a 1: 1 relationship between credit card and type of credit card?
3.) 0, 1 . 1: n . , MySQL Workbench Customer.ID Customer.PersonTypeID . , , Customer.ID . FK?
| Credit Card |
| (PK) ID |
| Card # |
| (PK) Customer.ID |
| (PK) Customer.PersonType |
| Credit Card |
| (PK) ID |
| Card # |
| (FK) Customer.ID |