• Articles
  • Tutorials
  • Interview Questions

INNER JOIN in SQL for Beginners

Tutorial Playlist

What is INNER JOIN in SQL?

INNER JOIN is a keyword, which is used to select all rows from the participating tables in SQL as long as there is a match between columns.

INNER JOIN in SQL

SQL INNER JOIN gives records that have matching values in the participating tables. For example, let’s say, we have two tables, Table A and Table B. When INNER JOIN in SQL is applied to these two tables, it will get only those records that are common to both Table A and Table B
A Brief Introduction to Inner Join

Interested in learning SQL? Enroll in our SQL Training now!
 

SQL INNER JOIN Syntax

SELECT columns
FROM table1 name
INNER JOIN table2 name
ON table1.coumn_x = table2.column_y;

where SELECT, INNER JOIN, and ON are the keywords, columns are the list of columns, table1 is the first table, table2 is the second table, and column_x and column_y are the columns for performing the INNER JOIN, followed by a semicolon.

Become a Database Architect

SQL INNER JOIN Example

Let’s apply SQL INNER JOIN to two tables, the employee table, and the department table

Select employee.e_name, employee.e_dept, department.d_name, department.d_location from employee
INNER JOIN department
ON employee.e_dept = department.d_name;

A Brief Introduction to Inner Join 1
After writing the query, click on the execute button to check for errors. Once the query is executed, a message appears like ‘Commands completed successfully.
This brings us to the end of this INNER JOIN in SQL tutorial section. Go ahead and link the tables from your database to get a better insight into your data.

Wish to crack SQL job interviews? Intellipaat’s SQL Interview Questions are meant only for you!

Course Schedule

Name Date Details
SQL Training 16 Nov 2024(Sat-Sun) Weekend Batch View Details
23 Nov 2024(Sat-Sun) Weekend Batch
30 Nov 2024(Sat-Sun) Weekend Batch

About the Author

Data Engineer

As a skilled Data Engineer, Sahil excels in SQL, NoSQL databases, Business Intelligence, and database management. He has contributed immensely to projects at companies like Bajaj and Tata. With a strong expertise in data engineering, he has architected numerous solutions for data pipelines, analytics, and software integration, driving insights and innovation.