0% completed
An INNER JOIN in SQL is a method for combining rows from two or more tables based on a related column between them. The join condition is specified using the ON
keyword, indicating which columns in each table should have matching values for the rows to be included in the result set.
Syntax
SELECT * FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name;
Example
Let's consider two tables, employees
and departments
Now, let's perform an INNER JOIN to retrieve information about employees and their corresponding departments:
Result
In this example, the INNER JOIN is based on the equality of the department_id
columns in both tables. The result set includes only the rows where there is a match between the department_id
values in the employees
and departments
tables. As a result, we get a cohesive view of employees and their respective departments.
.....
.....
.....
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible