Dung (Donny) Nguyen

Senior Software Engineer

Types of Joins in SQL

In SQL, INNER JOIN, LEFT JOIN, and RIGHT JOIN are different types of joins used to retrieve data from multiple tables based on a related column between them. Here’s a breakdown of each type and their differences:

1. INNER JOIN:

2. LEFT JOIN (or LEFT OUTER JOIN):

3. RIGHT JOIN (or RIGHT OUTER JOIN):

Summary of Differences:

Example Scenario:

Imagine two tables: Employees and Departments.

I hope this helps you understand the differences between these types of joins!