Module 3 DBMS
Module 3 DBMS
Q7:
If no matching tuple
If no matching tuple
ALTERNATE SYNTAX:
SELECT E.Lname , S.Lname
FROM EMPLOYEE E, EMPLOYEE S
WHERE E.Super_ssn + = S.Ssn
Multiway JOIN in the FROM clause
FULL OUTER JOIN – combines result if LEFT
and RIGHT OUTER JOIN
Can nest JOIN specifications for a multiway join:
INCORRECT QUERY:
SELECT Dno, COUNT (*)
FROM EMPLOYEE
WHERE Salary>40000
GROUP BY Dno
HAVING COUNT (*) > 5;
Combining the WHERE and the
HAVING Clause (continued)
Correct Specification of the Query:
Note: the WHERE clause applies tuple by tuple
R5:
CREATE TRIGGER SALARY_VIOLATION
BEFORE INSERT OR UPDATE OF Salary, Supervisor_ssn ON
EMPLOYEE