Natural join (source code)

= Natural join

A <natural join> combines two <database relations> by equating every identically named attribute and retaining one copy of each common attribute. If `people(id,name)` contains `(7,Ada)` and `scores(id,mark)` contains `(7,90)`, their <natural join> contains `(7,Ada,90)`. With no common names it becomes a <Cartesian product>. Matching several common columns requires all their equalities, so adding a same-named column can silently change the result. An explicit join condition is often clearer when schemas evolve. In <SQL>, duplicates and null values follow the implementation's join semantics.https://www.postgresql.org/docs/current/queries-table-expressions.html[§7.2.1.1, joined tables and NATURAL JOIN]{ref}