From the course: Practice It: SQL Joins

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Check it: Right join

Check it: Right join - SQL Tutorial

From the course: Practice It: SQL Joins

Check it: Right join

(logo blipping) - [Instructor] Let's practice a couple of examples of changing the "LEFT JOIN" to simulate a "RIGHT JOIN" in practice. Let's start with an existing "LEFT JOIN." Here we have the "DimProduct" and "FactInternetSales" tables. If we were to perform a "LEFT JOIN" here, we're taking the "ProductKey" and "EnglishProductName" from the product table and all fields from "FactInternetSales." "DimProduct" is our left table, and "FactInternetSales" is our right and we're joining on the "ProductKey." This will result in all products from the product table and those that did not have a match to internet sales, resulting in null values for those internet sales columns. Let's switch this statement around. Keep the "LEFT JOIN" syntax here and just change the order of the tables, making the internet sales table, your left table. This will result in all "FactInternetSales" with the corresponding product information. This…

Contents