Delete rules can block or remove child rows in this tiny model.

highlighted = computed this step

Restrict versus cascade

Deleting a parent row can be blocked, or it can remove matching child rows in this tiny model.

delete rule is explicit\text{delete rule is explicit}

Show both outcomes

Restrict is blocked. Cascade is deleted and affects 2 child rows.

cascade child rows=2\text{cascade child rows}=2

Key examples are tiny finite table checks; SQL dialects, indexing, query planning, deferrable constraints, enforcement timing, performance, and product behavior are out of scope.

Restrict delete: parent tablecustomer_idname1Ada2Ben3Cy Restrict delete: child tableorder_idcustomer_idtotal101150102230103170 key columnsparent keychild foreign keycustomer_idcustomer_id child-to-parent linkschildRowchildValueparentRowsstatus01[0]match12[1]match21[0]match duplicate parent keysvalueparentRowsnonenone dangling referenceschildRowvaluestatusnonenonenone delete resultmodeparentValuestatuschildRowsAffectedrestrict1blocked[0, 2] parent after deletecustomer_idname1Ada2Ben3Cy child after deleteorder_idcustomer_idtotal101150102230103170 key factsfactvalueparentRowCount3childRowCount3duplicateParentKeyCount0referenceCount3danglingReferenceCount0parentKeyUniqueyesvalidyesdeleteStatusblocked
Cascade delete: parent tablecustomer_idname1Ada2Ben3Cy Cascade delete: child tableorder_idcustomer_idtotal101150102230103170 key columnsparent keychild foreign keycustomer_idcustomer_id child-to-parent linkschildRowchildValueparentRowsstatus01[0]match12[1]match21[0]match duplicate parent keysvalueparentRowsnonenone dangling referenceschildRowvaluestatusnonenonenone delete resultmodeparentValuestatuschildRowsAffectedcascade1deleted[0, 2] parent after deletecustomer_idname2Ben3Cy child after deleteorder_idcustomer_idtotal102230 key factsfactvalueparentRowCount3childRowCount3duplicateParentKeyCount0referenceCount3danglingReferenceCount0parentKeyUniqueyesvalidyesdeleteStatusdeleted

Read after tables

The after-delete tables show exactly what stayed or disappeared.

after tables visible\text{after tables visible}

Summary

Only restrict and cascade are modeled; timing and product-specific behavior stay out of scope.

scoped delete rules\text{scoped delete rules}