Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Triggers in MySQL example

delimiter //
CREATE TRIGGER person_ai AFTER INSERT
ON person
FOR EACH ROW
UPDATE average_age SET average = (SELECT AVG(age) FROM person); //
delimiter ;
Source by phoenixnap.com #
 
PREVIOUS NEXT
Tagged: #Triggers #MySQL
ADD COMMENT
Topic
Name
1+6 =