I have book
and store_order
tables.
I want to make trigger(but it contain error):
DELIMITER $$
CREATE TRIGGER t1
BEFORE DELETE ON store_order
FOR EACH ROW
BEGIN
UPDATE book SET number = number + NEW.quantity WHERE ISBN = NEW.ISBN;
END
$$
DELIMITER ;
DELIMITER $$
CREATE
TRIGGER t2 AFTER delete
ON library.store_order
FOR EACH ROW BEGIN
update library.book
set library.book.number = (library.book.number + OLD.quantity)
where library.book.ISBN = OLD.ISBN;
END$$
DELIMITER ;