With a foreign key defined as ON DELETE CASCADE, deleting a parent row will:
A
Fail if any child rows still reference it
B
Leave the child rows completely unchanged
C
Set the child foreign keys to NULL values
D
Automatically delete the matching child rows
Correct answer
Correct answer
D. Automatically delete the matching child rows
16 views
⚔️
Challenge a friend on Database Management Systems
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
Explanation
ON DELETE CASCADE removes dependent rows, for example deleting a customer deletes their orders. RESTRICT blocks the delete, and SET NULL clears the reference.
Reference
Asked in: GATE CS, NTS, PPSC
Doubts & discussionNot sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ Which SQL statement undoes changes made in the current transaction that have not yet been committed? Next MCQ › Which relational algebra operation selects specific columns from a relation?