Database Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 4096 Page Views: 

How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?



Posted By: Avi Date: 7 October 2009 02:51:09 AM
 Answer:

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.


Posted By: eTechPlanet


Date: 7 October 2009 02:51:09 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image 2DlIvM
Related Questions
Database : What do you mean by normalization?

What do you mean by normalization?

Basically normalization is a process in realational databse design to organise the data and avoid da....
Category: Database Date: 10/1/2010 10:56:06 AM
Database : I have 1-year gap between my 10th & 12th. So what should I answer regarding this?
Database : Explain Data Integrity?

Explain Data Integrity?

Data integrity means the correctness and consistency of data. Enforcing data integrity ensures the q....
Category: Database Date: 10/7/2009 4:43:37 AM
Database : How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?

How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?

One-to-One relationship can be implemented as a single table and rarely as two tables with primary a....
Category: Database Date: 10/7/2009 2:51:09 AM
Database : What is Database Denormalization?

What is Database Denormalization?

Database denormalization is the reverse process of database normalization. Denormalization is the pr....
Category: Database Date: 10/7/2009 2:29:21 AM