What is a subquery?

A subquery is a query written inside another SQL query. It is used to retrieve data that will be used by the main query.