Académique Documents
Professionnel Documents
Culture Documents
1 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
id name
id
name
-- ----
--
----
Pirate
Rutabaga
Monkey
Pirate
Ninja
Darth Vader
Spaghetti
Ninja
10/1/2014 1:24 AM
2 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
id
name
id
name
--
----
--
----
Pirate
Pirate
Ninja
Ninja
10/1/2014 1:24 AM
3 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
id
name
id
name
--
----
--
----
Pirate
Pirate
Monkey
null
null
Ninja
Ninja
Spaghetti
null
null
null
null
Rutabaga
null
null
Darth Vader
id
name
id
name
--
----
--
----
Pirate
Pirate
Monkey
null
null
Ninja
Ninja
Spaghetti
null
null
10/1/2014 1:24 AM
4 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
id
name
id
name
--
----
--
----
Monkey
null
null
Spaghetti
null
null
id
name
id
name
--
----
--
----
Monkey
null
null
Spaghetti
null
null
null
null
Rutabaga
null
null
Darth Vader
10/1/2014 1:24 AM
5 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
10/1/2014 1:24 AM
6 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
ShawnW
Funny, I just explained this to a co-worker in the same manner earlier in the
week. I guess it never dawned on me that others may have never thought
about joins in terms of these diagrams. Good post, Jeff!
Oct '07
capdog
Hey Jeff, thanks for the great blog - I thoroughly enjoy reading every single
one of your posts.
Even though I often am familiar with the concepts you talk of, I find the
simple manner in which you break down the issues is always a great
refresher.
Keep up the great work.
Oct '07
hacktick
linked from join (SQL) en wikipedia to your blog entry ... your post is
much better (or simplistic) than the techtalk on that wikipedia entry
Oct '07
Weeble
The post is much simpler than the Wikipedia entry because it omits all the
non-trivial cases. All of these examples assume that each entry in table A
will be matched by the join predicate to at most one entry in table B, and
vice-versa.
Oct '07
10/1/2014 1:24 AM
7 of 7
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
10/1/2014 1:24 AM