Suggest an editImprove this articleRefine the answer for “Why do we need triggers?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Triggers exist to **automatically run actions** when data in a table **changes**: they preserve data integrity (e.g. automatically deleting related records when a user is deleted), log changes, enforce business-logic rules, and run automatic computations. **Key point:** in short, triggers are **the database's reactions to events**, helping automate work and protect data from user error.Shown above the full answer for quick recall.Answer (EN)ImageTriggers exist to **automatically run actions** when data in a table **changes**. ### The main goals 1. **Maintaining data integrity.** For example, automatically deleting related records when a user is deleted. 2. **Logging changes.** Recording who updated or deleted data and when. 3. **Enforcing rules.** You can block unwanted changes if they'd violate business logic. 4. **Automatic computations.** For example, updating running totals or statistics when new data is inserted. In short, triggers are **the database's reactions to events**, helping automate work and protect data from user error.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.