Consider an Entity-Relationship (ER) model in which entity sets E1, E2 and E3 participate in relationship sets R12 and R13. The cardinalities of R12 (between E1 and E2) is a:m and R13 (between E1 and E3) is 1:n (1 on the side of E1 and n on the side of E3). If there are no partial participation constraints, what is the minimum number of tables required in a relational database that faithfully captures the ER model? A. 2 B. 3 C. 4 D. 5

GATE 2015 · Databases · ER Diagram · medium

Answer: 3 tables (B)

  1. Table for E1: E1 is a central entity participating in both relationships. Table_E1(e1_id, ...) is required. Count = 1.
  2. Handle R13 (1:n from E1 to E3): R13 is 1:n with E1 on the '1' side and E3 on the 'n' side. Add e1_id as FK into Table_E3. No separate table for R13. Table_E3(e3_id, e1_id, ...). Count = 2.
  3. Handle R12 (a:m = M:N between E1 and E2): R12 is many-to-many. A junction table Table_R12 is mandatory. If E2 appears only in R12, we can merge E2's attributes into Table_R12, making it Table_R12_E2(e1_id, e2_id, e2_attrs...). This keeps count at 3 (not 4). Count = 3.
  4. Final count: Table_E1 + Table_E3(with e1_id FK) + Table_R12_E2 = 3 tables.