correlated query (sql)
09:08 01 Apr 2026

could you please explain the correlated query ,

i have a confusion about table of correlated query compare with same table

how the inner query compare with outer query with same table

SELECT e.name AS Employee
FROM Employee e
WHERE e.salary > (
    SELECT m.salary 
    FROM Employee m
    WHERE m.id = e.managerId);
sql sql-server