Assignment title: Information
Text: Fundamentals of Database Systems, Elmasri, Ramez; Navathe, Shamkant B.
Chapter 26: Answer the following questions. (60 points total)
26.34 Consider the COMPANY database described in Figure 5.6 on page 162 of E&N. Using the syntax of
Oracle triggers, write the active rules to do the following: (20 points)
a. Whenever an employee's project assignments are changed, check if the total hours per week
spent on the employee's projects are less than 30 or greater than 40; if so, notify the
employee's direct supervisor.
Use this command to notify the manager of that an employee has worked more or less hours
than expected:
host /usr/sbin/sendmail -t <"Employee " + Essn + " has more or less hours than expected this
week">
b. Whenever an employee is deleted, delete the PROJECT tuples and DEPENDENT tuples related
to that employee, and if the employee manages a department or supervises employees, set the
Mgr_ssn for that department to NULL and set the Super_ssn for those employees to NULL.
26.35 Repeat Exercise 26.34 (prior question) but use the syntax of STARBURST active rules. (20 points)
26.43 Consider a deductive data base with the following rules: (20 points)
r 1 : ANCESTOR(X, Y) :- FATHER(X, Y)
r 2 : ANCESTOR(X, Y) :- FATHER(X, Z), ANCESTOR(Z, Y)
Notice that FATHER(X, Y) means that X is the father of Y; ANCESTOR(X, Y) means that X is the ancestor of
Y.
Consider the following fact base:
FATHER(Harry, Issac), FATHER(Issac, John), FATHER(John, Kurt)
a. Construct a model-theoretic interpretation of the above rules using the given facts.
b. Consider that a database contains the above relations FATHER(X, Y), and another relation
BROTHER(X,Y), and third relation BIRTH(X, B), where B is the birth date of Person X. State a rule that
computes the first cousins of the following variety: their fathers must be brothers