SQL Triggers
Trigger is a statement that a system executes automatically when there is any modification to the database. In a trigger, we first specify when the trigger is to be executed and then the action to be performed when the trigger executes. Triggers are used to specify certain integrity constraints and referential constraints that cannot be specified using the constraint mechanism of SQL. Types of Triggers – We can define 6 types of triggers for each table: AFTER INSERT activated after data is inserted into the table. AFTER UPDATE: activated after data in the table is modified. AFTER DELETE: activated after data is deleted/removed from the table. BEFORE INSERT: activated before data is inserted into the table. BEFORE UPDATE: activated before data in the table is modified. BEFORE DELETE: activated before data is deleted/removed from the table. AFTER INSERT In Mi...