Bird
0
0

What is the main purpose of a DELETE trigger in a database?

easy📝 Conceptual Q11 of 15
SQL - Triggers
What is the main purpose of a DELETE trigger in a database?
ATo insert new rows into a table
BTo update rows before they are deleted
CTo automatically run code when rows are deleted from a table
DTo prevent any data from being deleted
Step-by-Step Solution
Solution:
  1. Step 1: Understand what triggers do

    Triggers run automatically in response to certain database events like insert, update, or delete.
  2. Step 2: Focus on DELETE triggers

    A DELETE trigger specifically runs when rows are deleted, allowing automatic actions during that event.
  3. Final Answer:

    To automatically run code when rows are deleted from a table -> Option C
  4. Quick Check:

    DELETE trigger = runs on row deletion [OK]
Quick Trick: DELETE triggers run code automatically on row deletions [OK]
Common Mistakes:
  • Confusing DELETE triggers with INSERT triggers
  • Thinking DELETE triggers prevent deletion by default
  • Assuming DELETE triggers update rows instead

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes