Utilumo
LightDarkSystem
Explainer1 min readUpdated July 2, 2026

What is a SQL JOIN?

Short answer

A JOIN combines rows from two or more tables using a matching column, such as a shared id. The join type decides which rows are kept: INNER keeps only matches, LEFT keeps all rows from the left table, and so on.

Why joins exist

Relational databases split data across tables to avoid duplication — users in one table, orders in another. A JOIN stitches them back together on a shared key (like user_id) so a single query can return combined rows.

The join types

  • INNER JOIN — only rows with a match in both tables
  • LEFT JOIN — all rows from the left table, plus matches from the right (NULLs where none)
  • RIGHT JOIN — all rows from the right table, plus matches from the left
  • FULL JOIN — all rows from both tables, matched where possible
  • CROSS JOIN — every row of the first table paired with every row of the second
SELECT users.name, orders.total
FROM users
LEFT JOIN orders ON orders.user_id = users.id;
A LEFT JOIN keeps every user, even those with no orders
Try it: SQL Join PlaygroundRun each join type on sample tables and see exactly which rows appear.Open tool
INNER vs LEFT is the key decisionUse INNER when you only want records that exist on both sides. Use LEFT when you want every row from the main table even if it has no match — for example, all users including those who never ordered.

The ON condition

The ON clause defines how rows match. Get it wrong and you either lose rows or multiply them (a partial or missing condition can cause an accidental CROSS JOIN). Test joins on real data before trusting them. See how to write a SQL query.

References

Questions

What is the difference between INNER JOIN and LEFT JOIN?

INNER JOIN returns only rows that have a match in both tables. LEFT JOIN returns all rows from the left table and fills in NULLs where the right table has no match, so no left-side rows are lost.

What is a CROSS JOIN?

A CROSS JOIN pairs every row of one table with every row of another, producing the Cartesian product. It is rarely intended and often happens by accident when a join condition is missing.

Does this send my data anywhere?

No. Utilumo's developer tools parse and transform input inside the browser tab. Nothing is uploaded, stored, or logged.

Keep reading