ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How do you implement one-to-one, one-to-many and many-to-
many relationships while designing tables?
 Question Submitted By :: Swapna
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables?
Answer
# 1
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 ?    10 Yes 0 No
Swapna
 
  Re: How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables?
Answer
# 2
Excellent!!! Swapna. Really good...
 
Is This Answer Correct ?    2 Yes 7 No
G2
 
 
 
  Re: How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables?
Answer
# 3
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 ?    5 Yes 3 No
Harish Sharma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
Which system tables contain information on privileges granted and privileges obtained  1
Different Types of Functions ? Satyam2
What is a NOLOCK?  3
What is ACID Property of Transaction?  4
Why we need a group by clause?  3
wat will be the sql query to extract only last 3 records from table supose table hving thousands for records  16
In performance wise distinct is good or group by is good? eg:select name from emp group by name; select distinct name from emp; Infosys4
Difference between sql server 2000 and sql server 2005? Satyam4
What is the difference between DTS and SSIS? Allianz3
i have 4 tables.. T1, T2, T3, T4.. these tables have the same structure and they store the information entered in different years.. T1 stored 2002, T2 stored 2003, T3 stored 2004 and T4 stored 2005.. i want to copy contents in T1 to T2, T2 to T3, T3 to T4 and T4 to T1.. how do i do that? Temp tables cannot be used..  2
How to determine the service pack currently installed on SQL Server? HCL4
how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)? Marlabs8
1.what is stored procedure?Its significance with example? 2.Explain about index with syntax and example? plz do reply.........  1
Is it possible to have more then one foreign key in a single table? if possible, is this the good way to design the table?  2
how to change column into row in sql ESS2
what is the output for this query select * from employee where 1=1;  4
How To Change Column Ordinal Position in SQL Server 2005 using Query i.e I Want To Add Column at Particular Ordinal Position in SQL Server 2005  2
What are the steps you will take to improve performance of a poor performing query? HCL1
when inserting to a table how many rows will be effected using triggers  1
How will oyu test the stored procedure taking two parameters namely first name and last name returning full name?  3
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com