Skip to main content

GATE CSE 2005Databases › ER Modeling & Relational Model FundamentalsVerified

GATE CSE 2005 PYQ: Let E 1 E_1 E 1 ​ and E 2 E_2 E 2 ​ be two entities in an E / R E/R E / R diagram with simple-valued…

Let E1E_1 and E2E_2 be two entities in an E/RE/R diagram with simple-valued attributes. R1R_1 and R2R_2 are two relationships between E1E_1 and E2E_2, where R1R_1 is one-to-many and R2R_2 is many-to-many. R1R_1 and R2R_2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?

  1. A
    2
  2. B
    3
    Correct answer
  3. C
    4
  4. D
    5

Answer

(B) 3 3 3

Approach

Count the minimum number of relation schemas needed. Each entity needs its own table. A one-to-many relationship is not given a separate table; it is absorbed into the table of the entity on the "many" side as a foreign key (plus any relationship attributes). A many-to-many relationship cannot be absorbed into either entity table, so it requires its own separate table whose primary key is the combination of both participating entity keys.

Minimum tables = 1 (for $E_1$) + 1 (for $E_2$, embedding one-to-many $R_1$ as a foreign key) + 1 (separate table for many-to-many $R_2$) = 3, i.e. option B.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.