Intermediate
Database Management Systems
Q50 / 100
What is the difference between correlated and uncorrelated subqueries?
Correct! Well done.
Incorrect.
The correct answer is B) A correlated subquery references the outer query and executes once per outer row; an uncorrelated subquery executes once independently
B
Correct Answer
A correlated subquery references the outer query and executes once per outer row; an uncorrelated subquery executes once independently
Explanation
Uncorrelated: SELECT * FROM t WHERE salary > (SELECT AVG(salary) FROM t) — inner query runs once. Correlated: per-outer-row execution — often slow, replaceable with JOINs.
Progress
50/100