GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 30

GATE CSE 2014 Set 3 Q30

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q30 2 marks · MCQ
Report issue

Relational Algebra & Calculus

Question 30, GATE 2014: Schemas: employee(empId,empName,empAge) and dependent(depId,eId,depName,depAge), with eId referencing employee.empId. Every employee has at least one dependent. Interpret π_empId(employee)−π_empId(employee ⋈_(empId=eId ∧ empAge≤depAge) dependent). It returns employees older than A some dependent; B all dependents; C some of their own dependents; D all of their own dependents.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step 1: The join condition first pairs each employee only with that employee's own dependents. Its age condition selects counterexamples to “employee is older”: a dependent whose age is at least the employee's age. Step 2: Projecting empId collects employees with at least one such counterexample. Subtracting this set from all empIds keeps employees with none. Step 3: No own dependent is as old or older means the employee is strictly older than every own dependent, D. The nonempty-dependent premise prevents vacuous cases; ordinary relational algebra here assumes comparable, non-NULL ages.

Original paper, page 59 · Answer key