TechnSols
Advertisement

SQL Join Visualizer

Learn SQL joins free online with SQL Join Visualizer. INNER, LEFT, RIGHT and FULL joins on real rows with Venn diagrams, no install or sign-up needed.

Be the first to rate this tool
Left table Right table Matched

Pick a join type to see the rows it returns.

What Is SQL Join Visualizer?

SQL Join Visualizer is a free online tool that shows how SQL joins work by running each join on real example rows and shading the matching part of a Venn diagram. Pick INNER, LEFT, RIGHT or FULL, and the tool shows the exact rows that join returns, the SQL text of that join, and the row count for every join type on the same data. SQL Join Visualizer is a free online tool by TechnSols, with no install and no sign up.

Advertisement

A join combines rows from two tables by matching a key in one table against a key in the other. The four join types differ only in what they do with rows that have no match, and that small difference changes the answer completely. An INNER JOIN keeps only matched pairs. A LEFT JOIN keeps every row of the left table and fills the missing right side with No match. A RIGHT JOIN does the mirror image. A FULL JOIN keeps every row of both tables.

The tool ships with two fixed datasets. The first joins customers with orders: five customers and six orders, where one customer has no order at all. The second joins employees with departments: four employees and three departments, where one employee has a key that matches nothing, one employee has no key, and one department has no employee. Every join type is computed live from those rows, so the result table, the diagram and the counts always agree.

Nothing is uploaded and nothing is stored. The datasets are fixed, the join runs in the visitor browser, and the result is drawn on the page. There is no file to choose and no database to open, so the tool works at once.

How To Use SQL Join Visualizer?

Using SQL Join Visualizer takes less than a minute. Pick a dataset, pick a join type, and read the result. The diagram shades the part of the Venn diagram that the join keeps, the SQL box shows the query, and the result table shows every row the join returns. If the shape of a database is the question, the Schema Visualizer draws the tables and their links.

Step 1: Pick An Example Dataset

Start with Customers and Orders, which is the dataset the tool opens with: five customers and six orders, joined on the customer id. Ana has two orders, Ben has one, Cara has two, Eli has one, and Dan has none. Switch to Employees and Departments to see a harder case: Mia and Noah have departments, Ola has a key of 99 that matches nothing, Pam has no key, and the Legal department has no employee.

Step 2: Pick A Join Type

Press one of the four join buttons: INNER JOIN, LEFT JOIN, RIGHT JOIN or FULL JOIN. The Venn diagram shades at once: the overlap for INNER, the whole left circle for LEFT, the whole right circle for RIGHT, and both circles for FULL. The row counts line below the tables shows the count for all four joins on the current dataset. The Explain Plan Viewer shows how a database plans a join query once the join itself is clear.

Step 3: Read The Rows And The SQL

The result table lists every row the chosen join returns. Matched rows show values from both tables. Unmatched rows are marked as unmatched, and the missing side shows No match instead of a value. The SQL box shows the exact query that produces those rows, with the join word, the two table names, and the ON condition. Copy that SQL into a real database, changing only the table and column names.

Why Do Joins Confuse Beginners?

Joins confuse beginners because the same two tables can give four different answers, and the difference sits in the rows that do not match. A learner who only reads the definition often guesses which rows survive, and the guess is usually wrong on the unmatched rows. The visualizer shows the rows, the counts and the diagram together, on the same data, so each join can be checked against the others.

The Same Word Means Different Rows

The word join sounds like one action, but it names a family of four. A beginner who writes INNER JOIN when the question needs LEFT JOIN loses every unmatched row without noticing, and the answer looks plausible but is short. A beginner who writes LEFT JOIN when the question needs INNER JOIN keeps extra rows with empty columns. Seeing both results side by side, with counts of 6 rows for INNER and 7 rows for LEFT on the customers dataset, makes the difference concrete. The free lessons on SQLBolt Lessons teach the same four joins with more practice queries.

NULL Rows Vanish Or Appear

A NULL key matches nothing, not even another NULL, and that rule surprises almost everyone. In the employees dataset, Pam has no department key, so she vanishes from an INNER JOIN and a RIGHT JOIN, but she appears in a LEFT JOIN and a FULL JOIN with No match on the department side. Ola has a key of 99 that matches no department, so the same pattern applies to her. The Legal department has no employee, so it appears only in a RIGHT JOIN and a FULL JOIN.

What Can You Do With SQL Join Visualizer?

The visualizer fits learning, teaching and checking. A student can learn the four joins in one sitting. A teacher can show a class why a query returned fewer rows than expected. A developer can check a join before writing it into a report or an app.

Learn Each Join On Real Rows

Work through the four joins on the customers dataset first, where the only mismatch is Dan with no order. INNER JOIN returns 6 rows, one per order. LEFT JOIN returns 7 rows, the same six plus Dan with No match on the order side. RIGHT JOIN returns 6 rows, the same as INNER, because every order has a customer. FULL JOIN returns 7 rows, the same as LEFT. Then switch to the employees dataset, where the counts split further: INNER 2 rows, LEFT 4 rows, RIGHT 3 rows, and FULL 5 rows. The Seed Data Generator builds practice tables for the same joins on a real database.

