r/SQLServer • • Mar 23 '19

TSQL JOIN Types poster

http://stevestedman.com/2015/05/tsql-join-types-poster-version-4-1/
41 Upvotes

11 comments sorted by

1

u/[deleted] Mar 25 '19

The "OUTER JOIN WHERE id IS NULL" examples; isn't that syntax less efficient than NOT EXISTS or NOT IN?

1

u/mycall Mar 25 '19

It depends on the query plan. I've seen OUTER JOIN faster than NOT EXISTS sometimes, even when table indexes exist.

0

u/[deleted] Mar 23 '19

I admire the effort, but representing joins as circles and intersections of those is misleading. It is good for representing set's union/intersect etc operations, but not joins.

1

u/mycall Mar 23 '19

These are subset ideas of what joins can possible do, but these charts show common, reoccurring ideas so their usefulness exists. Also, it is good for beginners.

1

u/MeGustaDerp Mar 23 '19

I think this is going to be a sensitive topic on SQL subs for a while. Some ppl learned joins using venn diagrams and appear to be offended that others dont like them for joins.

1

u/[deleted] Mar 23 '19

Well, it is my opinion. I don't think they are showing what joins represent.

1

u/MeGustaDerp Mar 23 '19

I know what you mean. I agree with you.

3

u/ScotJoplin Mar 23 '19

Whilst useful to some people I’m sore I hate venn diagrams as join posters. They don’t show how you can add or remove rows or add nulls with joins. They’re a little too basic to explain a join. They are however amazing for things like explaining table operators.

1

u/[deleted] Mar 23 '19

I have this printed in color in a large format on a wall in my office, its a good conversation piece and a lot of people have actually stopped by to double check something on it.

1

u/joeywas Mar 23 '19

Ditto. I've got them printed out and hanging on a cabinet at entrance to my cube. Many people confused about the basic concept of JOIN have commented how helpful it is.

-1

u/crazybeardguy Mar 23 '19

Don’t show people that right joins exist...

Otherwise... it’s nice. I used something similar when I started SQL. I will give this to new people this when I onboard someone.

(Yes... it doesn’t hit all the gotchas... but seriously... this gets 90% of the job done)