Nested Queries
A very powerful feature of SQL: a WHERE clause can itself contain an SQL query! (Actually, so can FROM and HAVING clauses.)
To find sailors who’ve not reserved #103, use NOT IN.
To understand semantics of nested queries, think of a nested loops evaluation: For each Sailors tuple, check the qualification by computing the subquery.
WHERE S.sid IN (SELECT R.sid
Find names of sailors who’ve reserved boat #103: