Bird
0
0

If two AFTER DELETE triggers exist on table products, and the second trigger is defined with FOLLOWS first_trigger, what is the execution order?

medium📝 query result Q5 of 15
PostgreSQL - Triggers in PostgreSQL
If two AFTER DELETE triggers exist on table products, and the second trigger is defined with FOLLOWS first_trigger, what is the execution order?
ABoth triggers run simultaneously.
Bsecond_trigger runs before first_trigger.
Cfirst_trigger runs before second_trigger.
DExecution order is undefined.
Step-by-Step Solution
Solution:
  1. Step 1: Understand FOLLOWS clause meaning

    FOLLOWS means the trigger runs after the named trigger.
  2. Step 2: Apply to given triggers

    second_trigger FOLLOWS first_trigger means first_trigger runs first, then second_trigger.
  3. Final Answer:

    first_trigger runs before second_trigger. -> Option C
  4. Quick Check:

    FOLLOWS sets execution order = first_trigger runs before second_trigger. [OK]
Quick Trick: FOLLOWS means run after the named trigger [OK]
Common Mistakes:
  • Reversing the order of triggers
  • Thinking triggers run simultaneously
  • Assuming undefined order despite FOLLOWS

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes