Query with in query that is called Sub query.sub query also called INNER QUERY.For example see the below query:
SELECT p.productid, p.productName
FROM products p
WHERE p.productid IN
(SELECT pd.productid
FROM productdetails pd
WHERE pd.quantity > 5);
it is the inner query in this statement.
(SELECT pd.productid FROM productdetails pd WHERE pd.quantity > 5)