GATE / CS ARCHIVE

GATE CSE 2007 / QUESTION 60

Universal condition on immediate subordinates

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2007 paper

GATE 2007, Q60 2 marks · MCQ
Report issue

Relational Algebra & Calculus

Question 60, GATE 2007: employee(name,sex,supervisorName) has key name. supervisorName names an employee’s supervisor. Interpret the tuple-calculus query {e.name | employee(e) ∧ ∀x[¬employee(x) ∨ x.supervisorName≠e.name ∨ x.sex="male"]}.
Options:
(A) Employees with a male supervisor
(B) Employees with no immediate male subordinates
(C) Employees with no immediate female subordinates
(D) Employees with a female supervisor
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Rewrite the disjunction as an implication about x: if x is an employee supervised by e, x must be male. Universal conditions are true even when e has no subordinates.

2. Derivation and interpretation. The universal disjunction ¬employee(x) ∨ x.supervisorName≠e.name ∨ x.sex=male is the implication: if x is an employee supervised by e, then x is male. Consequently the result includes employees all of whose immediate subordinates are male, including employees with no subordinates by vacuous truth. Under the male/female domain convention used by the options, this is exactly employees with no immediate female subordinates (C). It says nothing about the sex of e's own supervisor.

Original paper, page 15