Lab 1
Lab 1
Boats
Sailors Reserves
4. Find the names of sailors who have reserved at least one boat.
π sname ¿)
5. Find the names of sailors who have reserved a red or a green boat
ρ¿
π sname ¿
6. Find the names of sailors who have reserved a red and a green boat
7. Find the sids of sailors with age over 20 who have not reserved a red boat
' '
π sid ( σ age >20 sailors )−π sid ((σ ¿ ¿ ℜd ¿ boats)⋈ reserves ⋈ sailors)
9. Find the names of sailors who have reserved all boats called Interlake
10. Find the names of sailors who have reserved at least two boats
ρ ¿)
ρ ( Reserv ationpairs (1 → sid 1,2 → sname , 3→ bid 1,4 → sid 2,5 → sname , 6 → bid 2 ) , Reservations× Reservations
π sname 1 σ (sid 1=sid 2)∧(bid 1 ≠bid 2) Reservationpairs ¿