Database Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 4279 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

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

Enter the text as shown in the image YBfft2
Related Questions
Database : What do you mean by OLTP?

What do you mean by OLTP?

OLTP means Online Transaction Processing systems which deals with relational database design and use....
Category: Database Date: 10/1/2010 11:13:07 AM
Database : How are Primary Key and Foreign key inter-related?

How are Primary Key and Foreign key inter-related?

Primary Key is a column or combination of columns to have unique records in the table. There can onl....
Category: Database Date: 10/1/2010 11:07:06 AM
Database : What is the purpose of Triggers?

What is the purpose of Triggers?

Triggers are some set of business rules. It consist of some set of commands or statements like Store....
Category: Database Date: 10/1/2010 10:59:06 AM
Database : What is DKNF?

What is DKNF?

DKNF is one of the Normalization forms. It is Domain-Key Normal Form(DKNF). According to this normal....
Category: Database Date: 10/1/2010 10:58:06 AM
Database : Why is De-normalisation Required?

Why is De-normalisation Required?

Fully normalized database can only be attained at logical level. Truly normalized databse can not be....
Category: Database Date: 10/1/2010 10:57:06 AM