PrepZone Logo
PrepZone
Back to Database

Database · Medium

Explain scalar, multi-row, and correlated subqueries with examples.

DatabaseSQLFresher

Answer preview

A subquery is a SELECT nested inside another statement. They are classified by what they return — a single value (scalar), a list of values (multi-row), or a whole table (inline view) — and by whether they depend on the outer row (correlated) or not (non-correlated).…