Programming

What is the difference between INNER JOIN and LEFT JOIN in SQL?

Short answer

INNER JOIN returns only rows that match in both tables, while LEFT JOIN returns all rows from the left table, with NULLs filled in where there’s no matching row in the right table.

Both join two tables based on a related column, but they differ in how they handle rows that don't have a match.

INNER JOIN

Only includes rows where the join condition is satisfied in both tables. If a customer has no orders, an INNER JOIN between customers and orders simply won't include that customer at all.

LEFT JOIN (LEFT OUTER JOIN)

Includes every row from the left (first-listed) table, regardless of whether it has a match in the right table — unmatched columns from the right table appear as NULL. Using the same example, a LEFT JOIN would still show the customer with no orders, with NULL values in the order columns.

Other join types include RIGHT JOIN (the mirror of LEFT JOIN) and FULL OUTER JOIN (includes unmatched rows from both sides).

Last reviewed: September 2026