A trigger is a stored database object that contains a series of SQL commands, set to activate automatically when certain events take place.
Each trigger is associated with a table. You can create a trigger that will fire when an INSERT, UPDATE, or DELETE takes place on the named table.
Remember that when you use a REPLACE statement, MySQL actually performs a DELETE followed by an INSERT. Therefore, the REPLACE command will activate a DELETE trigger if the row already exists and will always activate an INSERT trigger.
Triggers are used to perform more database operations when a certain type of database ...