Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do you implement one-to-one, one-to-many and many-to-
many relationships while designing tables?

Answers were Sorted based on User's Feedback



How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables..

Answer / swapna

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.

It will be a good idea to read up a database designing
fundamentals text book.

Is This Answer Correct ?    48 Yes 2 No

How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables..

Answer / harish sharma

All relationships are implemented by primary key and
foreign keys.
One-to-one
When we use two tables to relate by one primary key in one
table and one foreign key in secound table.
for example Employee table and salary table.
One-to-many
When we use many table but primary key is only in one table
and in other tables we use foreign key to inter-relate
tables.
For example Emp_id(primary key) in Employee table is
assosiated with salary_emp_id (foreign key) in Salary table
and associated with tax_emp_id (foreign key) in
tax_collecation table and associated with pf_emp_id
(foreign key) in provident_fund table.
Many-to-many
When we use primary keys of two or more tables in a
saperate table and in this table we relate these with other
tables by foreign key and primary key

Is This Answer Correct ?    18 Yes 9 No

How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables..

Answer / sundar

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.

Is This Answer Correct ?    7 Yes 2 No

How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables..

Answer / g2

Excellent!!! Swapna. Really good...

Is This Answer Correct ?    5 Yes 12 No

Post New Answer

More SQL Server Interview Questions

Difference between aggregate functions of sql?

0 Answers   EXL,


Why I can not enter 0.001 second in date and time literals in ms sql server?

0 Answers  


Describe how to use the linked server?

0 Answers  


Explain about nested stored procedure?

0 Answers  


How to connect php with different port numbers?

0 Answers  


1.What is the deferece between DBMS & RDBMS? 2.How can you trouble shoot? If u will get error while installing sql server? 3.How can u trouble shoot slow running query? 4.how can u trouble log shipping errors? 5.why do we use merge replication instead of T.log replication?

7 Answers   Microsoft,


What is Primary key and foreign key? Give an example

4 Answers   TCS,


What are the differences between ms sql server & oracle?

0 Answers  


What sql server means?

0 Answers  


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

0 Answers  


why would you use sql agent? : Sql server database administration

0 Answers  


How to define the name and server for a new dsn?

0 Answers  


Categories