In SQL, if we rename INNER JOIN as INTERSECT JOIN, LEFT OUTER JOIN as LEFT UNION JOIN, and FULL OUTE

Posted by Jian Lin on Stack Overflow See other posts from Stack Overflow or by Jian Lin
Published on 2010-04-24T21:30:38Z Indexed on 2010/04/24 21:33 UTC
Read the original article Hit count: 387

Filed under:
|
|
|
|

In SQL, the name Join gives an idea of "merging" or a sense of "union", making something bigger. But in fact, as in the other post

http://stackoverflow.com/questions/2706051/in-sql-a-join-is-actually-an-intersection-and-it-is-also-a-linkage-or-a-sidew

it turns out that a Join (Inner Join) is actually an Intersection. So if we think of

Join = Inner Join = Intersect Join
Left Outer Join = Left Union Join
Full Outer Join = Full Union Join = Union Join

then we always get a feel of what's happening, and maybe never forget what they are easily.

In a way, we can think of Intersect as "making it less", therefore it is excluding something. That's why the name "Join" won't go with the idea of "Intersect". But in fact, both Intersect and Union can be thought of as:

Union: bringing something together and merge them unconditionally.

Intersect: bringing something together and merge them based on some condition.

so the "bringing something together" is probably what "Join" is all about. It is like, Intersection is a "half glass of water" -- we can thinking of it as "excluding something" or as "bringing something together and accepting the common ones".

So if the word "Intersect Join" is used, maybe a clear picture is there, and "Union Join" can be a clear picture too. Maybe the word "Inner Join" and "Outer Join" is very clear when we use SQL a lot. Somehow, the word "Outer" tends to give a feeling that it is "outside" and excluding something rather than a "Union".

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql