1) Inserting Row
CREATE TRIGGER ins_sum BEFORE INSERT ON reservation -> FOR EACH ROW SET @Totalpersons = @totalperson + NEW.numperson;
Output -> Number of total person value for appropriate-trip tabele is increase.
2) Updating Row
CREATE TRIGGER ins_sub AFTER UPDATE ON reservation -> FOR EACH ROW SET @Totalpersons = NEW.numperson - OLD.numperson;
Output -> Number if total person will be update through new value
3) Deleting Row
CREATE TRIGGER ins_sub AFTER UPDATE ON reservation -> FOR EACH ROW SET @Totalpersons = NEW.numperson - Totalpersons;
Output -> Number of total person value reduce for appropriate-trip tabele.
Get Answers For Free
Most questions answered within 1 hours.