ER to Relational mapping for binary many-to-many relationships: When converting a binary many-to-many relationship into relations, how many relations will typically be present in the final schema (including participating entities)?

Difficulty: Easy

Correct Answer: Three relations are created.

Explanation:


Introduction / Context:
Binary many-to-many (M:N) relationships are common in ER models (for example, Students enroll in Courses). Correctly mapping them prevents redundancy and preserves the ability to store multiple associations between the same pair of entities with additional attributes (like enrollment_date or grade).



Given Data / Assumptions:

  • Two distinct entity types participate in an M:N relationship.
  • We seek a normalized relational mapping.
  • Relationship attributes (if any) must be preserved.


Concept / Approach:

For a binary M:N, we create an associative (junction) relation in addition to the two entity relations. The associative table stores pairs of foreign keys referencing each entity’s primary key and can include relationship attributes.



Step-by-Step Solution:

Create Entity Relation A (for example, Student(student_id, ...)).Create Entity Relation B (for example, Course(course_id, ...)).Create Associative Relation AB (for example, Enrollment(student_id, course_id, grade, ...)).Define foreign keys from AB to A and B; add a composite PK or unique constraint.


Verification / Alternative check:

Without a third relation, you cannot represent many pairs without repeating groups. The associative relation is necessary and sufficient.



Why Other Options Are Wrong:

One/Two relations: cannot capture many-to-many multiplicity properly.

Four relations: unnecessary overhead for a simple binary M:N.



Common Pitfalls:

Omitting a composite key in the associative table; failing to migrate relationship attributes into the associative relation.



Final Answer:

Three relations are created.

More Questions from Logical Database Design

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion