Nested Queries
One of the most powerful features of SQL is nested
queries
A nested query is a query that has another query
embedded within it the embedded query is called a
subquery.
A subquery typically appears within the WHERE clause of
a query
Subqueries can sometimes appear in the FROM clause
or the HAVING clause
GROUP BY and HAVING Clauses
we have applied aggregate operations to all
(qualifying) rows in a relation.
Often we want to apply aggregate operations to
each of a number of groups of rows in a relation,
where the number of groups depends on the relation
instance
Nested Queries-SQL.ppt
Nested Queries-SQL.ppt
Nested Queries-SQL.ppt

Nested Queries-SQL.ppt

  • 1.
    Nested Queries One ofthe most powerful features of SQL is nested queries A nested query is a query that has another query embedded within it the embedded query is called a subquery. A subquery typically appears within the WHERE clause of a query Subqueries can sometimes appear in the FROM clause or the HAVING clause
  • 8.
    GROUP BY andHAVING Clauses we have applied aggregate operations to all (qualifying) rows in a relation. Often we want to apply aggregate operations to each of a number of groups of rows in a relation, where the number of groups depends on the relation instance