Categories: MySQL

MySQL Trigger

Share

MySQL triggers are nothing but a SQL statement stored in the database. When any event associate with a table is fired i.e. insert, update or delete a trigger is executed.

TRUNCATE statement delete the all data in a table but does not execute the triggers associated with this.

The different between trigger and stored procedure is trigger is called automatically when a event is fired but stored procedure must be called explicitly.

You can to define maximum six triggers for each table.

– BEFORE INSERT
– AFTER INSERT
– BEFORE UPDATE
– AFTER UPDATE
– BEFORE DELETE
– AFTER DELETE

MySQL triggers stored with the file name tbl_name.TRG (maps the triggers to table) and tbl_name.TRN (trigger definition).

Recent Posts

Guest Topic Name : Top 5 Must-Have Features Every Mobile App Needs to Succeed

Introduction Businesses understand the diverse requirements of mobile applications, which provide a competitive advantage. There…

3 hours ago

IoT Data Analytics: Ways to Gain Value from IoT Data

The Internet of Things (IoT) has recently changed the world. It links gadgets together and…

3 hours ago

The Rise of NFTs: Exploring the Impact of Non-Fungible Tokens on the Digital Economy

NFTs, or Non-Fungible Tokens, are revolutionizing the digital economy. These unique digital assets, authenticated through…

20 hours ago

Unveiling the Truth: Is the Spread of Sinus Infections a Myth or Reality?

Sinus infections, impacting approximately 31 million Americans each year, represent a significant health concern stemming…

2 days ago

Best Exercises To Reduce Weight & Keep You Stronger & Fitter!

No doubt that balanced weight is the key to wellness. So, when it comes to…

2 days ago

ARTIFICIAL INTELLIGENCE: Advantages And Disadvantages? Everything You Need to Know

Pros And Cons Of AI: Artificial Intelligence directly translates to conceptualizing and building machines that…

2 days ago