I am reading about NATURAL shorthand form for SQL joins and I see some traps:
- it just takes automatically all same named column-pairs (use USING to specify explicit column list)
- if some new column is added, then join output can be “unexpectedly” changed too, which may be not so obvious (even if you know how NATURAL works) in complicated structures
NATURAL JOINsyntax is anti-pattern:Because of this, I don’t recommend the syntax in any environment.
I also don’t recommend mixing syntax (IE: using both
NATURAL JOINand explicit INNER/OUTER JOIN syntax) – keep a consistent codebase format.