Home > DeveloperSection > Interviews > How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?

Posted on    May-03-2011 12:49 AM

 MSSQL Server MSSQL Server 
 1 Answer(s)
  1345  View(s)
Rate this:

Amit Singh

Total Post:565

Posted on    May-03-2011 12:00 AM

One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships.
One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships.
Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.

Don't want to miss updates? Please click the below button!

Follow MindStick