Bird
0
0

What does the ON UPDATE CASCADE option do in a foreign key constraint?

easy📝 Conceptual Q11 of 15
SQL - Table Constraints
What does the ON UPDATE CASCADE option do in a foreign key constraint?
ADeletes child rows when the parent key changes.
BAutomatically updates child rows when the parent key changes.
CPrevents any update on the parent key if child rows exist.
DSets child foreign key values to NULL when the parent key changes.
Step-by-Step Solution
Solution:
  1. Step 1: Understand ON UPDATE CASCADE behavior

    ON UPDATE CASCADE means if the parent key changes, the child foreign keys update automatically to match.
  2. Step 2: Compare options with definition

    Only Automatically updates child rows when the parent key changes. describes automatic update of child rows on parent key change.
  3. Final Answer:

    Automatically updates child rows when the parent key changes. -> Option B
  4. Quick Check:

    ON UPDATE CASCADE = automatic child update [OK]
Quick Trick: CASCADE means child rows change with parent keys [OK]
Common Mistakes:
MISTAKES
  • Confusing CASCADE with DELETE behavior
  • Thinking CASCADE prevents updates
  • Mixing SET NULL with CASCADE

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes