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

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



Posted By: Avi Date: 1 October 2010 11:39:07 AM
 Answer:

1. One to one relationship:- This is the relationship which is used very rarely and is implemented on single table as whole data is only in that table. Here the primary key of the table acts as a foreign key to the table so as to make the relationship. 2. One to Many Relationship:- Here the relationship is established between the two table. First table will have a field with primary key and in the second table that Primary Key field will be used as a foreign Key Field. There will be one value from table one which will be realted to may values in the table2. 3. Many to May Relationship:- In this relationship many fields of table one is related many fields of table two. For eg. There are two table Product table and the supplier table. Then a product can be sold by many suppliers and a supplier can sell many products. This is implemented using a link table with the keys from both the tables which form the composite primary key of the link table.


Posted By: avibtech


Date: 1 October 2010 11:39:07 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image kBb7C6
Related Questions
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
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?