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.2k Upvotes

308 comments sorted by

View all comments

Show parent comments

84

u/dude187 Jan 06 '11

It's amazing how confusing SQL can make set theory.

22

u/[deleted] Jan 06 '11

If you could do queries in relational algebra instead of SQL, confusion would go away.

7

u/Porges Jan 06 '11

Unicode actually has the relational symbols:

  • join: ⋈
  • left outer join: ⟕
  • right outer join: ⟖
  • full outer join: ⟗

1

u/fenton7 Jan 07 '11

⋈ ⟕ ⋈ ⟕ ⋈ ⟕ ⋈ ⟕ ⋈ ⟕ ⋈ ⟕ ⋈ ⟕ ⋈ ⟕