Check A Join Before Writing It

Before a join goes into a report, check which side can have unmatched rows. If the question needs every customer, even those with no order, the join must be LEFT. If the question needs every order, even one whose customer is missing, the join must be RIGHT. If the question needs everything from both sides, the join must be FULL. The visualizer shows what each choice keeps and what it drops, so the choice is made on rows, not on habit. A saved query can be kept in the Query Library Manager once the join is settled.

Reading The Venn Diagram And The Result

The Venn diagram and the result table show the same answer in two forms. The diagram shows which part of the two circles the join keeps, and the table shows the rows that fall in that part. Reading them together is faster than reading either one alone.

What Each Shaded Part Means

Two circles stand for the two tables. The left circle holds the left table, the right circle holds the right table, and the overlap in the middle holds the matched pairs. INNER JOIN shades only the overlap, because only matched pairs survive. LEFT JOIN shades the whole left circle, because every left row survives. RIGHT JOIN shades the whole right circle. FULL JOIN shades both circles, because every row of both tables survives.

Advertisement

How To Read An Unmatched Row

An unmatched row in the result table shows real values on one side and the words No match on the other side. In a real database, those cells would hold NULL, which means no value rather than zero or an empty string. On the customers dataset, a LEFT JOIN has 1 unmatched row, and on the employees dataset, a FULL JOIN has 3 unmatched rows. The JSON To SQL converter turns sample rows into INSERT statements for a real database.

How SQL Join Visualizer Works

The visualizer is pure JavaScript, with no library and no database engine. The two datasets are fixed arrays in the page. When a join type is picked, the code walks the left rows and the right rows, compares the join keys, and builds the result list. The same walk runs four times to fill the row counts line, once per join type, so the counts and the result always agree. The Venn diagram is an SVG with two circles and three shaded regions, and the code sets the fill opacity of each region for the chosen join.

The join logic follows the standard SQL rules. A key matches only when both keys are present and equal, so a NULL key never matches. An INNER JOIN keeps matched pairs only. A LEFT JOIN keeps every left row, a RIGHT JOIN keeps every right row, and a FULL JOIN keeps every row of both tables. The SELECT Documentation page shows the join clause.

Privacy

There is nothing to upload, because there is no file and no pasted data. The datasets are fixed examples in the page, and the join runs in the visitor browser. No account is needed and no data is stored.

Because the tool holds no visitor data, it is safe to use on a shared computer, in a classroom, or on a phone.

Tips

A few habits make the visualizer more useful. First, learn the joins in order: INNER, then LEFT, then RIGHT, then FULL, on the customers dataset, before moving to the employees dataset. Second, read the row counts line before the result table. Third, look at the unmatched rows first in any result, because they are the rows that prove which join is running. Fourth, copy the SQL from the box and run it on a real database, changing only the names.

When the join is clear, try it on real data. Build a small database from a spreadsheet with the CSV To SQLite converter, or export a table with the SQLite To CSV converter, and run the join there. Past queries can be found again in the Query History Viewer.

More Tools For The Same Job

These tools work on the same kind of job: writing, running and understanding SQL.

FAQ

Common questions about SQL joins and this visualizer are answered below.

Is SQL Join Visualizer By TechnSols Free?

Yes, SQL Join Visualizer is free to use, with no install, no sign up, and no limit on how many joins you try. Both example datasets and all four join types are open to every visitor, including the Venn diagram, the SQL text and the row counts. There is no account to make and no payment step at any point.

What Is The Difference Between LEFT JOIN And RIGHT JOIN?

A LEFT JOIN keeps every row of the left table and fills the missing right side with NULL, while a RIGHT JOIN keeps every row of the right table and fills the missing left side with NULL. On the customers dataset, LEFT JOIN returns 7 rows and RIGHT JOIN returns 6 rows, because Dan has no order.

Why Does FULL JOIN Return More Rows Than INNER JOIN?

A FULL JOIN keeps every row of both tables, while an INNER JOIN keeps only matched pairs, so a FULL JOIN can never return fewer rows than an INNER JOIN on the same data. On the employees dataset, INNER JOIN returns 2 rows and FULL JOIN returns 5 rows: the 2 matched pairs plus 3 unmatched rows.

Can I Use The SQL Shown By SQL Join Visualizer?

Yes, the SQL in the box is a real query that runs on any database with tables and columns of the same names. Copy it, change the names to match your own data, and run it in your database tool. The visualizer itself runs the join in JavaScript on fixed example data.

Does SQL Join Visualizer Work With My Own Data?

No, the visualizer works only with its two fixed example datasets, and it has no file upload or query box. That is by design. To run a join on your own data, open your file in the SQLite Database Browser, or run the join in the SQL Query Playground.

Pick a dataset, press a join type, and read the rows it returns. Try the customers dataset first, then the employees dataset, where the unmatched rows make the differences clear.

Follow TechnSols on Google
Add TechnSols as a preferred source to see more of our tools in Google Search.
Add to Preferred Sources
Advertisement