What Is Cascade Update and Delete

CASCADE. It is used in conjunction with ON DELETE or ON UPDATE. It means that the child data is either deleted or updated when the parent data is deleted or updated.

What does Cascade Update mean?

gif Selecting Cascade Update lets you update (as in edit) a primary key, even though the key is on the one side of a one-to-many relationship and referential integrity is enforced. The updates you make to the primary key will be reflected in related records, which have matching data in the foreign key.

Does On Update Cascade also delete?

For ON DELETE CASCADE , if a parent with an id is deleted, a record in child with parent_id = parent.id will be automatically deleted. This should be no problem.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest