Beginner

421. Three Table JOIN

Learn how to join three related tables in a single SQL query.

📘 Lesson 421 of 728 ⏱ 12 min 🎯 Intermediate

A three-table JOIN combines information from three related tables using appropriate join conditions.

Real-world business data is commonly distributed across several related tables, so analysts often need to combine three or more tables.

Combine customers, orders, and products to see which products each customer ordered.

SQL
SELECT
    c.CustomerName,
    o.OrderID,
    p.ProductName
FROM Customers c
INNER JOIN Orders o
    ON c.CustomerID = o.CustomerID
INNER JOIN Products p
    ON o.ProductID = p.ProductID;

Three-table joins are common in sales, banking, e-commerce, insurance, and financial reporting.

  • Multiple tables can be joined in one query.
  • Each JOIN normally requires a matching condition.
  • Table aliases improve readability.
  • Join relationships should be logically correct.
  • Additional joins can increase result complexity.
Can SQL join three tables?

Yes. SQL can join three or more related tables in a single query.

What should you check when joining multiple tables?

Check the relationship between each table, join conditions, keys, and possible row multiplication.

Have you finished this lesson?

Introduction to SQL – All Lessons