In SQL, a noun trigger refers to a program code that executes automatically in a database in response to certain events in a particular table. "(Wikipedia) is simpler to say, it is a piece of code that is automatically activated when a particular database event, such as insert or delete, occurs. Triggers can be conveniently used for logging, automatic "cascading" changes to individual tables to other linked tables, or automatic updating of table relationships. When a new integer value is added to the database domain, the code snippet that automatically updates the total number of runs is a trigger. The SQL command block that automatically records changes made to a particular database table is also a trigger instance.
Show triggers
Show triggers;
Delete Trigger
Drop TRIGGER Trigger Name
Grammar
CREATE TRIGGER < trigger name > <--
{before | After}
{INSERT | UPDATE | DELETE}
On < table name >
For each ROW
< trigger SQL statements >
Example
CREATE TRIGGER Trigger_test
After
INSERT
On a
For each ROW
INSERT INTO B set b_name= "Trigger_test_name"
Mysql-trigger-Trigger