In DBMS, which referential integrity action of a foreign key constraint…
2024
In DBMS, which referential integrity action of a foreign key constraint automatically deletes related child records when the corresponding parent record is deleted?
- A.
Restrict
- B.
Commit
- C.
Rollback
- D.
Cascade
- E.
Savepoint
Attempted by 76 students.
Show answer & explanation
Correct answer: D
Correct answer: Cascade.
In a relational DBMS, a FOREIGN KEY constraint can specify a referential action that defines what happens to the dependent (child) rows when the referenced (parent) row is deleted or updated. The ON DELETE CASCADE action automatically removes all matching child rows whenever the corresponding parent row is deleted, keeping referential integrity intact without leaving orphan rows.
Example: CREATE TABLE orders ( ... customer_id INT REFERENCES customers(id) ON DELETE CASCADE ); — deleting a customer then also deletes that customer's orders automatically.
The other choices are not the deletion-propagating referential action: Restrict is a referential action, but it BLOCKS the parent deletion when child rows exist (it does not delete them); Commit, Rollback and Savepoint are transaction-control (TCL) concepts, not foreign-key referential actions at all.