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
you notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it? : Sql server administration
How to call a function from a stored procedure in SQL Server ?
What are indexes in sql?
What is inline table-value user-defined function?
Which are the new data types introduced in sql server 2008?
How to see existing views in ms sql server?
explain what is raid and what are different types of raid configurations? : Sql server database administration
Explain the xml support sql server extends?
What is bcp? When does it used?
While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?
Define master database?
Can a table have 2 primary keys?
What are “lock” hints?
What is user-defined function?
where the connection string store in the database