DELETE FROM dept WHERE dept_id = 901; The above delete statement throws an integrity constraint error because a child record was found. What could we do to make the statement execute?
Answer options
A
Delete the child records first.
B
Use DROP TABLE instead.
C
Use TRUNCATE instead.
D
Add a NOT NULL constraint.
Correct answer: Delete the child records first.
Explanation
An integrity constraint error occurs when a parent record has child records. Delete children first or use ON DELETE CASCADE.