SQL • LESSON 17

INNER JOIN

Learn how to combine matching rows from two SQL tables using INNER JOIN.

🟡 Intermediate⏱ 2 Minutes⭐ 300 XP
🤔 THE QUESTION

How can we combine information from two related SQL tables?

💡 WHAT IS IT?

A JOIN connects rows from different tables using a related column between them.

🎯 WHAT IS IT USED FOR?

JOINs are essential when information is split across multiple tables, such as employees and departments, customers and orders, or products and sales.

💻 EXAMPLE
SELECT
e.name,
d.department_name
FROM employees e
JOIN departments d
  ON e.department_id = d.department_id;

Mission Brief

Practice joining employees with departments using a matching department ID.

Objectives

  • SELECT
  • FROM
  • INNER JOIN
  • ON
  • Table relationships