SQL INNER JOIN keyword is used to select all the rows from both the tables as long as there is a match found between the columns present in both the tables. Here is the general form of the INNER JOIN keyword in SQL:
SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name=table2.column_name;
SELECT column_name(s) FROM table1 JOIN table2 ON table1.column_name=table2.column_name;
Let us assume that we have the following two table named "Admissions" and "Students".
In both the table we have one column (i.e., StudentID) which is common to both the table.:
Here is an example of INNER JOIN keyword in SQL. The following SQL statements will return all the Students with same StudentID from both the table named Students and Admissions:
SELECT Students.Name, Admissions.StudentID FROM Students INNER JOIN admissions ON Students.StudentID=Admissions.StudentID ORDER BY Students.Name;
It will display the following result: