- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is MySQL event and how it is related to trigger?
A MySQL event is a task that rums based on a predefined schedule therefore sometimes it is referred to as a scheduled event. In other words, we can say that the MySQL event schedule is a process that runs in the background and constantly looks for the events to execute. It is referred to as a temporal trigger because they triggered by time and not like triggers that execute based on the table update. We can use events to run either once or at a recurring interval. They can be used to create backups, delete stale records, aggregate data for reports, and so on. Its syntax would be as follows −
Syntax
CREATE EVENT event_name ON SCHEDULE schedule DO Event_body
Here,
- event_name is the name of the event that we must have to specify after CREATE EVENT statement. It must be unique in a database.
- The schedule is the time that we need to specify so that the event can occur at that particular time or schedule. The event can be a one-time event or recurring event.
- Event_body is the set of SQL statements that we need to specify after the DO keyword. It can be wrapped in BEGIN…END block if there are multiple statements.
- Related Articles
- What is MySQL trigger and triggering events related to it?
- What is ECMAScript and how it is related to JavaScript?
- What is ionic and how is it related with HTML5?
- What is Profit Planning and how is it related to Finance Function?
- How is it possible for a MySQL trigger to execute multiple statements?
- How to trigger event in JavaScript?
- What is anode and cathode? Elaborate terms related to it.
- How can we create multiple MySQL triggers for the same trigger event and action time?
- Is it good to dream? How is your success related to your dreams?
- How can I trigger a JavaScript click event?
- How can we get the count of all MySQL event-related operations collectively?
- How to trigger a hover event from another element using jQuery?
- How to ceate MySQL Trigger before Insert?
- How can I trigger an onchange event manually in javascript?
- How is pressure related to force?

Advertisements