Multiple choice

What is a correlated sub query?

  1. The result retrieved by the inner query is fed to the outer query.

  2. A correlated sub-query is dependent upon the outer query.

  3. The outer query gives a reference to the sub query.

  4. Both (1) and (2)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A correlated subquery executes once for each row processed by the outer query, referencing values from the outer query in its WHERE clause. This creates a correlation between the inner and outer queries. Option A describes a regular (non-correlated) subquery where the inner query runs independently. Option C is incomplete - the outer query does provide references, but the key characteristic is the dependency. Option B correctly states the defining feature.