This article will explain how to create Trigger in mysql. A mysql trigger is a procedural code which is automatically executed after response to certain events on a particular table or view in a database. I am taking a real time example here, when a new entry ( New Employee Joining) inserted in to employee table, then it should be also inserted in to salaries table.

There are three types of triggers supported by Mysql 5.0.2 versions. These are written bellow :

1) Mysql Insert Trigger
2) Mysql Update Trigger
3) Mysql Delete Trigger

Mysql Insert Trigger

Bellow is the syntax example to write Mysql insert trigger.

This is a sample mysql insert trigger example.

Mysql Update Trigger

Bellow is the syntax example to write Mysql Update trigger.

Mysql Delete Trigger

Bellow is the syntax example to write Mysql Delete trigger.