Non-Correlated subqueries I


#1

Hi guys, I am trying to understand the code below.
The point I am confused is why the code has relationship with origin?

SELECT * 
FROM flights 
WHERE origin in (
    SELECT code 
    FROM airports 
    WHERE elevation > 2000);

for example, what I am understand is if the code in the airports table is changed to origin.

such as

SELECT * 
FROM flights 
WHERE origin in (
    SELECT origin 
    FROM airports 
    WHERE elevation > 2000);

#2

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