Computer Science, asked by Anonymous, 8 months ago

How to create a trigger in My SQL​

Answers

Answered by deepanshig276
2

Answer:

First, specify the name of the trigger that you want to create after the CREATE TRIGGER keywords. Note that the trigger name must be unique within a database.

Next, specify the trigger action time which can be either BEFORE or AFTER which indicates that the trigger is invoked before or after each row is modified.

Then, specify the operation that activates the trigger, which can be INSERT, UPDATE, or DELETE.

After that, specify the name of the table to which the trigger belongs after the ON keyword.

Finally, specify the statement to execute when the trigger activates. If you want to execute multiple statements, you use the BEGIN END compound statement.

Similar questions