INNER JOIN: Returns only rows that match in BOTH tables. The default — JOIN with no qualifier means INNER JOIN. An INNER JOIN returns only rows that have a match in both tables. SELECT ... FROM users JOIN orders ON orders.user_id = users.id returns users who have orders, combined with those orders. Users without orders are left out.
JOIN without a qualifier means inner join. It is the most common join in everyday queries.
What should you keep in mind with INNER JOIN?
Be aware of what it filters out. If you want to list all customers with their order count, including those with zero orders, an inner join silently drops the zeros. Use a LEFT JOIN for that. Also check the join condition carefully. A missing or wrong ON clause can multiply rows and inflate totals without any error message, which is a classic source of wrong numbers in reports.
What does an example of INNER JOIN look like?
SELECT u.name, o.total FROM users u JOIN orders o ON o.user_id = u.id;