Sample Header Ad - 728x90

Can a foreign key be used for two primary keys?

0 votes
1 answer
729 views
I'm still a beginner in sql and I have to transform this relation between clients and addresses and vendors and adresses. This uses 2 primary keys(1 for the vendors and 1 for the clients). My question is, is it better practice to use two foreign keys(one per ID)(second picture) or one foreign key that is being referred by the two primary keys(last picture)? Thank you very much ERD Proposition 1 Proposition 2
Asked by Nightstar479 (1 rep)
Aug 12, 2021, 08:07 PM
Last activity: Aug 12, 2021, 08:17 PM