Free, browser-based utilities for everyday developer workflows

Build SQL joins

Pick the tables, the join type, and the keys, and get a correct JOIN with the right ON condition — so you stop guessing whether it should be INNER or LEFT and which columns match.

Open this example in SQL Join Builder

Open the tool, then paste the sample input below. Everything runs locally in your browser.

Open this example in SQL Join Builder →

The problem

Writing a join by hand is where subtle bugs creep in: the wrong join type silently drops rows, or the ON condition matches the wrong columns. Building the join from the table and key names makes the relationship explicit and the SQL correct the first time.

Sample input

Tables and keys
orders(id, customer_id, total)
customers(id, email)
join orders.customer_id = customers.id   (keep all orders)

Expected output

SQL
SELECT o.id, o.total, c.email
FROM orders o
LEFT JOIN customers c ON o.customer_id = c.id;

"Keep all orders" means a LEFT JOIN — orders with no matching customer still appear, with NULL email. An INNER JOIN would drop them.

How to do it

  1. List the tables you want to join.
  2. Choose the join type: INNER, LEFT, or another.
  3. Map the key columns in the ON condition.
  4. Generate the SQL.
  5. Copy it into your query.

Common mistakes

  • Using INNER JOIN when you meant to keep unmatched rows (LEFT JOIN).
  • Joining on the wrong column pair in the ON condition.
  • Forgetting table aliases so column names are ambiguous.
  • Joining without an ON condition and getting a cross product.
  • Mismatched types between the two key columns.

Related tools

Related guides

FAQ

What is the difference between INNER and LEFT JOIN?

An INNER JOIN returns only rows with a match in both tables. A LEFT JOIN returns all rows from the left table, filling unmatched right-side columns with NULL.

How do I keep rows that have no match?

Use a LEFT JOIN from the table whose rows you want to keep. Unmatched rows appear with NULL in the other table's columns.

Why is my join returning too many rows?

Usually a missing or wrong ON condition produces a cross product, or the join key is not unique. Check the ON condition and the key columns.

Do I need table aliases?

Aliases are not required but they make multi-table joins readable and avoid ambiguous column errors when both tables share a column name.

Is my schema uploaded?

No. The join SQL is built locally in your browser. Your table and column names are not sent to a server.

SQL is built locally in your browser. Nothing is uploaded.

Explore more data cleanup and QA tools

Build SQL joins and filters, format queries, compare CSVs and clean data — grouped in one place.

View the data cleanup & QA toolkit →