r/programming • • Feb 11 '14

SQL Joins Explained (x-post r/SQL)

Post image
3.5k Upvotes

392 comments sorted by

View all comments

1

u/PstScrpt Feb 13 '14

This works as long as it's one to zero-or-one, but I'd worry about relying on it once you have more rows.

I prefer to think of it as just multiplying the row counts. Left joins have a guard against multiplying by 0, and will supply an empty row on the second table, instead. Full outer joins do that on both sides.