From the course: Querying Microsoft SQL Server 2022
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Left, right, and full outer joins - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2022
Left, right, and full outer joins
- [Instructor] The three outer join types all retrieve these same rows as an inner join, plus some additional rows that an inner join excludes. If I run a select statement against the person table we can find out how many people there are. I'll grab the business entity ID, person type, first name and last name columns from the person table. This returns total of 19,972 rows. This corresponds to a single row for every person in the table. The person type includes a code that defines the kind of person each one is. So we have a number of employees with the EM code and if I scroll through here we'll see some additional people that are not employees. For instance, we have some independent contractors and some subcontractors and so on. Scrolling through the list, you'll see the different types. Now we can execute another query against the human resources, that employees table. To find information about specifically just the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Table joins and relationships3m 42s
-
(Locked)
Inner joins8m 8s
-
(Locked)
Left, right, and full outer joins4m 37s
-
(Locked)
Cross joins4m 39s
-
(Locked)
Challenge: Return data from multiple tables1m 6s
-
(Locked)
Solution: Return data from multiple tables6m 12s
-
(Locked)
Solution: Join data in multiple tables4m 4s
-
-
-
-
-
-
-
-