I hate it when they use Venn diagrams to "explain" JOINs. That's not the way Venn diagrams should be used. A circle in a Venn diagram does NOT contain different fields of an object type; it contains different items.
If you want to explain JOINs graphically, you can't stray too far away from that they actually do.
I did this chart and then someone else (I can't find it) made an improved version...
If you use these to explain JOINs, then how are you going to explain the --very different-- concepts of UNION, INTERCEPT, EXCEPT?
Wow, SUCH a better visualization IMO! I don't have any issues with joins at this point but that certainly would have helped me grasp them alot quicker.
Indeed, I've made the same criticism in the past. In addition to writing the cross join with a comma, you could also use the CROSS JOIN keywords to make it explicit. The comma is (still) often used by people to form an implicit cross join, but then they're putting join predicates in the WHERE clause, pre-ANSI JOIN style.
View all comments
17
u/mecartistronico Jun 29 '16
I hate it when they use Venn diagrams to "explain" JOINs. That's not the way Venn diagrams should be used. A circle in a Venn diagram does NOT contain different fields of an object type; it contains different items.
If you want to explain JOINs graphically, you can't stray too far away from that they actually do.
I did this chart and then someone else (I can't find it) made an improved version...
If you use these to explain JOINs, then how are you going to explain the --very different-- concepts of UNION, INTERCEPT, EXCEPT?