A subquery is a SELECT statement embedded within another SQL statement, usually in the WHERE clause. Subqueries allow data to be returned from multiple tables in an alternate way. They can be used with SELECT, INSERT, UPDATE, and DELETE statements along with comparison operators. Subqueries execute first before the main query uses their results. There are two types: single-row subqueries return one row while multiple-row subqueries return more than one row.