SQL Joins Visualizer

Interactive Venn diagram to understand SQL joins. Click the diagram segments or use the presets to generate SQL.

Select a Join Type
generated_query.sql
INNER JOIN
1SELECT * FROM TableA A
2INNER JOIN TableB B
3ON A.id = B.a_id

Returns records that have matching values in both tables.

Table ATable BA & B

Click segments to quickly select Excluding or Inner joins

Visual Guide to SQL Joins

SQL Joins are fundamental to working with relational databases. They allow you to combine rows from two or more tables based on a related column between them.

This SQL Joins Visualizer uses a Venn diagram to simplify these concepts. By identifying the overlapping and non-overlapping areas of two sets (tables), you can intuitively understand what data each join type returns.

Key Concepts

  • Inner Join: The most common type. Only returns rows when there is a match in both tables.
  • Left Join: Returns all rows from the left table, and the matched rows from the right table.
  • Full Join: Returns all rows when there is a match in either one of the tables.