--- title: "How do SQL Joins Work?" description: "Learn how SQL joins work with detailed explanations and examples." image: "https://assets.bytebytego.com/diagrams/0367-top-4-types-of-sql-joins.png" createdAt: "2024-03-11" draft: false categories: - technical-interviews tags: - "SQL" - "Database" --- ![](https://assets.bytebytego.com/diagrams/0367-top-4-types-of-sql-joins.png) The diagram above shows how 4 types of SQL joins work in detail. ## INNER JOIN Returns matching rows in both tables. ## LEFT JOIN Returns all records from the left table, and the matching records from the right table. ## RIGHT JOIN Returns all records from the right table, and the matching records from the left table. ## FULL OUTER JOIN Returns all records where there is a match in either left or right table.