Today we are going to discuss about the inner join you know very well that how join works because we have discussed the joints, you know in this lectures. So the inner join keyword select records that have matching values in both involves table possibles. As you know you have the a student ID eight and nine available in the subjects table and now select stating students you know very well that you have the eight and nine ID in the students table. So, in other words when you have the matching values in two different tables, how before doing this, I'm just showing you that if I say that select is staring you very well about it. Now, if I'm saying Select this is to grants dot s ID from students. Control Enter.
So now as you can see it's working. Whenever you use the ABLE TO tables name with God and the column name. It's the same thing like this. You're saying, okay, fine and in mind, it's also fine, because I'm going to use this pattern to getting the results from two different tables by using the IRS. Now I'm seeing it. Select I'm seeing two bears got s ID, and then to get the S ID columns on the students table.
Now I'm saying students.sh I'm saying that I'm going to get these two columns si D and s name. Now, I'm, again saying that subjects dot s name, that means I'm saying from the subjects, subject column, we have a subject name. And now I'm saying the subjects dot s ID. That means I'm saying this again. Now, I'm saying, phone, students. Now I have to use the join here I'm saying, inner join.
You can also use a small laters especially develop where I'm saying subjects God Sorry, I'm going to join the tables a student table with subjects. That's why I'm using this objection here. Now I'm saying race. Students got it ID equals two subjects dot student ID. Now enroll in the execute up. So now as you can see, it's showing you the four columns from two different tables, how advocacy of saying you the S ID, this is the student ID, this is the S name.
Oh, okay. I'm going to use as areas so you can easily understand how we have the same name. Davis, I'm seeing this ID here. I'm saying Student a subject me. Now here I'm saying subject it as subject. However, you see, it's showing you the results.
The student ID is a swimmer ID is nine. He's the john and Alex and they are enrolled in pH. P. and subject I is one, two, you know very well that we have to record in the students tables, sorry, in subjective form subjects. Saying subjects. So as you can see, we have two records. And here in the ID fields, you have eight and nine.
It just takes Look at students, we have eight and I nine it further john and LS. Now, this is your cheery you are getting the results from different columns by using the inner join. So this is the inner join. Now this is the conditions. So, INNER JOIN always worse when they match the values in both tables in schema join. When the match is found then when everyone works, because it's fetching you the two results because two results available.
Two items available in the subjects table. So that's why it's getting so in this way your inner join was thriving is enough for in the next session we are going to go over some other topics. So thank you for watching.