CASCADE removes matching child rows with the parent.

highlighted = computed this step

CASCADE removes child rows

CASCADE deletes the parent and the child rows that reference it.

cascade removes references\text{cascade removes references}

Cascade Ada

The delete is deleted, affects 2 child rows, and leaves 2 child rows.

child after=2\text{child after}=2

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.

CASCADE removes child rows: parent rowscustomer_idname1Ada2Ben3Cy4Dee CASCADE removes child rows: child rowsorder_idcustomer_idtotal101150102230103170104NULL5 Child-to-parent referenceschildRowchildValueparentRowstatus010matches_parent121matches_parent210matches_parent3NULLnoneNULL_no_reference Delete resultfieldvalueactioncascadeparentValue1parentRow0statusdeletedchildRowsAffected(0, 2) Parent after deletecustomer_idname2Ben3Cy4Dee Child after deleteorder_idcustomer_idtotal102230104NULL5 FK delete factsfactvalueparentRowCount4childRowCount4referenceCount4nullChildKeyCount1affectedChildCount2deleteStatusdeletedparentAfterCount3childAfterCount2supportedActionsrestrict,cascade

Read childRowsAffected

The delete result lists the exact child row indexes removed by cascade.

affected rows listed\text{affected rows listed}

Summary

Only matching child rows are removed.

matching rows only\text{matching rows only}