Some comparisons depend on the current row, like "earns more than the average of their own department". A correlated subquery refers to a column of the outer query, so it is evaluated again for each outer row. Use it for per-row comparisons against a group the row belongs to. It can be slow on large tables, and a join or window function is often the faster alternative.