You are on page 1of 2

2.

Find the names of sailors who have reserved a red boat:

π_sname(σ_color=Red(Reserves) ⋈ Sailors)
3. Find the colors of boats reserved by Lubber:

π_color(σ_sname=Lubber(Reserves) ⋈ Boats)
4. Find the names of sailors who have reserved at least one boat:

π_sname(Reserves ⋈ Sailors)
5. Find the names of sailors who have reserved a red or a green boat:

π_sname((σ_color=Red(Reserves) ∪ σ_color=Green(Reserves)) ⋈ Sailors)


6. Find the names of sailors who have reserved a red and a green boat:

π_sname((σ_color=Red(Reserves) ⋈ Sailors) ∩ (σ_color=Green(Reserves) ⋈ Sailors))


7. Find the sids of sailors with age over 20 who have not reserved a red boat:

π_sid((σ_age>20(Sailors) - σ_color=Red(Reserves) ⋈ Sailors))


8. Find the names of sailors who have reserved all boats:

π_sname(Reserves) - π_sname(Boats - ⋈_bid(Reserves × Boats))


9. Find the names of sailors who have reserved all boats called Interlake:

π_sname(Reserves) - π_sname((σ_bname=Interlake(Boats) - ⋈_bid(Reserves ×


σ_bname=Interlake(Boats))))

10. Find the names of sailors who have reserved at least two boats:
π_sname(Reserves) - π_sname(Reserves) ÷ Reserves

You might also like