TSQL Basics Part 15: INNER AND OUTER JOIN – Video Explanation

TSQL Basics Part 15: INNER AND OUTER JOIN – Video Explanation
Download PDF

This is part 15 “inner and outer JOIN” of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of JOINS, and when they should be used. Then we’ll explore some common uses for JOINS, such as replacing a not in clause with JOIN to get the same results with better performance. You will take home the right foundations to get at the data that you want. Make sure to check of the other parts in this series in my JOIN Types playlist.

>>> Try our JOIN Types Course Today!

Transcription:


This is a combination of inners and outers and left outers, and it can get kind of wacky. But using Venn diagrams can help kind of crack down what’s going on.

So first we’re saying, Give me an inner JOIN between table one and table two, which is what’s only going to show me this little piece in the middle here. And then a left outer join is going to say, match me up with table three. But if table three doesn’t have a match, just show nulls.

So when we go and run that one, the inner JOIN with the left outer JOIN. First, I’m just going to run the inner JOIN. And you can see that’s the list that we saw on the very beginning of the demo up top in this sample. And then when we do the left outer join, it’s all of those same people from that original set that were inner join. So the inner join got rid of Johnny and Karen, who didn’t have a favorite color. But the left outer join brought in the pizza here for Beth, but left everyone else’s favorite food has been no and didn’t exclude them.

Also, just a reminder, you can download the JOIN types poster at SteveStedman.com. And this is a poster I created a few years ago that just sort of shows how all the different joins that we’re going to be covering through this presentation are done. It’s handy to print out and keep on your cube wall or near your workspace.


Our JOIN Types Course Comes With:

• Easy to understand lectures with examples

• Assignments

• Sample code to work with

 

More from Stedman Solutions:

SteveStedman5
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!

Leave a Reply

Your email address will not be published. Required fields are marked *

*