Practice SQL subqueries in different clauses (SELECT, WHERE, FROM) and understand scalar, correlated, and derived tables.
A subquery is a query inside another SQL query which is used to fetch results that the main query depends on.
A sub query is nested and runs separately and is mainly used for filtering data and join is used to combine rows from multiple tables in one result set.
When a subquery depends upon the outer query for its values and runs per row of the outer query.
Yes subqueries can result in multiple rows.
It checks if the subquery returns at least one row.
Subqueries are slower because they may run multiple times.
A scalar subquery returns a single value.
They are used in select, where, from and having clauses.
Yes, it is known as derived table.
A derived table is a temporary table created using a subquery in the from clause used like a normal table.





