GATE CS 2024 Set 1 | Question 20

MCQ · 1 mark · −0.33

Let S be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students." Which one of the following ER diagrams CORRECTLY represents S?

ER diagrams (i) and (ii), with entity sets in rectangles and relationships in diamonds. In (i), Instructor–Teaches–Course and Classroom–Allocation–Course, a Registration rectangle is attached directly to Course, and a Student diamond joins Course to a Guides diamond that joins Instructor; in (ii), Instructor–Teaches–Course, Classroom–Allocation–Course, Course–Registration–Projects and Instructor–Guides–Projects.
ER diagrams (iii) and (iv), with entity sets in rectangles and relationships in diamonds. In (iii), Instructor–Teaches–Course, Course–Registration–Student and Instructor–Guides–Student, while Classroom is joined to Course by a plain line and the Allocation diamond hangs from Course alone; in (iv), Instructor–Teaches–Course, Classroom–Allocation–Course, Course–Registration–Student and Instructor–Guides–Student.
  1. Option A: (i)
  2. Option B: (ii)
  3. Option C: (iii)
  4. Option D: (iv) (correct)

Answer

(D)

Explanation

The specification has four entity sets (Instructor, Course, Student and Classroom) and four relationships: Teaches (Instructor–Course), Registration (Student–Course), Allocation (Course–Classroom) and Guides (Instructor–Student). In an ER diagram entity sets are rectangles, relationships are diamonds, and two entity sets are linked only through a relationship.

  • (i) swaps the roles: Student is drawn as a relationship and Registration as an entity set.
  • (ii) has no Student entity set at all; Projects, which the specification never mentions, takes its place.
  • (iii) joins Classroom straight to Course with a plain line, and its Allocation diamond is connected to Course only.
  • (iv) shows exactly the four entity sets joined through the four relationships.

Answer: D