Non correlated subquery II explanation

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/sql-table-transformation/lessons/subqueries/exercises/non-correlated-i

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I can follow the directions and use the template to get the correct answer to advance past the lesson but no matter how many other forum threads I read, I’m still not understanding how we get to this answer.

In the code below, the nested query gets all ‘codes’ from the airports table where faa_region is set to aso. I get that. But then the top query gets all data from the flights row where origin is in the code list. I do not see how the two are related. I would’ve thought they would be linked by ID or something.

<In this course, it often helps to include a screenshot of your whole web browser – that lets everyone see what you see. If you wish to include a screenshot, add it below this line.>

<If you wish to copy/paste in your code, you can use this next section. This will allow others to copy/paste your code for testing – something that they won’t be able to do with just a screenshot.>

```

SELECT *
FROM flights
WHERE origin in (
SELECT code FROM airports
WHERE faa_region = ‘ASO’);

<do not remove the three backticks above>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.