Beginner

401. INNER JOIN

Learn how INNER JOIN combines matching records from two tables.

📘 Lesson 401 of 728 ⏱ 12 min 🎯 Intermediate

INNER JOIN returns only the rows where the join condition matches in both tables.

Business data is often stored across multiple related tables. INNER JOIN allows analysts to combine that information.

Combine customers with the orders they have placed.

SQL
SELECT
    c.CustomerName,
    o.OrderID,
    o.OrderDate
FROM Customers c
INNER JOIN Orders o
    ON c.CustomerID = o.CustomerID;

INNER JOIN is widely used in sales, customer, banking, finance, HR, and operational reporting.

  • INNER JOIN returns matching rows from both tables.
  • The ON clause defines the matching condition.
  • Unmatched rows are excluded.
  • Tables are commonly joined using primary and foreign keys.
  • INNER JOIN is one of the most frequently used joins.
What does INNER JOIN return?

It returns only rows that have matching values according to the join condition in both tables.

What happens to unmatched rows in INNER JOIN?

Unmatched rows are excluded from the result.

Have you finished this lesson?

Introduction to SQL – All Lessons