SQL JOIN is a relational operation that horizontally combines result sets. It evaluates each row in one table against rows in another (or several others) and returns a single row set that contains columns from all participating tables when the join condition evaluates to TRUE. The ANSI-standard defines several join types: • INNER JOIN – returns only matching rows. • LEFT (OUTER) JOIN – returns all rows from the left table plus matching rows from the right. Non-matches in the right table appear as NULLs. • RIGHT (OUTER) JOIN – mirror of LEFT JOIN. • FULL (OUTER) JOIN – returns matches plus non-matches from both sides, filling NULLs where data is missing. • CROSS JOIN – Cartesian product of the two tables (every row with every row). • SELF JOIN – joins a table to itself (usually with aliases). • NATURAL JOIN – automatically matches columns with identical names (not recommended for production because schema changes can break queries). Join processing order, indexes, data volume and predicate selectivity strongly influence performance. Always use explicit JOIN ... ON syntax (introduced in SQL-92) rather than listing tables in FROM and moving predicates to WHERE; it is clearer and avoids accidental CROSS joins. Watch out for duplicate rows caused by one-to-many relationships, and remember that OUTER joins preserve NULLs, so downstream filters in WHERE clauses can unintentionally turn them into INNER joins.
INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN, ON clause, USING clause, subqueries, UNION, set operations
SQL-92
Typically INNER JOIN is fastest because it eliminates non-matching rows early. However, with correct indexes, LEFT and RIGHT joins can be nearly as fast.
Yes. Chain multiple JOIN clauses: SELECT ... FROM a JOIN b ON ... JOIN c ON ...; Each additional join combines the current result set with another table.
Filtering columns from the right table in the WHERE clause removes NULL rows, turning the logic into an INNER JOIN. Move such filters into the JOIN ... ON condition instead.
Use CROSS JOIN only when you intentionally need every combination of rows, such as generating test data or building a date dimension table.