Exams › GATE › Technical
Consider the following three relations in a relational database.
Employee(eId, Name), Brand(bId, bName), Own(eId, bId)
Which of the following relational algebra expressions return the set of eIds who own all the brands?
- Π_eId (Π_eId,bId (Own) / Π_bId (Brand))
- Π_eId (Own) − Π_eId ((Π_eId (Own) × Π_bId (Brand)) − Π_eId,bId (Own))
- Π_eId (Π_eId,bId (Own) / Π_bId (Own))
- Π_eId ((Π_eId (Own) × Π_bId (Own)) / Π_bId (Brand))
Correct answer: Π_eId (Π_eId,bId (Own) / Π_bId (Brand))
Solution
This expression correctly identifies eIds that own all brands by performing a division operation, which effectively filters out eIds that do not have ownership of every brand listed in the Brand relation.
Related GATE Technical questions
⚔️ Practice GATE Technical free + battle 1v1 →