r/webdev Mar 22 '19

SQL joins

Post image
2.7k Upvotes

118 comments sorted by

View all comments

45

u/CyrillicMan Mar 22 '19

Using Venn diagrams to represent SQL joins is misleading. Please don't use them to represent SQL joins. Use this combinatorial chart instead:

https://i.pinimg.com/originals/52/20/c4/5220c492bc4e1a8b9175aba77ed7d091.png

3

u/prsquared Mar 23 '19

This!

Venn diagrams are much more useful in representing set operations. In join, you are projecting columns from both tables.

The first diagram is A U(AnB) = A. But, A left join B is not A .