GATE 2014 CS (CS3) – Question 40
Schemas: employee(empId,empName,empAge), dependent(depId,eId,depName,depAge). eId references empId; every employee has at least one associated dependent. Interpret $\pi_{empId}(employee)-\pi_{empId}(employee\bowtie_{empId=eId\,\land\,empAge\le depAge}dependent)$. It returns IDs of employees older than ______.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (D) all of their own dependents
Explanation
The join selects employees whose age is less than or equal to some associated dependent’s age. Removing those IDsfrom all employees leaves those older than every one of their own dependents. Thus **D**. The premise that every employee has a dependent avoids a vacuous case.