Modeling many-to-many relationships If a denormalization situation involves a many-to-many (associative) binary relationship, the correct baseline structure is to:

Difficulty: Easy

Correct Answer: Store all fields in three relations (two entity tables plus an associative/bridge table).

Explanation:


Introduction / Context:
Many-to-many (M:N) relationships cannot be represented directly in a single relational table without redundancy and anomalies. The normalized solution is to introduce an associative (bridge) table that contains foreign keys to each entity. This question verifies that baseline modeling knowledge.


Given Data / Assumptions:

  • Two entities, A and B, have M:N cardinality.
  • Each association may carry attributes (e.g., role, quantity, effective dates).
  • We can later consider denormalization for performance.


Concept / Approach:

The canonical structure is three relations: A, B, and A_B (the bridge) with a composite key (A_id, B_id) or a surrogate, plus foreign keys to enforce referential integrity. Additional attributes of the association reside in the bridge table to avoid duplication across A or B.


Step-by-Step Solution:

1) Identify M:N, which cannot be mapped into one FK without duplication.2) Create a bridge table with two FKs (to A and to B).3) Add attributes of the relationship to the bridge as needed.4) Optionally denormalize later based on query patterns.


Verification / Alternative check:

All relational design references adopt the three-table structure for M:N. Denormalization that collapses tables is an optimization, not the starting point.


Why Other Options Are Wrong:

  • One or two tables cannot model M:N without redundancy.
  • Four tables are unnecessary unless there are additional entities.
  • Inferring links from text columns is fragile and violates integrity.


Common Pitfalls:

  • Placing relationship attributes onto one side (A or B), creating duplication.
  • Forgetting composite uniqueness on the pair of foreign keys.


Final Answer:

Store all fields in three relations (two entity tables plus an associative/bridge table).

More Questions from Physical Database Design

Discussion & Comments

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