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
- Consider R(A, B, C, D, E) be relation with following dependencies: C->F, E->A, EC->D, A->B. Which of the following is a key for R ?
- In a relational database, which one of the following is CORRECT:
- An alternate key in database table is also called
- In concurrency control, phantom problem may occur, when-
- Match the LIST-I with LIST-II
- The degree of a relation in database is