Hacker News new | ask | show | jobs
by karmakaze 2062 days ago
I love Venn diagrams and I used to think these were fine, but I already intimately knew all about joins. Then someone said to me these diagrams don't make sense to describe joins. Today I'm in full agreement.

An 'element' is not in both table A and B, rather there are rows in A and rows in B which can have matching conditions (sometimes multiple times) or not. Showing these diagrams to someone to explain joins gives them a poor/mis-understanding of joins and Venn diagrams.

Instead on only complaining, I'll make an off the cuff suggestion as to a better diagram. Show two table-like-pictures with many rows each. Shade some rows of either side and say these have rows in the other table that match the ON condition. Then explain which rows get returned by each type of join. (bonus points for illustrating many-to-many matches)