Every common-column comparison must pass.

highlighted = computed this step

Compare all common columns

When two names are shared, both comparisons must pass.

all common columns\text{all common columns}

Read candidate checks

This example has 2 common columns and 3 matched rows.

matches=3\text{matches}=3

NATURAL JOIN examples are tiny finite-table transforms; SQL dialect completeness, type coercion, optimizer behavior, execution cost, indexing, output ordering guarantees, and database-product claims are out of scope.

Compare all common columns: left tableorder_idcustomer_idstatus110open220open320closed Compare all common columns: right tablecustomer_idstatusname10openAda20closedBen20openBenny automatic common-column discoverycommonColumnleftIndexrightIndexcustomer_id10status21 candidate row comparisonsleftSourcerightSourcechecksmatched00[customer_id: 10 = 10 -> yes, status: open = open -> yes]yes01[customer_id: 10 = 20 -> no, status: open = closed -> no]no02[customer_id: 10 = 20 -> no, status: open = open -> yes]no10[customer_id: 20 = 10 -> no, status: open = open -> yes]no11[customer_id: 20 = 20 -> yes, status: open = closed -> no]no12[customer_id: 20 = 20 -> yes, status: open = open -> yes]yes20[customer_id: 20 = 10 -> no, status: closed = open -> no]no21[customer_id: 20 = 20 -> yes, status: closed = closed -> yes]yes22[customer_id: 20 = 20 -> yes, status: closed = open -> no]no NATURAL JOIN output rowscustomer_idstatusleft.order_idright.name10open1Ada20open2Benny20closed3Ben NATURAL JOIN factsfactvalueleftRowCount3rightRowCount3commonColumns[customer_id, status]commonColumnCount2candidatePairCount9matchingPairCount3matchedLeftRows3duplicateMatchRows0nullCommonCandidatePairs0fallbackModeall_common_columnsfirstCommonColumnOnlyMatchCount5narrowedByExtraCommonColumns2outputColumnCount4rowOrderleft_source_then_right_source

One failed check drops the pair

A row pair needs every common-column check to say yes.

AND over common columns\text{AND over common columns}

Summary

NATURAL JOIN can be stricter than a one-key join when more names overlap.

extra names matter\text{extra names matter}