A trigger in MySQL is a database object that is associated with a table. A trigger is fired, when a particular event occurs for the table. Triggers are used to perform validation checks on data values for insertion or to perform calculations on values for updation.
They are 2 types of triggers – Before Trigger and After Trigger. Before Trigger fires before the execution of INSERT, DELETE and UPDATE commands. After trigger fires after the execution of INSERT, DELETE and UPDATE commands.