A subquery is a SELECT query that is nested within another SELECT, INSERT, UPDATE, or DELETE statement.
A subquery can also be nested inside another subquery.
Subqueries can often be re-written into regular JOINs.
Sometimes an existence subquery can perform better than equivalent non-subquery methods.
A correlated subquery is a subquery whose results depend on the values of the outer query.
SELECT