Bird
0
0

What do the OLD and NEW keywords represent in an UPDATE trigger?

easy📝 Conceptual Q11 of 15
SQL - Triggers
What do the OLD and NEW keywords represent in an UPDATE trigger?
A<code>OLD</code> and <code>NEW</code> both represent the data before update
B<code>OLD</code> is the data after update; <code>NEW</code> is the data before update
C<code>OLD</code> and <code>NEW</code> both represent the data after update
D<code>OLD</code> is the data before update; <code>NEW</code> is the data after update
Step-by-Step Solution
Solution:
  1. Step 1: Understand trigger timing

    In an UPDATE trigger, OLD holds the row data before the update happens.
  2. Step 2: Understand data after update

    NEW holds the row data after the update is applied.
  3. Final Answer:

    OLD is the data before update; NEW is the data after update -> Option D
  4. Quick Check:

    OLD = before, NEW = after [OK]
Quick Trick: OLD = before update, NEW = after update [OK]
Common Mistakes:
  • Confusing OLD and NEW roles
  • Thinking both OLD and NEW hold same data
  • Assuming OLD is after update

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes