Database Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 4339 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 AbE80B
Related Questions
Database : Differentiate between SQL and PL/SQL?

Differentiate between SQL and PL/SQL?

1. SQL is simpleified statement for Selecting and Manipulating the data. Whereas PL/SQL is a Procedu....
Category: Database Date: 10/1/2010 12:24:08 PM
Database : What is ACID property?

What is ACID property?

ACID is the acronym for Atomicity,Consistency,Isolation and Durability. Whenever a transaction is ex....
Category: Database Date: 10/1/2010 11:46:07 AM
Database : How are one-to- one,one to many and many to many relationships implemented while designing the table?

How are one-to- one,one to many and many to many relationships implemented while designing the table....

1. One to one relationship:- This is the relationship which is used very rarely and is implemented o....
Category: Database Date: 10/1/2010 11:39:07 AM
Database : What is meant by RDBMS?

What is meant by RDBMS?

RDBMS means Relational Database Management System.This system manages the data records and indices i....
Category: Database Date: 10/1/2010 11:14:20 AM
Database : What is the difference between OLTP & OLAP?

What is the difference between OLTP & OLAP?

OLTP:- 1. It is based on entity relational model. 2. It inherits the concept of normalization so the....
Category: Database Date: 10/1/2010 11:14:07 AM