In TRC (Tuple Relational Calculus), which of the following expressions…
2024
In TRC (Tuple Relational Calculus), which of the following expressions correctly retrieves all tuples from the Employee relation where the attribute salary is strictly greater than 50,000?
- A.
{t | Employee(t) ∨ t.salary > 50000}
- B.
σ salary>50000(Employee)
- C.
{t : salary > 50000 || Employee(t)}
- D.
{t | Employee(t) → t.salary > 50000}
- E.
{t | Employee(t) ∧ t.salary > 50000}
Attempted by 9 students.
Show answer & explanation
Correct answer: E
We need a Tuple Relational Calculus (TRC) expression of the form {t | P(t)} that returns exactly the Employee tuples whose salary exceeds 50000.
A safe TRC filter combines two parts with conjunction (∧): the membership predicate Employee(t), which binds t to tuples of the Employee relation, and the condition t.salary > 50000.
Therefore the correct expression is: {t | Employee(t) ∧ t.salary > 50000}.
Why the others fail: using ∨ (OR) admits any tuple that is an Employee OR earns more than 50000, so it neither filters Employees nor stays safe. Using → (implication) is vacuously true for every non-Employee tuple, again admitting unwanted tuples. σ salary>50000(Employee) is relational algebra, not TRC. And {t : salary > 50000 || Employee(t)} is malformed (salary is not bound to t) and uses OR.
Hence the answer is {t | Employee(t) ∧ t.salary > 50000}.