0

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

mustaccio
  • 28,207
  • 24
  • 60
  • 76

1 Answers1

1

You got it backwards: address is an attribute of a client or vendor, so the latter two should reference the (missing) ID of an address.

mustaccio
  • 28,207
  • 24
  • 60
  • 76