Referential integrity behavior:\n“For every relationship, there are six possible referential integrity actions.”\nJudge the accuracy of this claim about ON UPDATE/ON DELETE behaviors.

Difficulty: Easy

Correct Answer: Incorrect

Explanation:


Introduction / Context:
Referential integrity constraints define what happens to child rows when a referenced parent key changes or is deleted. The SQL standard names several actions, and vendors commonly support a similar set. This question asks whether “six possible actions” is an accurate, universal count.



Given Data / Assumptions:

  • Standard actions include: RESTRICT/NO ACTION, CASCADE, SET NULL, SET DEFAULT.
  • Actions can be specified separately for ON DELETE and ON UPDATE.
  • Vendor naming (RESTRICT vs NO ACTION) may differ slightly in timing semantics, but the action set is the same conceptually.


Concept / Approach:
The core action types are four: RESTRICT (or NO ACTION), CASCADE, SET NULL, and SET DEFAULT. Because each foreign key has two events—DELETE and UPDATE—these actions can be applied in combinations (for example, ON DELETE CASCADE and ON UPDATE RESTRICT), but that does not create “new action types.” Counting both events does not change the fact that there are four fundamental actions, not six. Vendors may add nuances (for example, MATCH FULL/PARTIAL for composite keys), but the canonical action set remains four.



Step-by-Step Solution:

List actions: RESTRICT/NO ACTION, CASCADE, SET NULL, SET DEFAULT → four.Note that actions are specified per event (DELETE vs UPDATE).Recognize that combining events does not increase the base number of actions.Therefore, “six possible actions” is inaccurate.


Verification / Alternative check:
Check DBMS manuals (PostgreSQL, SQL Server, Oracle, MySQL/InnoDB): all enumerate these four actions; some omit SET DEFAULT or treat RESTRICT and NO ACTION with slightly different enforcement timing.



Why Other Options Are Wrong:

  • Calling the statement correct miscounts action types.
  • SQL-92 does not expand this to six; nor does index type or deferrability create new action categories.


Common Pitfalls:
Confusing RESTRICT vs NO ACTION timing; assuming vendors with SET DEFAULT missing have a different “count.”



Final Answer:
Incorrect

More Questions from Data Models into Database Designs

Discussion & Comments

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