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

Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.

Table 1: Sailors

SidSnameRatingAge
22Dustin745.0
29Brutus133.0
31Lubber855.5
32Andy825.5
58Rusty1035.5
64Horatio735.5
71Zorba1016.0
74Horatio935.0
85Art325.5
95Bob363.5

Table 2: Reserves

SidBidDay
2210110/10/98
2210210/10/98
2210310/8/98
2210410/7/98
3110211/10/98
3110311/6/98
3110411/12/98
641019/5/98
641029/8/98
741039/8/98

Table 3: Boats

BidBnameColor
101Interlakeblue
102Interlakered
103Clippergreen
104Marinered

Which query computes the names of sailors who have reserved all boats?

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

Show answer & explanation

Correct answer: B. ρ(Tempsids, (πsid, bid Reserves) ÷ (πbid Boats)); πsname(Tempsids ⋈ Sailors)

Explanation

Division (sid, bid) ÷ (bid) returns the sids paired with every bid in Boats. Here that is only sid 22 (Dustin).

More Database Management Systems questions