Triggers automate actions based on database events from "summary" of SQL and Relational Theory by C. Date
Triggers are a key feature of SQL - a way to automate actions based on database events. The basic idea is that you can define a trigger on a table, specifying that certain actions should be taken whenever a specified event occurs on that table. For example, you might define a trigger that says, "whenever a row is inserted into this table, also insert a corresponding row into that table over there." Or you might define a trigger that says, "whenever a row is deleted from this table, also delete any corresponding rows from that other table." Triggers can be defined to fire either before or after the event being monitored. For instance, a trigger might fire before a row is updated, giving you the opportunity to modify the new row before it is written to the database. Triggers can be defined to fire for each row that is affected by the event, or just once for the entire event. This gives you a great deal of flexibility in specifying exactly when and how the trigger should behave.- Triggers can be a powerful tool for automating complex behaviors in your database system. However, they can also introduce complexity and potential for unexpected interactions between different parts of your system. It's important to use triggers judiciously and carefully test their behavior to ensure they are doing what you expect.