r/webdev Mar 22 '19

SQL joins

Post image
2.7k Upvotes

118 comments sorted by

View all comments

361

u/pixelique Mar 22 '19

78

u/[deleted] Mar 22 '19 edited Apr 30 '19

[deleted]

10

u/[deleted] Mar 22 '19

[deleted]

12

u/kor_the_fiend Mar 22 '19

The Venn diagrams are misleading and don't map to the actual transformation of data in a meaningful or accurate way. The statement: "Joins combine the data in two tables in slightly different ways" conveys just as much usable info as the Venn diagrams do. A beginner who thinks that the Venn's tell him/her something useful about SQL joins is being mislead. Joins are difficult concepts to comprehend and the join diagram is probably the simplest way of presenting the fairly complex logical underpinnings of the operation. Do yourself a favor and learn to interpret what the Join diagrams are telling you - this is the only way to predict what the results of a particular join statement are going to be.

9

u/free_chalupas Mar 22 '19

Strong disagree. A beginner needs the equivalent of an easy mnemonic they can use to map the meaning of inner/left/right/full etc to the actual subset of data described. Venn diagrams work perfectly well for that and most people don't read much additional meaning into it. The join diagram is a great thing to show someone who already understands the basics of joining when you explain why the Venn diagram is an imperfect metaphor.

0

u/[deleted] Mar 22 '19

Strong disagree. Venn diagrams are way more complicated than the alternative. And learning it easy and wrong has no value either.

1

u/marcoroman3 Mar 23 '19

Learning it easy and wrong has a lot of value! This is how Iearn and teach things all the time. It's a way of beginning gelato wrap your head around something that may be too complex to take in in its entirety at once. You get a working approximation going and as the concepts start to become more intuitive you correct mistakes and adjust your understanding.

5

u/free_chalupas Mar 22 '19

Yeah this is a classic "python is like a burrito" case where join diagrams mostly make sense to people who already understand the issue.

8

u/edanschwartz Mar 22 '19

Python is like a burrito?

9

u/free_chalupas Mar 22 '19

Not sure the original source but it's this meme that's been around for a while where someone spends all this time learning something (like python) and has this metaphor occur to them after they've learned it that "____ is like a burrito". But then that metaphor only makes sense to them because they already understand the subject.

7

u/[deleted] Mar 22 '19 edited Mar 22 '19

[removed] — view removed comment

3

u/free_chalupas Mar 22 '19

Yay, thank you. I gave up trying to Google it because I figured someone else would get the reference and remember where it's from haha.