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 Reporting with SQL Aggregate and Numeric Functions Counting Groups

Data line does not match, what distinct am i missing?

SELECT genre, COUNT(*) AS "total genres" FROM books GROUP BY DISTINCT genre;

I am still not seeing what i a missing thanks for you help

Steven Parker
Steven Parker
231,248 Points

So what do you have now after applying the hints?

2 Answers

Steven Parker
Steven Parker
231,248 Points

You didn't say, but it looks like you're working on task 2. Here's a few hints:

  • the instructions ask for an alias of "total_genres" (with an underscore) instead of "total genres"
  • you won't need GROUP BY for this task
  • you only need to select the count, not the "genre" column
  • only count the distinct genres

Thanks again