runtime
15 / 88

task INNER JOIN · easy

Employees and their departments

Return employee (the employee's name) and department (the department's name) for employees who belong to a department.

what to return

Columns
employeedepartment in this order
Rows
18 rows · any order
Watch for
Employees without a department are not listed.
Skill
Join two tables on a key. Refresher: Connect tables with JOIN →

expected result

Your query should return exactly these columns and values. Run it and compare.

expected result18 rows · any order
employeedepartment
Bruno CostaEngineering
Carmen DiazSales
Dev PatelEngineering

first 3 of 18 rows

data you can query

Sample rows from each table. Each column shows its type underneath; → marks a link to another table.

employees7 columns · 20 rows
idinteger · keynametextmanager_idinteger → employeesdepartment_idinteger → departmentstitletextsalaryrealhired_attext
1Ada MorenoNULLNULLCEO2500002019-03-01
2Bruno Costa11VP Engineering1800002019-06-15
3Carmen Diaz12VP Sales1500002020-01-10
4Dev Patel21Engineering Manager1400002020-05-04
5Elif Kaya41Senior Engineer1450002021-02-01

showing 5 of 20 rows

departments4 columns · 6 rows
idinteger · keynametextlocationtextbudgetreal
1EngineeringLisbon1100000
2SalesAustin450000
3FinanceAustin250000
4PeopleLisbon150000
5DesignRemote305000

showing 5 of 6 rows

solution.sql
 

Hints and the answer are always available. Using them counts the question as solved with help.