What is a Subquery?
use of subquery.
A Subquery is a SQL query within another query. It is a subset of a Select statement whose return values are used in filtering the conditions of the main query.
Here is the simple subquery for your better understanding.
WHERE Id IN (SELECT ProductId
WHERE Quantity > 50)