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?

Choose one option
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 RR between entity sets AA and BB into relational tables:

  1. Merging with table of A: Merging the relationship relation for RR into the relation for entity AA means including the primary key of BB as a foreign key in table AA.
  2. Cardinality requirement: For every entity instance in AA, there must be at most one associated instance in BB (otherwise, a single row in AA would need to store multiple foreign key values, violating 1NF). Therefore, the mapping cardinality from AA to BB must be many-to-one (many entities of AA relate to at most one entity of BB).
  3. Participation requirement: If the participation of AA in RR is total, every entity in AA is guaranteed to participate in RR, ensuring that the foreign key column in table AA will never be NULL.

Hence, the relational table for RR can be cleanly merged with that of AA when the relationship RR is many-to-one (from AA to BB) and the participation of AA in RR is total. This corresponds to option C.

Final answer

C

Common trap

Confusing the direction of many-to-one: entity AA on the 'many' side receives the primary key of BB 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.