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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are drillthrough reports?

141


What happens if an integer is too big for int date type?

922


Do you know sql server 2008 introduces automatic auditing?

915


Explain transaction server auto commit?

989


What are cursors in ms sql server?

1111


Define constraints and give an example of their use?

985


Explain indexes disadvantages?

1011


How to concatenate two binary strings together?

1050


What is the default schema of your login session in ms sql server?

996


What is store procedure?

1009


what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration

970


Explain filestream storage of sql server 2008?

952


What are partitioned views?

940


What is analysis service repository?

969


Explain the different index configurations a table can have?

887