In a one-to-one relationship, should I remove one table id column?

I have the following 2 tables in MySQL: Client (identifier, first name, last name ...) Bonus (Id, CustomerId, Value, ...)

A one-to-one relationship, each customer has only one bonus. (CustomerId is unique in the bonus table)

Q: Do I have to leave the "Identifier" column in the bonus table? (I want to know why or why not)

+5
source share
3 answers

Bonus.Id coulmn Bonus.CustomerId PK. Bonus.CustomerId, . , , -- Bonus.Id coulmn. Bonus.CustomerId, PK , . , - FK , CustomerId ( PK), , .

+4

, , , , . SQL .

, Bonus.Id .

+1

--, ? "bonusvalue" .

(: , , - , "id" )

0

All Articles