SQL data engineering interview problem. Difficulty: beginner. Pattern: Joins. About 8 minutes. Free to practice.
Join employees to departments on department_id. Return name and department_name for employees with a matching department. Order by name.
Input: employees departments name | department_id department_id | department_name Alice Chen | 1 1 | Engineering Omar Ali | 2 2 | Sales 3 | Marketing Output: name | department_name Alice Chen | Engineering Omar Ali | Sales Why this passes: INNER JOIN keeps only employees with a matching department_id. Marketing has no employees in the seed.
Topics: lakebench, sql, inner join.
More SQL interview questions · All interview problems · Learn data engineering
Interview-style drill: Inner join employees to departments.
Join `employees` to `departments` on `department_id`. Return `name` and `department_name` for employees with a matching department. Order by `name`.