Skip to content
Advertisement

How to get the department name in this tutorial sql query?

Following the tutorial on SQL here I want to query the number of employees per department together with the department name.

I tried the following query in that tutorial:

but it returns

instead of the expected output

What am I doing wrong here?

Advertisement

Answer

Group by dept_name not dept_id


And you can better use join like Juan Carlos Oropeza‘s answer:

enter image description here

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement