Rule processing is strictly sequential. No conflict resolution is necessary for no two rules can be defined to have the same triggering event. The same table cannot be modified multiple times in a sequence of rule firings. Example 2 Suppose there are two relations and such that the foreign key of references the primary key of . A end Example 3 Write a trigger to count the number of interted tuples with age 18 and record the information in the statistics table.
Every employee works for a company located in the same city as the city in which the employee lives.
The following is a trigger defined for employee, and similar triggers for works and company are also needed. Similar one is also needed for manager when the supervision relation changes. The execution of such a triggered action resulting from the insertion, deletion, or updating of a row in a table may cause the triggering of further triggered actions in other affected tables.