All mock tests are FREE till 31 December — register to save your progress
Unit 4 · Database Management Systems Paper 2 CS · June 2025

Consider the following three relations Employee(eid, eName), Comp(cid, cName), Own(eid, cid). Which of the following relational algebra expressions returns the set of eids who own all brands?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. π_eid( π_eid,cid(Own) ÷ π_cid(Comp) )

Explanation

"For all" queries use division. π_eid,cid(Own) ÷ π_cid(Comp) keeps exactly those eids that are paired with every cid in Comp. Cartesian products (B, C) pair everyone with everything and give no 'all' condition.

More Database Management Systems questions