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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is always encrypted?

520


Explain the dirty pages?

578


What is the purpose of data source?

513


How many clustered indexes there can be on table ?

602


What is normalization? Describe its different types.

584






How would you add a section to a table?

570


Does dbcc checkdb requires db to be in single_user mode? : sql server database administration

520


Explain comment on transactions?

557


what is a default tcp/ip socket assigned for sql server? : Sql server database administration

534


What types of replication are supported in sql server?

569


How to provide login information for a new odbc dsn?

538


What are the kinds of subquery?

531


Can sql servers linked to other servers?

550


Explain what is use of dbcc commands?

511


How to select true false based on column value in sql server?

508