Databases SQL Reporting by Example Day 2: Advanced Selecting Day 2: Review

Donnie Driskell
Donnie Driskell
2,243 Points

sql reporting by example: Day 2 Review (stuck)

I am completely stuck on this one.

Write a query to figure out how many employees are in each job role. SELECT JOBS.ROLE, COUNT(1) FROM EMPLOYEES JOIN JOBS ON EMPLOYEES.JOB_ID = JOBS.ID _____________;

Thanks for any help. Donnie

2 Answers

David Evans
David Evans
10,336 Points

Hi Donnie,

I believe they are looking for you to use the SQL Group By function.

You can read about it here: https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html

Basically though for the quiz, you'll add the following

GROUP BY JOBS.ROLE
Donnie Driskell
Donnie Driskell
2,243 Points

Yes, I did a "GROUP BY" but I barely missed it. I put GROUP BY JOBS (and did not put the .ROLE there)

thanks for the quick response