A subquery is a query nested within another query. The inner subquery executes first and its results are used by the outer query. There are different types of subqueries including single-row, multiple-row, multiple-column, and correlated subqueries. Single-row subqueries use operators like = and > to compare a single result, while multiple-row subqueries use operators like IN, ALL, ANY to handle multiple returned rows. Correlated subqueries are executed once for each row returned by the outer query, allowing the queries to reference each other.