The INNER keyword appears directly before JOIN to create an INNER JOIN. An INNER JOIN combines rows from two or more tables based on a comparison between specified columns. Only rows that meet the join condition in every referenced table are included in the result set. If no match exists, the row is excluded. Because it filters out non-matching records, INNER JOIN is the most common join type for enforcing relational integrity in reporting and analytics.Key points:- INNER must be paired with JOIN; it cannot stand alone.- If JOIN is written without a preceding keyword, most dialects default to INNER JOIN.- The join condition is supplied after the ON or USING clause.- Multiple INNER JOINs can be chained to combine several tables.- Performance depends on indexed join columns; missing indexes can lead to slow queries.- NULL values only match other NULLs when using the ANSI SQL IS NOT DISTINCT FROM construct. Otherwise, NULL never equals NULL, so those rows are excluded.
JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, CROSS JOIN, USING clause, NATURAL JOIN
SQL-92
Writing JOIN by itself defaults to INNER JOIN, so both produce the same result set.
Rows are returned only when the join condition matches in every table. If no match exists, the row is excluded. Use LEFT JOIN if you need unmatched rows from the left table.
Index the columns used in the join condition, avoid functions on join columns, and limit the result set with selective WHERE clauses.
NULL never equals NULL in ANSI SQL, so rows with NULL in the join columns are filtered out unless you explicitly handle them with IS NOT DISTINCT FROM or COALESCE.