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
What is always encrypted?
Explain the dirty pages?
What is the purpose of data source?
How many clustered indexes there can be on table ?
What is normalization? Describe its different types.
How would you add a section to a table?
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
Explain comment on transactions?
what is a default tcp/ip socket assigned for sql server? : Sql server database administration
What types of replication are supported in sql server?
How to provide login information for a new odbc dsn?
What are the kinds of subquery?
Can sql servers linked to other servers?
Explain what is use of dbcc commands?
How to select true false based on column value in sql server?