Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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,490 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