Skip to main content
SQL โ€ข LESSON 83

Three-Table JOIN

How can we connect employees, departments, and projects?

Advancedโฑ 3 Minutesโญ 960 XP
๐Ÿค” THE QUESTION

How can we connect employees, departments, and projects?

๐Ÿ’ก WHAT IS IT?

Multiple consecutive JOIN clauses link three or more tables across their shared foreign key relationships.

๐ŸŽฏ WHAT IS IT USED FOR?

Enterprise reporting, connecting employees, departments, and active project allocations.

๐Ÿ’ป EXAMPLE
SELECT e.name, d.department_name, p.project_name
FROM employees e
JOIN departments d
ON e.department_id = d.department_id
JOIN projects p
ON e.employee_id = p.employee_id;

๐ŸŽฏ Mission Objectives

Practice typing production-grade SQL code for Three-Table JOIN.

  • โœ“ 3-table JOIN
  • โœ“ Multi-table relational model
  • โœ“ Enterprise queries
  • โœ“ Project staffing