Intermediate Database Management Systems
Q72 / 100

What is the purpose of the EXISTS operator in SQL?

Correct! Well done.

Incorrect.

The correct answer is D) To test whether a subquery returns at least one row, often more efficient than IN for correlated subqueries since it can stop at the first match

D

Correct Answer

To test whether a subquery returns at least one row, often more efficient than IN for correlated subqueries since it can stop at the first match

Explanation

EXISTS returns TRUE as soon as the subquery produces one matching row, short-circuiting further evaluation. This often makes it faster than IN for large correlated subqueries, especially when the optimizer can use semi-join strategies.

Progress
72/100