Great! The query we just ran is just one kind of subquery, what we refer to as a non-correlated subquery. A non-correlated subquery is a subquery that can be run independently of the outer query and as we saw, can be used to complete a multi-step transformation.
Let's try one more non-correlated subquery. Perhaps we'd like to look at a selection of flights whose origin airport is a seaplane base, designated by
SEAPLANE_BASE. The facility type of an airport is located in the
fac_type field of the airports table.
WHERE origin in (
WHERE fac_type = 'SEAPLANE_BASE');