subquery

Query within query

A subquery is a query nested inside another query in database programming.

The inner query executes first, and its results feed into the outer query: The subquery returns all customer IDs with unpaid balances.

Subqueries can appear in SELECT, WHERE, or FROM clauses, enabling complex data retrieval in a single statement.

nested

correlated

Mutually related statistically

inner · outer · CTE · recursive · materialized · lateral · uncorrelated · parenthetical · embedded · encapsulated

operation

select

Carefully pick from options

exists · in · any · all · join · union · intersect · except · aggregate · comparison

filter

predicate

Sentence's non-subject portion

restriction · qualifier · exclusion · inclusion · screening · refinement · limitation · specification · parameter · narrowing

optimization

index

Alphabetical guide to contents

cost · bottleneck · refactoring · flattening · materialization · rewriting · hints · statistics · cardinality · efficiency

Opposites
query structure

subqueryjoin

Connect or enlist

Family

subqueries

Familiarity
Top 1,000,000
Profile
Used worldwide · Timeless · Abstract · Rated G