In relational databases, if a relationship has a CASCADE UPDATE constraint, then if which key in the parent table is modified, the same change will automatically be made to all corresponding foreign key values in the child table?

Difficulty: Easy

Correct Answer: the primary key

Explanation:


Introduction / Context:
Referential integrity constraints define how changes in one table affect related rows in another. The CASCADE UPDATE rule ensures consistency between parent and child rows when a parent key changes.



Given Data / Assumptions:

  • A parent-child relationship exists between two tables.
  • The child table references the parent's primary key via a foreign key.
  • A CASCADE UPDATE constraint has been set on the relationship.


Concept / Approach:
With CASCADE UPDATE, if the value of the parent's primary key changes, the DBMS automatically updates all foreign keys in child rows that reference it. This preserves referential integrity without manual intervention.



Step-by-Step Solution:

Define CASCADE UPDATE as applied to foreign keys.Identify which parent attribute it applies to: the referenced primary key.Confirm that foreign key values in child rows are updated accordingly.


Verification / Alternative check:
SQL standard and vendor documentation specify that CASCADE actions apply only to referenced primary key values.



Why Other Options Are Wrong:
Alternate key: Not normally referenced in foreign key definitions.
Surrogate key: May be used as a primary key, but the rule applies because it is the primary key, not because it is a surrogate.
Foreign key: Exists in the child table, not the parent.



Common Pitfalls:
Believing cascade applies to any key; it only applies to the referenced key in the parent table.



Final Answer:
the primary key

More Questions from Data Models into Database Designs

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion