Both on delete and on update have restrict,no Action, cascade,set null property. Now explain the meaning of their attributes separately.
On DELETE
Restrict (constraint): When the corresponding record is deleted in the parent table (that is, the source table of the foreign key), first check that the record has a corresponding foreign key, and if there is one, it is not allowed to delete.
No action: The meaning is the same as restrict. That is, if there is data from, the deletion of master data is not allowed.
Cascade (cascading): when the corresponding record is deleted in the parent table (that is, the source table of the foreign key), first check that the record has a corresponding foreign key, and if there is one, delete the record in the child table (that is, the table that contains the foreign key).
set NULL: when the corresponding record is deleted in the parent table (that is, the source table of the foreign key), first check that the record has a corresponding foreign key, and if so, set the foreign key value in the child table to null (but this requires that the foreign key is allowed to take null)
On UPDATE
Restrict (constraint): When the corresponding record is updated in the parent table (that is, the source table of the foreign key), first checks whether the record has a corresponding foreign key and, if there is one, does not allow the update.
no action: mean with restrict.
Cascade (cascading): when the corresponding record is updated in the parent table (that is, the source table of the foreign key), first checks whether the record has a corresponding foreign key, and if so, updates the record in the child table (that is, the table that contains the foreign key).
set NULL: when the corresponding record is updated in the parent table (that is, the source table of the foreign key), first check that the record has a corresponding foreign key and, if there is one, set the foreign key value in the child table to null (this requires that the foreign key is allowed to take null).
Note: The difference between NO action and restrict: Only in the case of individual cases, the former is executed after the action of the other constraint, which has the highest priority execution.
MySQL foreign KEY constraints OnDelete and OnUpdate use