The Advanced Programming prep guide distinguishes correlated and non-correlated subqueries with the following definitions.
A noncorrelated subquery is a self-contained subquery that executes independently of the outer query. The simplest type of subquery is a noncorrelated subquery that returns a single value.
correlated - A dependent subquery is one that requires one or more values to be passed to it by the outer query before the subquery can return a value to the outer query.
Later on, however, they mention the following SQL query being a correlated subquery but how can that be? How is the subquery in this case dependent on the outer query?
The following PROC SQL query accomplishes this task by using a correlated subquery and the NOT EXISTS operator.
proc sql;
select lastname, firstname
from certadv.flightattendants
where not exists
(select * from certadv.flightschedule where
flightattendants.empid= flightschedule.empid);
quit;