SQL Inner Join

SQL Inner Join return record having match value in both tables. If they don't have match values then that will not be displayed.

Take a table Student:

StudentID StudentName City
15 Rahul Pathankot
16 Karan Pathankot
17 Ajay Pathankot


Now, Take another table Fees

FeesID StudentID StudentName Fees
1 15 Rahul 800
2 16 Karan 800
3 17 Ajay 800


Query



SELECT Student.StudentID, Student.StudentName, FeesID, Fees  FROM Student
INNER JOIN Fees ON StudentID.Fees=StudentID.Student;



Output

StudentID StudentName FeesID Fees
15 Rahul 1 800
16 Karan 2 800
17 Ajay 3 800


Inner Join For Three Example



SELECT Student.StudentID, Student.StudentName, FeesID, Fees  FROM Student
INNER JOIN Fees ON StudentID.Fees=StudentID.Student
INNER JOIN Feesubmitted ON StudentID.Feesubmitted =StudentID.Student;

Back To Top