This is part 18 “two inner JOINS” 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:
0:08
Alright, next I want to take a look at TWO INNER JOINS. This is just like the very first example we looked at work just takes its joining, and everything that’s matching up between two tables is being shown. But it’s throwing in a third table. And it’s saying, give me everything. And there’s a typo on the screen that should in the Venn diagram, it should show table one, table two, and table three, rather than table one, table one and table three. But let’s take a look at how that query works. And it’s only going to return those people who have a favorite color and have a favorite food.
0:44
And you can see there’s only one person that has both bed. Bath, her favorite color is yellow, and her favorite food is pizza. Now, if we just did the original part without joining a table three that would show all the people who had a favorite color. Or if we commented out the inner join to table two that would show all the people who had a favorite food, but joining them together and it shows all those people that had a favorite color and had a favorite food, or that matched up across all three tables.
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 have 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:
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!