Bird
0
0

What is a key characteristic of a correlated subquery in PostgreSQL?

easy📝 Conceptual Q11 of 15
PostgreSQL - Subqueries in PostgreSQL
What is a key characteristic of a correlated subquery in PostgreSQL?
AIt runs the inner query once for each row of the outer query.
BIt runs the inner query only once regardless of outer rows.
CIt always returns a fixed number of rows.
DIt cannot reference columns from the outer query.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the definition of correlated subquery

    A correlated subquery references columns from the outer query and runs once per outer row.
  2. Step 2: Compare options with this behavior

    Only It runs the inner query once for each row of the outer query. correctly states that the inner query runs once per outer row.
  3. Final Answer:

    It runs the inner query once for each row of the outer query. -> Option A
  4. Quick Check:

    Correlated subquery = runs per outer row [OK]
Quick Trick: Correlated means inner query depends on outer row [OK]
Common Mistakes:
  • Thinking inner query runs once for all rows
  • Assuming no reference to outer query columns
  • Confusing correlated with uncorrelated subqueries

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes