A Visual Explanation of SQL Joins


Where ‘possible table contents’ is the cross product given A and B.

Cross product gives us everything outside the diagram as well as what is inside. …Within the scope of possible results that is. This is all in a bigger circle. As far as I can see, the model holds. And if it doesn’t? Then we just need another circle to contain the instances where it fails. :wink:

@codinghorror your work has been replicated in es6 :slightly_smiling_face:

BTW, I can’t count the number of times I’ve referred back to this page over the years. Thanks.


Good post, very clear!
Note: the image for inner join is returning 404.

It’s a Ghost Pro hosting issue… their CDN isn’t returning the image. I’ve written them about it.

1 Like

Great way of explaining MySQL joins. I found another image that explain all the MySQL join types in a single image.