From the course: Querying Microsoft SQL Server 2012

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using JOINs in a query

Using JOINs in a query - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2012

Start my 1-month free trial

Using JOINs in a query

Now that we know the different types of joins that we can use to bring the data in for multiple tables for a single results set, it's time to take a look at examples of how to use those within an actual query. So let's switch over to SQL Server and see some examples of table joins. We're going to use the Adventure Works 2012 database, and in this database we have a bunch of different tables that provide a lot of relational opportunities to look at examples of multi table joins. And in this case what we are going to do is switch to using the Product Table in the Product Review Table, the reason being is because the data review relates to each other from a class two tables. And it makes the joins a little bit simpler to see rather than trying pull joins in from three or four tables simultaneously. In our first query we're going to take a look at selecting the product name from the product table. And then we'll combine that with comments in the product review ID that comes out of the…

Contents