Suggest an editImprove this articleRefine the answer for “What types of triggers exist?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Trigger types in SQL are split by **when they fire** and by **the type of event** they react to: by timing - `BEFORE` (before the event), `AFTER` (after the event), and (in some DBMSes) `INSTEAD OF` (in place of the operation); by event type - `INSERT`, `UPDATE`, and `DELETE` triggers. **Key point:** a trigger is described by a combination of both traits, e.g. `BEFORE INSERT`, `AFTER UPDATE`, or `INSTEAD OF DELETE` - each type lets the database automatically control or supplement data operations at the right moment.Shown above the full answer for quick recall.Answer (EN)ImageTrigger types in SQL are split by **when they fire** and by **the type of event** they react to. ### 1. By timing 1. **BEFORE**, runs **before** an `INSERT`, `UPDATE`, or `DELETE` operation changes the data. Used to check or modify values *before they're saved*. Example: automatically filling in a date if one wasn't given. 2. **AFTER**, fires **after** the data has changed. Often used for **logging** or updating related tables. 3. *(In some DBMSes)* **INSTEAD OF**, runs **in place of** the operation. Used, for example, in views, to define custom behavior when data is changed through a `VIEW`. ### 2. By event type 1. **INSERT trigger**, reacts to new records being added. 2. **UPDATE trigger**, fires when data changes. 3. **DELETE trigger**, runs when records are deleted. So a trigger can be described as a combination of both traits, for example: - `BEFORE INSERT` - `AFTER UPDATE` - `INSTEAD OF DELETE` Each type lets the database **automatically control or supplement** data operations at the right moment.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.