Bird
0
0

A trigger is set to update a timestamp column on every row update. What will be the result after updating a row?

medium📝 query result Q5 of 15
PostgreSQL - Triggers in PostgreSQL
A trigger is set to update a timestamp column on every row update. What will be the result after updating a row?
AThe timestamp column remains unchanged
BThe timestamp column will update automatically to current time
CThe update will fail due to trigger conflict
DThe entire row will be deleted
Step-by-Step Solution
Solution:
  1. Step 1: Understand trigger purpose for timestamp update

    Triggers can automatically modify columns like timestamps when a row is updated.
  2. Step 2: Evaluate options

    The timestamp column will update automatically to current time correctly describes the expected behavior. Options A, B, and D describe incorrect or harmful outcomes.
  3. Final Answer:

    The timestamp column will update automatically to current time -> Option B
  4. Quick Check:

    Update trigger = Auto timestamp update [OK]
Quick Trick: Update triggers can auto-change columns like timestamps [OK]
Common Mistakes:
  • Expecting update failure due to triggers
  • Thinking triggers do not change data
  • Assuming triggers delete rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes