subquery

A query written in brackets inside another query, whose result the outer query uses.

In more detail

A scalar subquery returns one value, a list subquery feeds IN, and a subquery in FROM acts like a temporary table. A correlated subquery refers to the outer row and is evaluated per row. Use a join instead when the related rows belong in the output.

Related terms

Taught in

References