Practice mode DBMS and SQL

What makes a subquery a correlated subquery?

Correct answer D. It refers to a column of the outer query, so it is evaluated for each outer row

Explanation

A correlated subquery references a column from the enclosing query, for example WHERE o.cust_id = c.id, so its result depends on the current outer row and it is logically re-evaluated for each one. A non-correlated subquery is independent and can be run once. Returning a single value makes a subquery scalar, which is a separate property; a scalar subquery may or may not be correlated.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.