Databases · Junior · Question 68 of 75

What does ON DELETE CASCADE on a foreign key do?

Explanation

For example, deleting a user deletes their sessions. The default (NO ACTION) blocks the delete while references exist; SET NULL clears the reference.

Further reading

Problem with a question

Databases · Junior · question 68

Test yourself

Take the Databases · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz