Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does the ON DELETE CASCADE option on a foreign key do?

  1. A Prevents deletion of the parent row
  2. B Deletes matching child rows when the parent row is deleted
  3. C Sets child rows to NULL
  4. D Logs the deletion without acting
Answer

Deletes matching child rows when the parent row is deleted

CASCADE propagates the delete to dependent rows. Alternatives are RESTRICT, NO ACTION and SET NULL, and the choice should reflect the real business rule.

All MySQL MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as