Combining Tables with INNER JOIN
INNER JOIN combines rows from two tables based on a matching condition.
It only returns rows where there is a match in BOTH tables.
Key concepts:
- Use aliases (e, d) to shorten table names
- ON specifies the matching condition
- Only matching rows appear in results
- Employees without a department are excluded
INNER JOIN is the most common type of join in SQL.
Check your understanding
Get each employee's name with their department name using INNER JOIN.
Examples run on the employees sample database. Open any of them in the playground to experiment.