Documente Academic
Documente Profesional
Documente Cultură
Complex Queries
Triggers
Views
and
Schema Modification
1. Complex features of SQL retrieval queries, such as
• nested queries,
• joined tables,
• outer joins,
• aggregate functions, and
• grouping
FROM EMPLOYEE
The two keywords ANY and SOME have the same effect.
WHERE E.Super_ssn=S.Ssn;
Joined Tables in SQL and Outer Joins
The concept of a joined table (or joined relation) was
incorporated into SQL to permit users to specify a table
resulting from a join operation in the FROM clause of a
query.
WHERE Dname=‘Research’;
ON E.Super_ssn=S.Ssn);
In SQL, the options available for specifying joined tables
include
• INNER JOIN (only pairs of tuples that match the join
condition are retrieved, same as JOIN),
WHERE Plocation=‘Stafford’;
syntax available in Oracle
( SELECT Dno
FROM EMPLOYEE
GROUP BY Dno
HAVING COUNT (*) > 5)
Specifying General Constraints as
Assertions in SQL