Tutorial by Examples

Create Table mysql> CREATE TABLE account (acct_num INT, amount DECIMAL(10,2)); Query OK, 0 rows affected (0.03 sec) Create Trigger mysql> CREATE TRIGGER ins_sum BEFORE INSERT ON account -> FOR EACH ROW SET @sum = @sum + NEW.amount; Query OK, 0 rows affected (0.06 sec) The CRE...
Timing There are two trigger action time modifiers : BEFORE trigger activates before executing the request, AFTER trigger fire after change. Triggering event There are three events that triggers can be attached to: INSERT UPDATE DELETE Before Insert trigger example DELIMITER $$ ...

Page 1 of 1