Bird
0
0

Which of the following is the correct syntax to reference the old value of a column named price inside an UPDATE trigger?

easy📝 Syntax Q3 of 15
SQL - Triggers
Which of the following is the correct syntax to reference the old value of a column named price inside an UPDATE trigger?
ANEW.price
BOLD.price
Cprice.OLD
DOLD->price
Step-by-Step Solution
Solution:
  1. Step 1: Recall syntax for OLD keyword usage

    In SQL triggers, the old value of a column is accessed by OLD.column_name.
  2. Step 2: Validate options

    Only OLD.price matches the correct syntax; others are invalid.
  3. Final Answer:

    OLD.price -> Option B
  4. Quick Check:

    OLD.column_name syntax is correct [OK]
Quick Trick: Use OLD.column_name to get old value in UPDATE triggers [OK]
Common Mistakes:
  • Using NEW.price for old value
  • Incorrect syntax like OLD->price
  • Reversing the order as price.OLD

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes