Directions (Q31–35): Consider the relational schema of Sailors S, Reserves R and Boats B.
Table 1: Sailors
| Sid | Sname | Rating | Age |
|---|---|---|---|
| 22 | Dustin | 7 | 45.0 |
| 29 | Brutus | 1 | 33.0 |
| 31 | Lubber | 8 | 55.5 |
| 32 | Andy | 8 | 25.5 |
| 58 | Rusty | 10 | 35.5 |
| 64 | Horatio | 7 | 35.5 |
| 71 | Zorba | 10 | 16.0 |
| 74 | Horatio | 9 | 35.0 |
| 85 | Art | 3 | 25.5 |
| 95 | Bob | 3 | 63.5 |
Table 2: Reserves
| Sid | Bid | Day |
|---|---|---|
| 22 | 101 | 10/10/98 |
| 22 | 102 | 10/10/98 |
| 22 | 103 | 10/8/98 |
| 22 | 104 | 10/7/98 |
| 31 | 102 | 11/10/98 |
| 31 | 103 | 11/6/98 |
| 31 | 104 | 11/12/98 |
| 64 | 101 | 9/5/98 |
| 64 | 102 | 9/8/98 |
| 74 | 103 | 9/8/98 |
Table 3: Boats
| Bid | Bname | Color |
|---|---|---|
| 101 | Interlake | blue |
| 102 | Interlake | red |
| 103 | Clipper | green |
| 104 | Marine | red |
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
- Which query computes the names of sailors who have reserved a red and a green boat?
- Let R(ABCDEFGH) be a relation schema and F = {A → B, ABCD → E, EF → G, EF → H, ACDF → EG} the set of dependencies. The minimal cover of F is
- A trigger is
- In reference to Big Data, consider the following databases: (A) Memcached (B) CouchDB (C) InfiniteGraph Choose the most appropriate answer…
- Match List I with List II. Choose the correct answer from the options given below:List I List II A. BCNF I. It removes multivalued dependen…
- Consider the following statements: Statement I: Conservative 2PL is a deadlock-free protocol. Statement II: Thomas's write rule enforces co…