The syntax to create a BEFORE DELETE Trigger in MySQL is:
Parameters or Arguments
The name of the trigger to create.
- BEFORE DELETE
It ndicates that the trigger will fire before the DELETE operation is executed.
The name of the table that the trigger is created on.
Let's look at an example of how to create an BEFORE DELETE trigger using the CREATE TRIGGER statement in MySQL.
If you had a table created as follows:
We could then use the CREATE TRIGGER statement to create an BEFORE DELETE trigger as follows: