

The left join is based on the rows of the left table, and matches each row of the right table according to the join condition. For example A LEFT JOIN B, A is the left table, B is the right table. When the query involves outer joins, the planner has less freedom than it does for plain (inner) joins. When two tables are left joined, the first table is called the left table and the second table is called the right table. Left join is short for left outer join, and left join requires join conditions. In the result set of a natural join, columns with the same name in both tables appears only once. I will also briefly mention group-bys and distincs. The Inner Join keyword is used with the SELECT command and must be written after the FROM clause. The previous article focused on the nested loop join, and in this one I will explain the hash join. The following Venn diagram displays the PostgreSQL inner join where we can easily understand that the Inner Join returns only the matching records from Table1 and Table2: PostgreSQL Inner Join Syntax.

Note that a natural join does not need ON to be created join condition, its join condition is created implicitly. So far we have covered query execution stages, statistics, sequential and index scan, and have moved on to joins.
