What is sub-query?
Sub-query is a query within a Query.
Example of sub-query:
Select CustId, Custname From Customer Where Cust_Id IN (Select Doct_Id from Doctor)
What is sub-query?
A query within a query is defined as a sub-query. A sub query is executed by enclosing it within another query. Sub queries are used for returning single row as an atomic value. A sub query is nested in DML statements, and enclosed in parenthesis.