Difficulty: Easy
Correct Answer: By nesting (the DBMS computes the subquery result and then applies it in the outer query).
Explanation:
Introduction / Context:
Subqueries are SELECT statements embedded inside another SQL statement. Understanding how a regular (non-correlated) subquery is evaluated helps you predict results, reason about NULL behavior, and rewrite queries for performance or clarity.
Given Data / Assumptions:
Concept / Approach:
Conceptually, a regular subquery is evaluated first to obtain a result set (or a single scalar). That result is then “plugged into” the outer query expression. This is often described as processing by nesting. Although optimizers can flatten or transform subqueries into joins, the logical semantics remain: evaluate the inner request, then apply it.
Step-by-Step Solution:
Verification / Alternative check:
Explaining plans frequently show subquery computation (or its equivalent join after transformation). The logical reading in documentation consistently presents regular subqueries as values supplied to the outer query.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
By nesting (the DBMS computes the subquery result and then applies it in the outer query).
Discussion & Comments