PrepZone Logo
PrepZone
Back to Database

Database · Easy

How do you implement 1:1, 1:N, and M:N relationships in a relational database?

DatabaseFundamentalsFresherSchema Design

Answer preview

Relational databases have exactly one mechanism for relationships — the foreign key — so cardinality is expressed by where you put the key and what constraints you add: 1:N puts the FK on the many side, 1:1 adds a UNIQUE constraint to that FK, and M:N needs a third junction table…