What is subquery?

A subquery is a query within another query. The outer query is called as main query, and inner query is called subquery. SubQuery is always executed first, and the result of subquery is passed on to the main query.
 
Let’s look into the sub query syntax –You can use a query like
SELECT category_name FROM categories WHERE category_id =( SELECT MIN(category_id) from movies);