INNER and OUTER Joins

Published July 26, 2025 By Sai Sree Ram Gundepudi

INNER JOIN vs OUTER JOIN

INNER JOIN returns only matching rows between tables.

SELECT e.first_name, d.department_name
FROM employees e
JOIN departments d ON e.department_id = d.department_id;

LEFT OUTER JOIN includes all rows from the left table.

SELECT e.first_name, d.department_name
FROM employees e
LEFT JOIN departments d ON e.department_id = d.department_id;

RIGHT OUTER JOIN includes all rows from the right table.

FULL OUTER JOIN includes rows from both tables whether matched or not.

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article