Consider the following three relations in a relational database.
Which of the following relational algebra expressions return the set of who own all the brands?
GATE CSE 2022Databases › Relational Algebra & CalculusVerified
(A, B) Π e I d ( Π e I d , b I d ( O w n ) / Π b I d ( B r a n d ) ) \Pi_{eId} \left(\Pi_{eId,bId} (Own) / \Pi_{bId} (Brand) \right) Π e I d ( Π e I d , b I d ( Ow n ) / Π b I d ( B r an d ) ); Π e I d ( O w n ) – Π e I d ( ( Π e I d ( O w n ) × Π b I d ( B r a n d ) ) – Π e I d , b I d ( O w n ) ) \Pi_{eId} (Own) – \Pi_{eId} \left( ( \Pi_{eId} (Own) \times \Pi_{bId} (Brand)) – \Pi_{eId,bId} (Own)\right) Π e I d ( Ow n ) – Π e I d ( ( Π e I d ( Ow n ) × Π b I d ( B r an d )) – Π e I d , b I d ( Ow n ) )
Use the definition of relational division and its equivalent set-difference formulation to find employees who own every brand.
A is the direct division expression for 'own all brands'. B is a known relational-algebra equivalent of division using set difference and projection. C and D use the wrong divisor or an incorrect cross product, so they do not correctly return the required set of eIds.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.