Question
An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2017 answer key
Solution
Apply the principles of relational database design for representing ER relationships as foreign keys without NULL anomalies.
When mapping a binary relationship between entity sets and into relational tables:
- Merging with table of A: Merging the relationship relation for into the relation for entity means including the primary key of as a foreign key in table .
- Cardinality requirement: For every entity instance in , there must be at most one associated instance in (otherwise, a single row in would need to store multiple foreign key values, violating 1NF). Therefore, the mapping cardinality from to must be many-to-one (many entities of relate to at most one entity of ).
- Participation requirement: If the participation of in is total, every entity in is guaranteed to participate in , ensuring that the foreign key column in table will never be NULL.
Hence, the relational table for can be cleanly merged with that of when the relationship is many-to-one (from to ) and the participation of in is total. This corresponds to option C.
C
Confusing the direction of many-to-one: entity on the 'many' side receives the primary key of on the 'one' side.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2017 Computer Science and Information Technology (CS) Session 2
- Question
- 17 of 65, printed as CS Q.17
- 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.