Skip to content
Advertisement

Difference between natural join and inner join

What is the difference between a natural join and an inner join?

Advertisement

Answer

One significant difference between INNER JOIN and NATURAL JOIN is the number of columns returned.

Consider:

The INNER JOIN of TableA and TableB on Column1 will return

The NATURAL JOIN of TableA and TableB on Column1 will return:

The repeated column is avoided.

(AFAICT from the standard grammar, you can’t specify the joining columns in a natural join; the join is strictly name-based. See also Wikipedia.)

(There’s a cheat in the inner join output; the a. and b. parts would not be in the column names; you’d just have column1, column2, column1, column3 as the headings.)

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement