The difference only shows on rows with no match. INNER drops them; LEFT keeps them and fills the right-hand columns with NULL.
SELECT c.name, o.id
FROM customer c
JOIN orders o ON o.customer_id = c.id; -- customers WITH orders
SELECT c.name, o.id
FROM customer c
LEFT JOIN orders o ON o.customer_id = c.id; -- every customer
INNER: Ann | 1
Ann | 2
LEFT: Ann | 1
Ann | 2
Bob | NULL <- Bob has never ordered
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-25