Question:

The following relation records the age of 500 employees of a company, where empNo (indicating the employee number) is the key:
\[ empAge(empNo, age) \] Consider the following relational algebra expression:
\[ \Pi_{empNo}\big( empAge \;\Join_{age > age_1}\; \rho_{empNo_1,\,age_1}(empAge) \big) \] What does the above expression generate?

Show Hint

Self-joins with conditions like \(>\) or \(<\) are commonly used to eliminate minimum or maximum values in relational algebra.
Updated On: Jan 2, 2026
  • Employee numbers of only those employees whose age is the maximum.
  • Employee numbers of only those employees whose age is more than the age of exactly one other employee.
  • Employee numbers of all employees whose age is not the minimum.
  • Employee numbers of all employees whose age is the minimum.
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Understanding the self-join.
The relation \(\rho_{empNo_1,\,age_1}(empAge)\) is a renamed copy of the same table. The join condition \(age > age_1\) selects all pairs of employees where one employee is older than another.

Step 2: Interpreting the join result.
For any employee whose age is not the minimum, there exists at least one other employee with a smaller age. Hence, such employees will appear in the join result.

Step 3: Effect of projection.
The projection \(\Pi_{empNo}\) retains only the employee numbers of those employees who satisfy the condition \(age > age_1\).

Step 4: Identifying excluded employees.
Employees with the minimum age have no other employee younger than them. Therefore, they do not satisfy the join condition and are excluded from the result.

Step 5: Conclusion.
The expression returns the employee numbers of all employees whose age is not the minimum.

Was this answer helpful?
0
0