1/1/1970
Inner Join = Intersection
INNER JOINJOINLeft Outer Join = Inner Join + Left
LEFT OUTER JOINLEFT JOINRight Outer Join = Inner Join + Right
RIGHT OUTER JOINRIGHT JOINOuter Join = Inner Join + Left + Right = Union
FULL OUTER JOINFULL JOINOUTER JOINNATURAL JOIN automatically joins tables based on columns with the same name and compatible data types in both tables.ON tableA.column = tableB.column. i.e. it matches columns with the same name
Natural + Inner Join :NATURAL JOIN.
Natural + Left Jon : NATURAL LEFT JOIN.
Natural + Right Jon : NATURAL RIGHT JOIN. **Natural + Full Outer Join** : NATURAL FULL JOINor NATURAL FULL OUTER JOIN`.
Note:
NATURAL JOIN Not supported by Many browsers such as SQL Server, Oracle, SQLiteNATURAL JOIN can be risky if the table structures change over time. If new columns are added with the same name as existing columns, those columns will automatically be included in the join condition, which may lead to unexpected results. This is why many developers prefer to use explicit join conditions with INNER JOIN, LEFT JOIN, etc., to have full control over which columns are used for joining.-- and # (only for MySQL))/* ... */)In SQL the order of keywords matters
NATURAL LEFT JOIN. ✅LEFT NATURAL JOIN. ❌ Syntax ErrorIn SQL, when checking for a NULL value, you should use the IS NULL or IS NOT NULL operator, not the = operator.
customerId = NULL ❌
customerId IS NULL ✅