Project ForgeSign up free
Database Management Systems
Relational Algebra
GATE 2007
Hard

Consider the relation employee(name, sex, supervisorName) with name as the key. supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce?

{e.name | employee(e) ∧ (∀x)[¬employee(x) ∨ x.supervisorName ≠ e.name ∨ x.sex = "male"]}

  • ANames of employees with a male supervisor
  • BNames of employees with no immediate male subordinates
  • Names of employees with no immediate female subordinates
  • DNames of employees with a female supervisor

Explanation

The inner disjunction ¬employee(x)∨x.supervisorName≠e.name∨x.sex="male" is logically equivalent to: (employee(x) ∧ x.supervisorName=e.name) → x.sex="male". So for ALL x, if x is a subordinate of e, then x must be male — meaning e has no immediate female subordinates.

Source: GATE CS 2007 (2007)

This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.

Start revising free