Skip to main content
SQL • LESSON 17

SQL INNER JOIN

How do we combine rows from two tables where matching keys exist in both?

Intermediate2 Minutes300 XP
🤔 THE QUESTION

How do we combine rows from two tables where matching keys exist in both?

💡 WHAT IS IT?

INNER JOIN returns only the rows that satisfy the matching condition in both tables.

🎯 WHAT IS IT USED FOR?

Joining orders with customer details, employees with departments, transactions with accounts.

💻 EXAMPLE
SELECT employees.name,
departments.department_name
FROM employees
INNER JOIN departments
ON employees.department_id = departments.id;

🎯 Mission Objectives

Practice typing production-grade SQL code for SQL INNER JOIN.

  • INNER JOIN
  • ON condition
  • Foreign Keys
  • Table joins