GATE / CS ARCHIVE

GATE CSE 2017 SET 1 / QUESTION 46

GATE CSE 2017 Set 1 Q46

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2017 Set 1 paper

GATE 2017 Set 1, Q46 2 marks · NAT
Report issue

Relational Algebra & Calculus

Question 46, GATE 2017: CR(StudentName,CourseName) contains course sets SA:{CA,CB,CC}, SB:{CB,CC}, SC:{CA,CB,CC}, SD:{CA,CB,CC,CD}, SE:{CD,CA,CB}, SF:{CA,CB,CC}. T1=πCourseName(σStudentName=SA(CR)); T2=CR÷T1. Find rows in T2.
Tap to enlarge
Answer & solution

Official answer: 4.0

Our answer: 4

1. Selection finds the rows for SA, then projection removes the student column. Thus T1 is the three-course set {CA,CB,CC}.

2. Relational division returns each student who is paired with every course in T1. Extra courses do not disqualify a student.

3. SA,SC,SD,SF contain all three. SB lacks CA; SE lacks CC. Thus T2 consists of four student names, so the answer is 4. The number of qualifying enrolment rows is not what division returns.

Original paper, page 21 · Answer key