How To Create MySQL Trigger

| Last Updated: | In: Mysql, Oracle


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.

Tags: , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW