Inner Join in SQL

5 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.74
List Price:  €65.44
You save:  €18.70
£40.02
List Price:  £56.04
You save:  £16.01
CA$68.38
List Price:  CA$95.74
You save:  CA$27.36
A$76.50
List Price:  A$107.11
You save:  A$30.60
S$68.11
List Price:  S$95.36
You save:  S$27.25
HK$391.33
List Price:  HK$547.90
You save:  HK$156.56
CHF 45.73
List Price:  CHF 64.03
You save:  CHF 18.29
NOK kr551.82
List Price:  NOK kr772.60
You save:  NOK kr220.77
DKK kr348.47
List Price:  DKK kr487.88
You save:  DKK kr139.41
NZ$84.17
List Price:  NZ$117.84
You save:  NZ$33.67
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,499.99
List Price:  ৳7,700.43
You save:  ৳2,200.43
₹4,169.28
List Price:  ₹5,837.33
You save:  ₹1,668.04
RM238.42
List Price:  RM333.81
You save:  RM95.39
₦66,060.50
List Price:  ₦92,489.99
You save:  ₦26,429.48
₨13,909.47
List Price:  ₨19,474.37
You save:  ₨5,564.90
฿1,848.90
List Price:  ฿2,588.61
You save:  ฿739.70
₺1,625.07
List Price:  ₺2,275.23
You save:  ₺650.15
B$255.76
List Price:  B$358.08
You save:  B$102.32
R937.79
List Price:  R1,312.98
You save:  R375.19
Лв91.35
List Price:  Лв127.91
You save:  Лв36.55
₩68,890.62
List Price:  ₩96,452.39
You save:  ₩27,561.76
₪191.22
List Price:  ₪267.73
You save:  ₪76.50
₱2,881.72
List Price:  ₱4,034.64
You save:  ₱1,152.92
¥7,903.16
List Price:  ¥11,065.06
You save:  ¥3,161.90
MX$857.83
List Price:  MX$1,201.03
You save:  MX$343.20
QR182.17
List Price:  QR255.05
You save:  QR72.88
P689.81
List Price:  P965.79
You save:  P275.98
KSh6,639.79
List Price:  KSh9,296.24
You save:  KSh2,656.45
E£2,392.59
List Price:  E£3,349.82
You save:  E£957.23
ብር2,846.33
List Price:  ብር3,985.10
You save:  ብር1,138.76
Kz41,694.65
List Price:  Kz58,375.85
You save:  Kz16,681.20
CLP$47,408.51
List Price:  CLP$66,375.71
You save:  CLP$18,967.20
CN¥362.20
List Price:  CN¥507.11
You save:  CN¥144.91
RD$2,937.78
List Price:  RD$4,113.13
You save:  RD$1,175.34
DA6,708.56
List Price:  DA9,392.53
You save:  DA2,683.96
FJ$113.10
List Price:  FJ$158.35
You save:  FJ$45.25
Q388.59
List Price:  Q544.06
You save:  Q155.47
GY$10,484.28
List Price:  GY$14,678.83
You save:  GY$4,194.55
ISK kr7,026.59
List Price:  ISK kr9,837.79
You save:  ISK kr2,811.20
DH506.20
List Price:  DH708.72
You save:  DH202.52
L890.49
List Price:  L1,246.75
You save:  L356.26
ден2,874.95
List Price:  ден4,025.16
You save:  ден1,150.21
MOP$404.09
List Price:  MOP$565.76
You save:  MOP$161.67
N$957.24
List Price:  N$1,340.22
You save:  N$382.97
C$1,844.23
List Price:  C$2,582.07
You save:  C$737.84
रु6,681.04
List Price:  रु9,353.99
You save:  रु2,672.95
S/188.25
List Price:  S/263.57
You save:  S/75.31
K193.43
List Price:  K270.82
You save:  K77.39
SAR187.48
List Price:  SAR262.50
You save:  SAR75.01
ZK1,328
List Price:  ZK1,859.31
You save:  ZK531.30
L232.80
List Price:  L325.94
You save:  L93.14
Kč1,174.50
List Price:  Kč1,644.39
You save:  Kč469.89
Ft18,370.82
List Price:  Ft25,720.62
You save:  Ft7,349.80
SEK kr544.35
List Price:  SEK kr762.14
You save:  SEK kr217.78
ARS$43,693.47
List Price:  ARS$61,174.36
You save:  ARS$17,480.88
Bs347.54
List Price:  Bs486.59
You save:  Bs139.04
COP$198,223.63
List Price:  COP$277,528.94
You save:  COP$79,305.31
₡25,122.12
List Price:  ₡35,172.98
You save:  ₡10,050.86
L1,237.47
List Price:  L1,732.56
You save:  L495.08
₲372,019.98
List Price:  ₲520,857.74
You save:  ₲148,837.76
$U1,930.85
List Price:  $U2,703.34
You save:  $U772.49
zł201.68
List Price:  zł282.38
You save:  zł80.69
Already have an account? Log In

Transcript

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.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.