Time
9 hours 41 minutes
Difficulty
Intermediate
CEU/CPE
10

Video Transcription

00:00
I welcome back to module to quick review. This is less than 2.4 left joint. And the previous lesson we took a look at the inner joint and this lesson. We're gonna switch that inner, join to a left, join and see if we get different results back. Teoh kind of highlight how these two types of joints behave differently.
00:19
So let's go ahead and run that enter, join again and get that data back.
00:23
So this is the inner joined variant.
00:25
And let's switch this to a left, join and see if the data results switches at all.
00:31
If we run this,
00:34
we get back a new record. A Diane Murphy
00:38
who has no for employee number and name when referencing the manager table.
00:45
So this highlights held a left. Join is working because Diane Murphy existed in the left table with the result that was enough to bring a record back.
00:54
However,
00:55
she didn't have a match in the manager table, so we returned. No, which is a programs way of telling you nothing
01:03
back in the results, that so let's take a look at that table
01:07
specifically to make sure this makes sense that we haven't somehow misinterpreted the data or the way the query is written.
01:15
So I have the employees table open over here in D Beaver. This is not a query. This is strictly de beaver opening the table. If we take a look at Diane Murphy's record, we will see that she has a job title of president and the reports to field is no or empty, which
01:32
would lead me to believe that she does not have a manager, which might make sense because
01:36
she is the president.
01:38
Now, if we go back to our query
01:41
and we take a look at this and describe it again, we can see that the left table employees had Diane Murphy and the results set, so we brought her back. But there was no match for in the manager table for the reports two column. So we got no back.
01:57
So that finishes this portion of the left joint. Let's take a quick look over the
02:04
summary for this lesson,
02:06
and here we are at the left joint summary, so let's quickly review there's not too much to the left joint at its basic form.
02:13
The left join joining Key requires representation on the left table. We saw that with that Diane Record
02:21
column used Enjoying That relates to the data table records. Okay, that's the key column
02:27
and the blow Venn diagram to show that a returns all records with data shared nb as well. So Diane was in Table A
02:35
and the share data that was available and be four employees was returned. But we did get a records that didn't have a result in be back as well.
02:45
Data not. And B will return as no. And that's exactly what we saw.
02:51
So that completes this lesson. And the next lesson will go over the right join. And I hope to see you there. Thank you.

Up Next

Intermediate SQL

This free course introduces the student to intermediate concepts found in the implementation and application of Structured Query Language (SQL) within professional business environments.

Instructed By

Instructor Profile Image
Kitt Parker
Instructor