Question
Consider an Entity-Relationship (ER) model in which entity sets and are connected by an relationship . and are connected by a ( on the side of and on the side of ) relationship .
has two single-valued attributes and of which is the key attribute. has two single-valued attributes and of which is the key attribute. has two single-valued attributes and of which is the key attribute. The relationships do not have any attributes.
If a relational model is derived from the above ER model, then the minimum number of relations that would be generated if all the relations are in 3NF is _____.
Official answer and solution
- Official answer
- 4
- From
- Official GATE 2015 answer key
Solution
Determine the minimal relational schema in 3NF by representing entity sets and relationships according to their mapping cardinalities.
-
Entity Sets:
- requires a table with primary key .
- requires a table with primary key .
- requires a table with primary key .
-
Relationship ( between and ):
- A many-to-many relationship cannot be combined into either entity table without introducing non-atomic attributes or redundancy.
- Hence, requires its own table: with composite primary key .
-
Relationship ( between and ):
- The relationship is on and on . Each entity in is associated with at most one entity in .
- Thus, the primary key of () can be placed as a foreign key inside the table for without violating 3NF:
- This eliminates the need for a separate table for .
-
Total Relations:
The resulting tables are:
All four relations are in 3NF, so the minimum number of relations is .
4
Creating a separate fifth table for the 1:n relationship R13 instead of embedding the foreign key inside entity set E3.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 1
- Question
- 51 of 65, printed as CS Q.41
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.