IAE Academy

GATE 2024 CS1 Q.20: solution and answer

GATE 2024 · CS1Q.20 · 1 mark · MCQ

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?

GATE 2024 CS1 question 20: Four ER diagrams (i)-(iv), each built around entities Instructor, Course and a Teaches diamond between Instructor and…Tap to open full size
Figure from the GATE 2024 CS1 paper. It is part of the question.
Figure description

Four ER diagrams (i)-(iv), each built around entities Instructor, Course and a Teaches diamond between Instructor and Course. (i): Course is also joined by a plain line to a rectangle Registration (an entity, not a relationship); Course is joined to an Allocation diamond which is joined to Classroom; Course is joined directly to a diamond labelled Student, and that diamond is joined to a Guides diamond, which is joined to Instructor. So Student is drawn as a relationship diamond and Registration as an entity. (ii): Instructor-Teaches-Course; Course-Allocation-Classroom; Course joined to a Registration diamond, which is joined to a rectangle Projects; Projects joined to the Guides diamond, which is joined to Instructor. There is no Student entity; Projects stands in its place. (iii): Instructor-Teaches-Course; Course is joined by a direct line to Classroom and also by a line to an Allocation diamond that is not joined to Classroom; Course joined to a Registration diamond, which joined to the Student rectangle; Student-Guides-Instructor. (iv): Instructor-Teaches-Course; Course-Allocation-Classroom (the Allocation diamond sits between Course and Classroom); Course-Registration-Student; Student-Guides-Instructor.

  1. (A)

    (i)

  2. (B)

    (ii)

  3. (C)

    (iii)

  4. (D)

    (iv)

Answer and solution

ANSWER

The correct option is (D), diagram (iv).

Official answer: DSource: Official answer key, GATE 2024 CS1 (IISc Bengaluru)

  1. Read S as entities and relationships. Entities (nouns): Instructor, Course, Student, Classroom. Relationships (verbs): Teaches (Instructor-Course), Registration (Student-Course), Allocation (Course-Classroom), Guides (Instructor-Student).

  2. A correct diagram therefore has four rectangles (entities) and four diamonds (relationships). Each diamond must be joined to exactly the two entities it relates, and two entities must never be joined directly by a plain line.

  3. Diagram (i): Student is drawn as a diamond and Registration as a rectangle, so an entity and a relationship are swapped. Wrong.

  4. Diagram (ii): there is no Student entity. The Registration and Guides diamonds connect to a 'Projects' entity that S never mentions. Wrong.

  5. Diagram (iii): Classroom is joined to Course by a direct line, and the Allocation diamond is not joined to Classroom. Entities cannot be linked directly, and Allocation then does not relate Course and Classroom. Wrong.

  6. Diagram (iv): Instructor-Teaches-Course, Course-Registration-Student, Course-Allocation-Classroom and Instructor-Guides-Student. Every entity and relationship in S appears once, and every diamond sits between the right pair of entities. Correct.

KEY IDEA

Nouns in the specification become entities (rectangles) and verbs become relationships (diamonds). Each diamond must join exactly the two entities it relates, and entities are never joined directly.

WATCH OUT FOR

Overlooking the small structural defects in the wrong diagrams: Student drawn as a diamond, an invented entity such as Projects, or Classroom joined straight to Course with Allocation left dangling.

From the GATE 2024 CS1 paper. Every question of this paper · Download the full paper · All 5 ER model questions, with notes

More ER model questions