Home > Enterprise >  ER diargam for many-to-many relations
ER diargam for many-to-many relations

Time:07-25

Styding DB architecture and can't understand how to build correct relations between two tables. As I understood from articles to build relation between 2 tables we need third table - junction (join) table.

I have two variants of architecture.

First variant with PK in junction table ER with PK in film_rates

Second var without PK and stands just with FKs: ER without PK in film_rates

What variant is correct for developers community?

CodePudding user response:

The second variant, as it stands, is not entirely correct as the junction table should have a pk defined as consisting of both columns.

Given that change, neither option is right or wrong. Whether either is a better solution would depend on your own specific set of circumstances

  • Related