Introduction to Subqueries
A subquery is a query inside another query.
Find employees earning more than average:
The inner query runs first, returns a value, then the outer query uses it.
Subqueries can appear in:
WHEREclause (most common)FROMclauseSELECTclause
Check your understanding
Find employees earning more than the average salary.
Examples run on the employees sample database. Open any of them in the playground to experiment.