Triggers are often used to do the following:
While Triggers are useful for customizing a database, their excessive use can result in complex interdependencies which may be difficult to maintain in a large application.
Ovrimos Triggers consist of two parts: a triggering statement and an action.
CREATE TRIGGER ORDER_TRIGGER AFTER UPDATE ON ORDERS FOR EACH ROW BEGIN IF NEW.ORDER_ID <> OLD.ORDER_ID THEN UPDATE ORDER_CONS SET ORDER_ID = NEW.ORDER_ID WHERE ORDER_ID = OLD.ORDER_ID; END IF; END