Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1.

Find the names of sailors


who have reserved boat
103
1. Find the names of sailors
who have reserved boat
103
1. Find the names of sailors who have reserved boat 103.
𝜋sname (𝜎bid=103 (Reserve ⋈ Sailor)
2. Find the names of sailors who have reserved a red boat.
𝜋sname(𝜎colour=”Red”(Sailor ⋈ Reserves ⋈ Boats))
3. Find the colors of boats reserved by Lubber.
𝜋colour(𝜎sname=”Lubber”(Sailor ⋈ Reserves ⋈ Boats))
4. Find the names of sailors who have reserved at least one boat.
𝜋sname(Sailor ⋈ Reserves)
5. Find the names of sailors who have reserved a red or a green boat.
𝜋sname(𝜎colour=”Red” or “Green” (Sailor ⋈ Reserves ⋈ Boats))
6. Find the names of sailors who have reserved a red and a green boat.
𝜋sname(𝜎colour=”Red”(Sailor ⋈ Reserves ⋈ Boats))
∩ 𝜋sname(𝜎colour”Green” (Sailor ⋈ Reserves ⋈ Boats))
7. Find the sids of sailors with age over 20 who have not reserved a red
boat.
𝜋sid(𝜎 Age>20 And Colour ≠ “Red” (Sailor ⋈ Reserves ⋈ Boats))
8. Find the names of sailors who have reserved all boats.
𝜋sname(𝜎bid=101(Sailor ⋈ Reserves)) ∩ 𝜋sname(𝜎bid=102(Sailor ⋈
Reserves)) ∩ 𝜋sname(𝜎bid=103(Sailor ⋈ Reserves))
∩ 𝜋sname(𝜎bid=104(Sailor ⋈ Reserves))
9. Find the names of sailors who have reserved all boats called
Interlake.
𝜋sname(𝜎bid=101(Sailor ⋈ Reserves)) ∩ 𝜋sname(𝜎bid=102(Sailor ⋈
Reserves))
10.Find the names of sailors who have reserved at least two boats.
𝜋sname((𝜎sid ≠ 74 Reserve) ⋈ Sailor)

You might also like