Skip to content
GATEiit

GATE CSE 2021 Set 1 Q37: Meaning of a self theta-join on employee age

Question

The following relation records the age of 500 employees of a company, where empNoempNo (indicating the employee number) is the key:

empAge(empNo‾, age)empAge(\underline{empNo},\ age)

Consider the following relational algebra expression:

ΠempNo(empAge⋈(age>age1)ρempNo1, age1(empAge))\Pi_{empNo}\left(empAge \bowtie_{(age > age1)} \rho_{empNo1,\, age1}(empAge)\right)

What does the above expression generate?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: C (official GATE 2021 final answer key)

Concept used: A self theta-join with age>age1age > age1 keeps an employee whenever at least one other employee is younger.

First step: Ask which employees have no partner row with a smaller age.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key