A delete action starts from visible parent and child rows.

highlighted = computed this step

Parent and child rows before delete

Start with parent rows and child rows before any delete action runs.

rows first\text{rows first}

Show both tables

The parent table has 4 rows, and the child table has 4 rows.

child rows=4\text{child rows}=4

Foreign-key delete-action examples are tiny finite table checks; SET NULL, deferrable checks, triggers, transactions, locks, timing, indexing, performance, general referential-action completeness, and product behavior are out of scope.

Parent and child rows before delete: parent rowscustomer_idname1Ada2Ben3Cy4Dee Parent and child rows before delete: child rowsorder_idcustomer_idtotal101150102230103170104NULL5 Child-to-parent referenceschildRowchildValueparentRowstatus010matches_parent121matches_parent210matches_parent3NULLnoneNULL_no_reference Delete resultfieldvalueactionrestrictparentValue4parentRow3statusdeletedchildRowsAffected() Parent after deletecustomer_idname1Ada2Ben3Cy Child after deleteorder_idcustomer_idtotal101150102230103170104NULL5 FK delete factsfactvalueparentRowCount4childRowCount4referenceCount4nullChildKeyCount1affectedChildCount0deleteStatusdeletedparentAfterCount3childAfterCount4supportedActionsrestrict,cascade

Keep the key columns visible

The child customer_id column is the foreign-key value checked against parent customer_id.

child value points to parent\text{child value points to parent}

Summary

The delete result is recomputed from these exact rows.

finite rows only\text{finite rows only}