Learn

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');

Instructions

1.

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

Folder Icon

Sign up to start coding

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

Already have an account?