The INNER Join condition returns values as per below rule:

  • All the matching data values from Table A and Table B based on a common column between both the tables

SYNTAX:

119.png

Where,

  • INNER JOIN                              : keyword used for INNER JOIN, in order to fetch all the matching records from both the table.

  • Table_name1/Table_name2     : The name of the first/second table from where you want to fetch the data

  • Column1Name                          : The name of the columns of the table based on which you want to join.

 
 

EXAMPLE

Let us consider a demo database with two tables Persons & Salary .Following is the structure of both the tables:

120.png

Figure 32.1. SELECT * FROM PERSONS;

121.png

Figure 32.2. SELECT * FROM SALARY;

The following SQL statement selects all records from Salary table with EmployeeId information:

122.png

Figure 32.3 EXAMPLE OF INNER JOIN

 

PRACTICE YOURSELF

123.png