A subquery answers a specific question or provides specific information within the context of a main query, also called a "parent" statement. The database evaluates the entire query by first analyzing the subquery. The parent statement filters its rows based on the rows retrieved by the subquery.
For example, you might need to find out who sold more than the average of all sales representatives in April. You first use a subquery to define what was the average sales amount in April. This information is supplied to the parent query, which determines which representatives exceeded the average of all sales in April.