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?
View worked solution
Answer: C
To understand what the Tuple Relational Calculus (TRC) query produces, let us analyze the logical expression inside the universal quantifier ():
Using the logical equivalence , we can rewrite the expression as:
Now, substituting this back into the original query, we get:
Let's break down the meaning of this rewritten query:
- : We are selecting an employee .
- : This represents any employee who is an immediate subordinate of (since is their supervisor).
- : For all such employees , if is an immediate subordinate of , then must be male.
If all immediate subordinates of must be male, it logically means that employee has no immediate female subordinates (vacuously true if has no subordinates at all).
Therefore, the query retrieves the names of employees with no immediate female subordinates.
Free practice · Your answers on this page are not saved.
