GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 75

Tables for two entity relationships

Database Management Systems · Database Models, Architecture & ER Diagrams · Full GATE CSE 2005 paper

GATE 2005, Q75 2 marks · MCQ
Report issue

Database Models, Architecture & ER Diagrams

Question 75, GATE 2005: Two ER entities E1, E2 have simple single-valued attributes and two relationships between them: R1 one-to-many and R2 many-to-many, neither with attributes. Minimum relational tables: A2; B3; C4; D5.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Use one table for each entity set. The one-to-many relationship is represented by placing the one-side key as a foreign key in the many-side table, so it needs no separate table. The many-to-many relationship needs a third junction table containing the two entity keys. Minimum: three tables, option B.

Represent each entity type by a table, giving two. The many side of R1 can store the one-side primary key, since each many-side instance relates to at most one one-side instance; no junction table is necessary. R2 needs a junction table because either side can have several partners. Its pair of foreign keys records each pair, bringing the minimum to three.

Original paper, page 10