How to use the SQL Joins Visualizer
- 1. Edit the tablesChange the sample employees and departments, or paste your own small CSV tables.
- 2. Pick a joinChoose the join type and the key columns on each side.
- 3. Run itSee every result row, with NULL where a side has no match.
Worked example with the sample tables
The left table has 4 employees: Asha (dept 10), Rahul (20), Meera (10) and Karan (40). The right table has 3 departments: 10 Engineering, 20 Sales and 30 Marketing. Notice that Karan's department 40 does not exist, and nobody works in Marketing. Joining on dept_id gives:
- INNER JOIN: 3 rows, only the matches (Asha, Rahul, Meera).
- LEFT JOIN: 4 rows, all employees; Karan gets NULL department columns.
- RIGHT JOIN: 4 rows, all departments; Marketing gets NULL employee columns.
- FULL OUTER JOIN: 5 rows, everything from both sides.
- CROSS JOIN: 4 × 3 = 12 rows, every pair, with no condition.
- Left anti-join: 1 row, Karan, the employee without a valid department.
Run each one in the tool and the row counts match this list.
Mistakes the visualizer helps you avoid
- Duplicate rows: if the right table has two rows with the same key, every matching left row appears twice. Add a duplicate department 10 and watch the INNER result grow.
- Filtering away a LEFT JOIN: putting a condition on the right table in WHERE, such as
WHERE d.city = 'Noida', removes the NULL rows and turns your LEFT JOIN into an INNER JOIN. Put that condition in the ON clause instead. - NULL keys: NULL never equals anything, not even another NULL, so blank keys never match. This tool treats blank cells the same way.
MySQL has no FULL OUTER JOIN keyword. Write a LEFT JOIN, then UNION, then a RIGHT JOIN to get the same result. When you are ready, run real queries on a sample database in the SQL online compiler.
Frequently asked questions
What is the difference between LEFT JOIN and LEFT OUTER JOIN?
None. OUTER is optional in SQL, so LEFT JOIN and LEFT OUTER JOIN mean the same thing.
Is a CROSS JOIN ever useful?
Yes, for making every combination, such as all sizes for all colours of a product, or a calendar of dates for every store.
Why does my RIGHT JOIN look like a LEFT JOIN flipped?
It is. A RIGHT JOIN B gives the same rows as B LEFT JOIN A, which is why many teams use only LEFT JOIN.
Is the visualizer free?
Yes. Edit the tables as much as you like. The first time you press Run join we ask for your name and WhatsApp number, once for all Uncodemy tools.