Ch07 - More SQL; Complex Queries, Triggers, Views, and Schema Modification
Ch07 - More SQL; Complex Queries, Triggers, Views, and Schema Modification
Q7:
If no matching tuple
Padded with NULL values for attributes of right table
RIGHT OUTER JOIN
Every tuple in right table must appear in result
If no matching tuple
Padded with NULL values for attributes of left table
ALTERNATE SYNTAX:
SELECT E.Lname , S.Lname
FROM EMPLOYEE E, EMPLOYEE S
WHERE E.Super_ssn + = S.Ssn
INCORRECT QUERY:
SELECT Dno, COUNT (*)
FROM EMPLOYEE
WHERE Salary>40000
GROUP BY Dno
HAVING COUNT (*) > 5;
R5:
CREATE TRIGGER SALARY_VIOLATION
BEFORE INSERT OR UPDATE OF Salary, Supervisor_ssn ON
EMPLOYEE