Repeat 26.34 but use the syntax of STARBURST active rules.
What will be an ideal response?
(a) We assume that a procedure TELL_SUPERVISOR(ARGSSNS) has been created.
This procedure looks for employees whose SSN matches the social security numbers passed by the procedure’s AGRSSNS argument and it notifies supervisors of those employees.
CREATE RULE INFORM_SUPERVISOR_ABOUT_HOURS ON WORKS_ON
WHEN UPDATED (HOURS)
THEN TELL_SUPERVISOR (SELECT DISTINCT ESSN FROM
WORKS_ON AS W WHERE
((SELECT SUM(HOURS) FROM WORKS_ON AS R
WHERE W.ESSN = R.ESSN) < 30)
OR
(SELECT SUM(HOURS) FROM WORKS_ON AS R
WHERE W.ESSN = R.ESSN) > 40))
AND
W.ESSN IN (SELECT ESSN FROM NEWUPDATED);
(b)
CREATE RULE DELETE_IN_CASCADE ON EMPLOYEE
WHEN DELETED
THEN DELETE FROM WORKS_ON AS W
WHERE W.ESSN IN (SELECT ESSN FROM DELETED AS D
WHERE D.ESSN = W.ESSN);
DELETE FROM DEPENDENT AS P
WHERE P.ESSN IN (SELECT ESSN FROM DELETED AS D
WHERE D.ESSN = P.ESSN);
UPDATE EMPLOYEE AS E
SET E.SUPERSSN = ‘null’;
WHERE E.SSN IN (SELECT ESSN FROM DELETED AS D
WHERE D.ESSN = E.ESSN);
You might also like to view...
In Access, what does the exclamation point (!) at the left of the input mask mean?
A) It causes the field to be filled in from left to right. B) It means that the field is required. C) It means that the field in optional. D) It causes the field to be filled in from right to left.
The operators that cannot be overloaded are __________, ___________, and ____________.
Fill in the blank(s) with the appropriate word(s).