How to join 3 or more tables in SQL

In a database, information is typically separated into different tables. The JOIN (or INNER JOIN) statement enables us to combine the columns we require into a single table. The syntax of joining 3 or more tables is the same as joining 2 tables:​

JOIN, INNER JOIN and , can be used to join tables. However, if a , is used, then the WHERE clause needs to be used instead of the ON clause.

1. Simple Join

First, all the tables are joined using the JOIN keyword, then the WHERE clause is used:

FROM Employee e JOIN Salary s JOIN Department d
        WHERE e.ID = s.Emp_ID AND e.Dep_ID = d.ID

2. Nested Join

The nested JOIN statement is used with the ON keyword:

SELECT e.ID, e.Name, s.Salary, d.Name
FROM (Employee e JOIN Salary s ON e.ID = s.Emp_ID)
  JOIN Department d ON e.Dep_ID = d.ID
Joining 3 tables
Joining 3 tables

Unlock your potential: SQL joins series, all in one place!

If you've missed any part of the series, you can always go back and check out the previous Answers:

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved