An ER model of a database consists of entity types A and B. These are…
2017
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?
- A.
Relationship R is one-to-many and the participation of A in R is total
- B.
Relationship R is one-to-many and the participation of A in R is partial
- C.
Relationship R is many-to-one and the participation of A in R is total
- D.
Relationship R is many-to-one and the participation of A in R is partial
Attempted by 594 students.
Show answer & explanation
Correct answer: C
Key idea: because R has no attributes, it can be represented by a foreign key on the appropriate entity instead of a separate table.
Step 1: Determine the cardinality from A to B. To merge R into A, A must be on the many side (many A map to one B), i.e., the relationship is many-to-one.
Step 2: Map the relationship by adding the primary key of B as a foreign key in A. Because R has no attributes, this foreign key fully represents the relationship.
Step 3: Consider participation. If A's participation is total, the foreign key in A is mandatory (NOT NULL), matching the constraint that every A is related to some B. If participation were partial, the foreign key would be nullable.
Conclusion: The relational table for R can be merged with A when the relationship is many-to-one and A has total participation, so each A stores B's key and no separate table is needed.
A video solution is available for this question — log in and enroll to watch it.