36. Join Two Tables
MediumDatabases~12 min
The employees table stores a department_id, but the readable department name lives in the departments table.
Return each employee's name alongside their department name. Employees with no department should not appear.
Examples
Example 1
- Input:
- employees + departments
- Output:
- Ana Reyes | Engineering, Carla Diaz | Sales, …
Constraints
Return exactly two columns: the employee name, then the department name.The employee with no department is excluded.Row order does not matter.