Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
When a child is existence-dependent on a parent, we must decide what happens if the parent’s key changes or the parent row is deleted. The two safe strategies are to cascade the change to keep children valid or to prohibit the parent action to protect referential integrity.
Given Data / Assumptions:
Concept / Approach:
If the child requires a parent, then after any parent key update or delete, children must remain valid. Two broad patterns satisfy this: (1) CASCADE the update/delete so children follow the parent’s change, or (2) RESTRICT/NO ACTION to prevent the parent change if children exist. SET NULL or SET DEFAULT would violate the child’s mandatory dependency unless the foreign key were nullable or a default valid parent existed—conditions that contradict “parent required.” Hence, “cascade or prohibit” is the correct design guideline.
Step-by-Step Solution:
Verification / Alternative check:
Attempt parent delete with children present under RESTRICT → blocked; under CASCADE → children removed automatically. Either preserves integrity according to policy.
Why Other Options Are Wrong:
Common Pitfalls:
Allowing SET NULL with a NOT NULL child foreign key; silently creating orphans by manual deletes without constraints; misunderstanding NO ACTION vs RESTRICT timing differences.
Final Answer:
Correct
Discussion & Comments