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 in Los Angeles. The name of an airport’s city is stored in the city field of the airports table.

SELECT * FROM flights WHERE origin in ( SELECT code FROM airports WHERE city = 'LOS ANGELES');



Using the same pattern, find flight information about flights where the Federal Aviation Administration region (faa_region) is the Southern region (ASO).

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?