What's the difference between JOIN and INNER JOIN?

Overview

The JOIN syntax retrieves the same columns from two or more database tables or databases. Meanwhile, the INNER JOIN is functionally the same as the JOIN; both produce the same results.

Comparison

The comparison operator is used to match rows from two tables based on shared values from each table.

The JOIN statement creates ambiguity about which kind of JOIN the developer refers to because there are multiple JOIN statements such as: Outer Join, Left Outer Join, Right Outer Join. Therefore, INNER JOIN is an excellent approach to avoid such ambiguity.

The syntax of the JOIN statements varies, so we need to specify the right one. As JOIN and INNER JOIN have the same function, we might neglect the word INNER while coding.

The JOIN statement

Let’s view the syntax of the JOIN statement.

SELECT *
FROM
TableNo1 JOIN TableNo2
ON TableNo1.columnName = TableNo2.columnName;

The INNER JOIN statement

Let’s view the syntax of the INNER JOIN statement.

SELECT *
FROM
TableNo1 INNER JOIN TableNo2
ON TableNo1.columnName = TableNo2.columnName;

Note: Both of these queries produce the same results.

Free Resources