A foreign key stores the parent key value on each child row.

highlighted = computed this step

Foreign keys are row links

Each child row stores a value that should match one parent key value.

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

Show the links

The compiler checks 3 child-to-parent links, and the valid flag is yes.

references=3\text{references}=3

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

Foreign keys are row links: parent tablecustomer_idname1Ada2Ben3Cy Foreign keys are row links: 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 key factsfactvalueparentRowCount3childRowCount3duplicateParentKeyCount0referenceCount3danglingReferenceCount0parentKeyUniqueyesvalidyesdeleteStatusnone

Read child-to-parent links

The link table shows each child row, its key value, and the matching parent row.

matched rows are visible\text{matched rows are visible}

Summary

The diagram is a finite reference check, not an index lookup or query plan.

reference check only\text{reference check only}