GATE | GATE-CS-2005 | Question 90

Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?(A) 2(B) 3(C) 4(D) 5

Answer:(B)Explanation: The answer is B, i.e minimum 3 tables.

Strong entities E1 and E2 are represented as separate tables.

In addition to that many-to-many relationships(R2) must be converted as seperate table by having primary keys of E1 and E2 as foreign keys.

One-to-many relaionship (R1) must be transferred to ‘many’ side table(i.e. E2) by having primary key of one side(E1) as foreign key( this way we need not to make a seperate table for R1).