Writing SQL

Left, Right and Inner Joins

How the join types differ, when to use each and how to chain several joins in one query.

How to use 3 JOINs in SQL?

Chain one JOIN per extra table, each with its own ON condition. Learn how inner and left joins behave across three tables, with a worked example and output.

3 min read

What are the four types of JOINs in SQL?

Inner join, left join, right join and full outer join are the four main JOIN types in SQL. Here is what each returns, with sample tables and results.

3 min read

When to use left, right, or inner join?

Pick an inner join for matches only, a left join to keep every row from your main table, and a full join to keep unmatched rows from both, with examples.

4 min read

Which join is faster in SQL?

No join type is faster by default. Speed depends on indexes, table sizes and the query plan, so test your own queries with EXPLAIN before you choose.

3 min read

Related topics

More in writing sql