Database Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 3946 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 tQ6LRM
Related Questions
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
Database : Explain Database Normalization?

Explain Database Normalization?

Database Normalization is a process to ensure that every non-key column in every table is directly d....
Category: Database Date: 10/7/2009 2:16:03 AM
Database : What is the use of commit command?

What is the use of commit command?

Commit command is used to make all the changes permanent to the underlying database which we made du....
Category: Database Date: 9/21/2009 9:51:29 PM
Database : What is the use of rollback command?

What is the use of rollback command?

ROLLBACK command is used to end the current transaction and undo all the changes we made since the c....
Category: Database Date: 9/21/2009 9:49:59 PM
 
Find Best Deals @