This is one of the most favorite SQL Server interview questions asked by the interviewer during the interview.
We have tried to keep answer as simple as we can. So starts the answer as, basically there are three major relationship models: -
Figure: - One-to-One relationship ER diagram
One “Asset” can have multiple “Maintenance”. So “Asset” entity has one-to-many relationship between them as the ER model shows below.
Figure: - One-to-Many Relationship ER diagram
Given below is a sample of many-to-many relationship. One employee can have knowledge of multiple “Technology”. So in order to implement this we have one more table “Employee Technology” which is linked to the primary key of “Employee” and “Technology” table.
Figure: - Many-to-Many Relationship ER diagram
Also see the following video on differences between unique key and primary key in SQL Server as follows:-
Visit for more SQL Server interview questions
Regards,
Get more from author’s blog for SQL Server interview questions
We have tried to keep answer as simple as we can. So starts the answer as, basically there are three major relationship models: -
- One-to-one
- One-to-many
One “Asset” can have multiple “Maintenance”. So “Asset” entity has one-to-many relationship between them as the ER model shows below.
Figure: - One-to-Many Relationship ER diagram
- Many-to-many
Given below is a sample of many-to-many relationship. One employee can have knowledge of multiple “Technology”. So in order to implement this we have one more table “Employee Technology” which is linked to the primary key of “Employee” and “Technology” table.
Figure: - Many-to-Many Relationship ER diagram
Also see the following video on differences between unique key and primary key in SQL Server as follows:-
Visit for more SQL Server interview questions
Regards,
Get more from author’s blog for SQL Server interview questions
No comments:
Post a Comment