Find sid’s of sailors who’ve reserved a red or a green boat
UNION: Can be used to compute the union of any two union-compatible sets of tuples (which are themselves the result of SQL queries).
If we replace OR by AND in the first version, what do we get?
Also available: EXCEPT (What do we get if we replace UNION by EXCEPT?)
FROM Sailors S, Boats B, Reserves R
WHERE S.sid=R.sid AND R.bid=B.bid
AND (B.color=‘red’ OR B.color=‘green’)
FROM Sailors S, Boats B, Reserves R
WHERE S.sid=R.sid AND R.bid=B.bid
FROM Sailors S, Boats B, Reserves R
WHERE S.sid=R.sid AND R.bid=B.bid