The GATE Grind

GATE 2014 CS (CS3) – Question 40

Databases · Relational Model: Relational Algebra, Tuple Calculus, SQL · 2 marks · Multiple choice

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 ______.

  1. some dependent
  2. all dependents
  3. some of their own dependents
  4. all of their own dependents

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.