Say no to Venn diagrams when explaining SQL joins (2016)
This is silly. They&#x27;re a cheatsheet for those who know how SQL joins basically work and what they represent actually makes perfect sense if you don&#x27;t misrepresent what sets the circles refer to.<p>Two tables (A &amp; B) are somehow being joined (in the sql sense, by some query) ON a column from each table expressing the same type of id key.<p>Consider the union of values for those columns in either table. That is the set containing everything in either circle in the Venn diagram.
Then consider the values which appear just in A or just in B -- those, respectively are the non-overlapping sides.
Then consider the intersection (values which appear as values in both A &amp; B), that is the middle part shared by both circles.<p>The highlighting on the Venn diagram shows which sets of values for the key could be made to appear in the resulting join for each type of query (and, yes, by extension indicating whether some other non-null data could also be coming from a given table in the cases where the given value is present for the table with the ON&#x27;ed column in question)<p>That&#x27;s perfectly valid for a Venn diagram. The representation is meaningful and concise.<p>If you don&#x27;t understand the fundamental nature of what is happening in a SQL JOIN I can see why you may need a more detailed&#x2F;verbose diagram for each type of join, but the diagrams don&#x27;t purport to be about the sets of rows from a table in the result and anyone who grasps the basic principle behind the joins won&#x27;t struggle with the Venn diagrams because they strike the nail on the head with respect to the differences between each type of join without the need for verbosity &amp; redundancy.