Database Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 4146 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 2KbwYl
Related Questions
Database : What is the difference between rollback and commit commands?

What is the difference between rollback and commit commands?

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:47:19 PM
Database : What do you mean by Cardinality?

What do you mean by Cardinality?

Cardinality refers to the type of relationship like the relationship between two entities is one to ....
Category: Database Date: 8/20/2009 3:06:52 AM
Database : What do you mean by Deadlock?

What do you mean by Deadlock?

When number of transaction are running at the same time and if a situation occurs when the one trans....
Category: Database Date: 8/20/2009 3:04:53 AM
Database : What do you mean by concurrency?

What do you mean by concurrency?

Concurrency refers when the two or more transaction are executed simultaneously.
Category: Database Date: 8/20/2009 3:03:52 AM
Database : What is a Candidate key?

What is a Candidate key?

Candidate key is a set of one or more attribute other than primary key that can uniquely identify a ....
Category: Database Date: 8/20/2009 3:02:40 AM