Loading, please wait...

Inner Join

How To Use Inner Join In SQL

Introduction:
In this article, you will learn what Inner Join is and how to use Inner Join in SQL.
Inner join is used to collect the common data from the database tables. This is the most basic join of SQL. It generates the output in a new table and it compares all the tables to each other.

 

Here, we have two tables-

 

Employee Table

 

 

 

Query Table

 

 

 

Now, we collect same records in both the tables, according to our condition.

 

Syntax

The syntax of Inner Join is as follows:

select table1.column1.., table2.column2... from table1 inner join table2 on table1.common_field = table2.common_field;

 

Example

Step 1: We write our query for Inner Join.

 

 

 

Now, select and execute this query.

 

Step 2: The output of this query is:

 

 

 

Summary:
Thus, we learned, an inner join is used to collect the common data in the database tables and its use in SQL.