Fetching latest headlines…
Inner vs Outer Joins: The Two Fundamental Join Types in SQL
NORTH AMERICA
🇺🇸 United StatesMay 11, 2026

Inner vs Outer Joins: The Two Fundamental Join Types in SQL

0 views0 likes0 comments
Originally published byDev.to

SQL joins fall into two fundamental categories — inner joins and outer joins — while LEFT, RIGHT, and FULL joins are subclasses of the outer join. This hierarchy is defined by the logical principle of "which rows are included in the result set" and "which table's unmatched rows are preserved".

The Two Fundamental Types

Type Core Logic Result Set
INNER JOIN "Match only — discard what doesn't match" Returns only rows that satisfy the join condition in both tables.
OUTER JOIN "Keep one side as the base — pad NULLs where no match exists" Returns all rows from one (or both) tables, filling in NULLs on the opposite side where necessary.

An inner join returns the set intersection; an outer join keeps unmatched rows alive. There is no third fundamental logic.

The Three Subclasses of Outer Join

Outer join splits into three variants based on which table's rows are fully preserved:

  • LEFT OUTER JOIN — preserves every row from the left table.
  • RIGHT OUTER JOIN — preserves every row from the right table.
  • FULL OUTER JOIN — preserves every row from both tables.

All three share the outer‑join principle of retaining unmatched rows; they differ only in the direction of retention. GBase 8a, as a SQL‑standards‑compliant database, follows this exact classification in its query engine.

Understanding this hierarchy helps you write correct join queries — when you choose an outer join, you must further specify whether it's left, right, or full. An inner join on a gbase database, however, is already a complete specification on its own.

Comments (0)

Sign in to join the discussion

Be the first to comment!