Skip to content
GATEiit

GATE CSE 2017 Session 1 Q56: Rows in CR ÷ courses taken by SA (relational division)

Syllabus topic: Relational model: relational algebra, tuple calculus and SQL

Question

Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below.

CR
StudentNameCourseName
SACA
SACB
SACC
SBCB
SBCC
SCCA
SCCB
SCCC
SDCA
SDCB
SDCC
SDCD
SECD
SECA
SECB
SFCA
SFCB
SFCC

The following query is made on the database.

T1←πCourseName(σStudentName=′SA′(CR))

T2←CR÷T1

The number of rows in T2 is ______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 4 (official GATE 2017 final answer key)

Concept used: Relational division CR÷T1 returns the students who are paired with every course in T1.

Concept notes

Loading notes…

First step: First find T1, the set of courses taken by SA, then check which students have all of those courses.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Relational model: relational algebra, tuple calculus and SQL

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key