NATURAL JOIN
A join that silently pairs rows on every column the two tables share by name.
In more detail
It is a trap: adding an unrelated column with the same name to either table, such as created_at, changes the join without any error. Name the rule explicitly with ON instead.
Related terms
- USING clause — A join shorthand that pairs rows on columns with the same name in both tables, such as USING (category_id).
- ON clause — The part of a join that states which rows of the two tables belong together.
- join — Combining rows from two tables into one result by pairing rows according to a rule, usually matching keys.
Taught in
- Inner Joins And Table Aliases — PostgreSQL, Indexing & Relational Data Modeling