DAS Trainees Blog

Tuesday, June 8, 2010

MySQL Recap- Trigger

What trigger is?

Triggers are small programs that will execute at the time of any event occur. A trigger program contains database events like UPDATE, DELETE or INSERT queries. The trigger itself may execute before or after the query that initiates it.

I'll Explain it in a practical scenario:

Salea record table

records the amount of the sale (sale_amt), the date (date), the name of the salesman (name), his id number (employee_id), and the product id (prod_id). We'll call this table (cleverly enough) “sales”.



When a sale record is inserted in the sales table, the salesperson's totals must be updated in the performance table.

Here is the triggering sql:




Posted by Rahul Ramanathan at 6:23 AM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Followers

Contributors

  • Amila Silva
  • Sacred03
  • Unknown
  • krishan fernando

Blog Archive

  • ▼  2010 (50)
    • ►  August (2)
    • ▼  June (48)
      • Spring Framework AspectJ Annotations For ...
      • Installing MySQL on a Mac
      • Hiding Files In an Image
      • What is WAP?
      • Google Chrome 5 Vs Apple Safari 5
      • Installing RubyGems on a Mac
      • Ruby - OOP
      • How to install a plugin in Joomla 1.5?
      • Learn Ruby - String Manipulation
      • Installing Ruby on a Mac
      • Why I don’t like the new 4G iPhone
      • Spring Framework Context Configuration Annotations
      • How the linux kernal works
      • Start learning Ruby- Installation and Introduction
      • How install Maven plugin to Eclipse
      • Debian Linux Kernel Compilation
      • Power using Skype
      • How to Install Maven in Linux
      • What is HTML 5?
      • How to add Template to the Joomla
      • Why iPhone hates flash?
      • Writing and Compiling C programs on Linux
      • Free and Open Source Online SVN
      • Symfony - What is that?
      • What is an Operating System?
      • Ruby on rails how to send mails using sendmail
      • OTRS
      • Joomla-Site Menu
      • PHP library YAML
      • Installing Tortoise SVN
      • How to create a virtual host apache in linux
      • MySQL Recap- Trigger
      • How to install Zend framework in Linux
      • Joomla with Krishan..
      • CREATING YOUR FIRST PROJECT USING ZEND
      • Top 5 Flex Misconceptions
      • PHP Symfony Framework + MVC Architecture
      • Symfony Installation and Environment setup
      • FREE! Apps I use everyday..
      • Installing and configuring Perl with your Apace Se...
      • GetStart PHP Symfony project with NetBeans IDE
      • Joomla with Krishan..
      • Setting up Zend Tool (php framework)- Linux
      • Joomla with Krishan..
      • JavaFX
      • About Zend Framework
      • How Starting PHP Development with symfony framewor...
      • Excel to SQL: How do I do it?
Simple theme. Powered by Blogger.