Nice work! Let's continue with subqueries.
Imagine that you are the head of air traffic control. In our airplanes database, you'd like to know which flights had an origin airport with an elevation greater than 2000 feet. We can do this with a subquery.
We first create an inner query, or subquery, that finds the airports with elevation greater than 2000 from the airports table:
WHERE elevation > 2000;
Next, we take the result set of the inner query and use it to filter on the flights table, to find the flight detail that meets the elevation criteria.
WHERE origin in (
WHERE elevation > 2000);
As shown above, a subquery is nested within another query to give us our desired result.