GATE / CS ARCHIVE

GATE CSE 2022 / QUESTION 25

GATE CSE 2022 Q25

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2022 paper

GATE 2022, Q25 1 mark · MSQ
Report issue

Relational Algebra & Calculus

Question 25, GATE 2022: Given Employee(eId,Name), Brand(bId,bName), Own(eId,bId), select expressions returning owners of every brand. Define O=π_eId,bId(Own), E=π_eId(Own), B=π_bId(Brand), H=π_bId(Own). Options: A π_eId(O÷B); B E−π_eId((E×B)−O); C π_eId(O÷H); D π_eId((E×H)÷B).
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A,B

Our answer: A,B under the standard division candidate universe

A divides the employee-brand pairs by all brand IDs. B starts with employee IDs occurring in Own and removes those with at least one missing pair from the Cartesian product with Brand. These are the standard equivalent formulations of relational division. C divides only by brands that someone owns, potentially omitting unowned brands; D manufactures ownership pairs by a Cartesian product. Thus A, B. Boundary qualification: both A and B use π_eId(Own), not all rows of Employee, as their candidate universe. If Brand is empty and “all brands” is interpreted vacuously for every Employee, employees absent from Own are omitted. The intended nonempty-brand/owner-universe reading should be kept explicit.

For B, E×B enumerates every required owner-brand pair, and subtracting O finds missing ownerships. Projecting to eId identifies failures, which are subtracted from E. For C, one brand absent from all Own tuples is a counterexample: division by H ignores it. D can claim someone owns a brand merely because another employee owns it.

Original paper, page 20 · Answer key