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:
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:
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:
Common Pitfalls:
Confusing RESTRICT vs NO ACTION timing; assuming vendors with SET DEFAULT missing have a different “count.”
Final Answer:
Incorrect
Discussion & Comments