Consider the following Entity–Relationship Diagram (ERD): Which of the…

2015

Consider the following Entity–Relationship Diagram (ERD):

image.png

Which of the following possible relations will not hold when the ERD is mapped to a relational model?

Answer: C. Exam (ExamID, NID, ExamName)ConceptIn an ER-to-relational mapping, each strong entity becomes a relation containing its key and the attributes directly attached to that entity. A…

  1. A.

    Person (NID, Name)

  2. B.

    Qualification (NID, ExamID, QualifiedDate)

  3. C.

    Exam (ExamID, NID, ExamName)

  4. D.

    Exam (ExamID, ExamName)

Attempted by 1042 students.

Show answer & explanation

Correct answer: C

Concept

In an ER-to-relational mapping, each strong entity becomes a relation containing its key and the attributes directly attached to that entity.

A many-to-many relationship becomes a separate relation containing the keys of both participating entities plus any attribute attached to the relationship; the entity relations do not absorb a single foreign key for that M:N link.

Application

  1. Map the Person entity as Person (NID, Name), with NID as its key.

  2. Map the Exam entity as Exam (ExamID, ExamName), with ExamID as its key.

  3. The diagram marks Qualification as an M:N relationship between Person and Exam, so map it separately as Qualification (NID, ExamID, QualifiedDate). NID and ExamID reference the participating entity rows, their pair identifies a relationship row, and QualifiedDate describes that relationship.

  4. Exam (ExamID, NID, ExamName) puts a Person key inside the Exam entity relation. A single NID there cannot represent the diagram’s many Person–Exam pairs; those pairs belong in Qualification.

Cross-check and contrast

  • Person (NID, Name) contains exactly the attributes attached to Person.

  • Qualification (NID, ExamID, QualifiedDate) contains both participant keys and the relationship attribute.

  • Exam (ExamID, NID, ExamName) mixes the Person key into the Exam entity while the M:N association is already represented by relationship rows.

  • Exam (ExamID, ExamName) contains exactly the attributes attached to Exam.

Therefore, the relation that will not hold is Exam (ExamID, NID, ExamName).

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…