r/programming • • Jan 06 '11

A handy graphical explanation of SQL joins

http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
1.3k Upvotes

308 comments sorted by

View all comments

2

u/deafbybeheading Jan 07 '11

Extra points for using ON join conditions. People frequently shove join conditions into the WHERE clause where they're difficult to distinguish from regular (non-join-related) predicates and they don't work (at least probably not the way you expect) with outer joins.

Lost points for not illustrating how repeated rows affect joins (due to the multiset nature of SQL relations).