Okay, I will call you back again.
So in this PostgreSQL lecture we are going to look at left join.
So in the previous lecture we looked at join and we can see how we join these two tables.
But there is one thing here.
If you look at the table with join we have another strange table about four of these rows.
And when we join these we have only three rows because we joined only students that have phones assigned
to them.
Now as a data analyst you may be asked, oh, and need you to present to me the data set of every student
in this school who have bought phones and who doesn't have phones.
And you'll be like, how can I be able to achieve this?
So that is where the left join comes into play.
So the join method, we actually or the join keyword, we only give you people who assigned phone to
them or who assigned anything to them.
But the left join will give you what students who have phone assigned to them, and students who do
not have phone assigned to them.
And now let's go ahead and do that.
So this is just the same thing we would have just done.
And I'm going to do it instead of me going over to do this.
Let's go ahead and simply select whatever we have here so that you will know that all these are still
the set already.
And I'm going to select all from here.
And I'm going to press that just down here.
And I'm not going to put a semicolon at the end.
Go ahead and hit enter.
Now if I shoot one here and copy this join and copy this.
If I press that day I'm going to replicate exactly this.
But now I'll go ahead and add left and then press what I have.
So I have left join phone on on a new table created student dot phone underscore ID equal to funded
80.
And if I hit this now, you can see that I have this new tool created and I have the razor line.
Voila!
Assigned under this, but without a phone.
So you can see that we are able to get both students who we are, who have phone assigned to them,
and students who don't know how phone assigned to them in left join.
So the left join helps you to add everything together.
But when you use the join keyword alone, you just get people have this assigned to them alone.
So this is applicable when I go ahead to select a specified columns.
If I go ahead and copy this and come over here and I go ahead and press this and hit enter a warhead
and say from student I'm going to copy this.
Remember that this is what we did in previous lecture.
So I'm trying to replicate that so you can be able to follow on without getting uh distracted or confused.
So I'll go ahead and copy this.
And then over here I'll just go ahead and add the left and press this.
Now hit enter and you can see that I have four rows.
And in the previous lecture we have three rows.
Now you can see guru has Motorola, Tokubei has image, George has and Song Wang Rosalind has been assigned
to her.
So that is the difference between, uh, the join method or the join Kuwait and the left join keyword.
Now that is cool.
So what if you are asked to get students who don't have anything assigned to them?
How can you be able to do that?
So that is very simple a while and say select uh.
I want to select all.
Then from the students table the algorithm is where class where uh the font ID because this is the font
ID right.
So we're using the font ID to actually check this.
So we are the font underscore ID Is no.
Put a semicolon at the end and hit enter.
And you can see we have Rosa Len, uh, Mayweather.
And no phone was assigned to her.
All right.
So this is how you can be able to check out the student who has no phone assigned to him or her.
And, uh, you can be able to display that out.
And this helps us to display every student that has phone assigned to him or her.
And that is the power of the left join.
So the right the join actually gives you only people who are all have phone assigned to them.
What's the left join gives you everybody who have puts phone or no phone assigned to him or her, and
you get the data set for your own purpose or whatever you want to do with it.
So that is it for now.
On left, join while I put it down, practice with it.
And if you have any question, what had I use the question and answer section?
And I'm going to get back to you as soon as possible.
Thank you so much.
And I'm going to see you in the next video lecture.