1. Which option best describes a correlated subquery?
A correlated subquery depends on the current row of the outer query. The database must re-evaluate it for each outer row. This design is expressive, but can be slow if the inner expression is not selective or not indexed. Many engines can transform it into a join when the logic allows.
SELECT e.emp_id FROM employees e WHERE e.salary > ( SELECT AVG(salary) FROM employees x WHERE x.dept_id = e.dept_id );