Suggest an editImprove this articleRefine the answer for “What does a row-level trigger do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **row-level trigger** is a trigger that **fires for every row** affected by an `INSERT`, `UPDATE`, or `DELETE` operation: if a query changes 5 rows, the trigger runs **5 times**, once per row. **Key point:** inside such a trigger you have access to pseudo-records `NEW` (the new data) and `OLD` (the old data); for example, a `BEFORE INSERT` trigger can check each row being inserted and block adding a user under 18.Shown above the full answer for quick recall.Answer (EN)ImageA **row-level trigger** is a trigger that **fires for every row** affected by an `INSERT`, `UPDATE`, or `DELETE` operation. So if a query changes 5 rows, the trigger runs **5 times**, once per row. Inside such a trigger, special pseudo-records are available: - `NEW`, the new data (after the change or insert), - `OLD`, the old data (before the change or delete). ### Example ```sql CREATE TRIGGER check_age BEFORE INSERT ON users FOR EACH ROW BEGIN IF NEW.age < 18 THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Age must be 18+'; END IF; END; ``` Here the trigger checks **every row being inserted** and blocks adding a user under 18.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.