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 the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Get Free Access of 450+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Free WordPress Setup Service

Free WordPress Setup

Want to Setup WordPress Blog Setup? I will help you in the setup of your WordPress blog.

Click Here

Pincode Finder

pincode-finder tool

Online Pincode Finder

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

SEARCH NOW