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 filestream?
Can we use where clause in union?
Write a SQL query to make a column as unique?
What is a periodical index?
How do I create a partition table in sql server?
How do you set a trace flag in sql server?
What new data source types were added in ssrs 2014?
What are the purpose of Normalisation?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
What is lookup override?
What is tempdb in sql server?
What is filter index?
Can we create clustered index on composite key?
What are the differences between sql server and mysql.
What are Spatial data types in SQL Server 2008