Databases Reporting with SQL Aggregate and Numeric Functions Counting Groups

Zach Johnston
Zach Johnston
1,350 Points

I'm not sure how this isn't pulling the correct count. SELECT COUNT(genre) AS genre_count FROM books GROUP BY genre

I've tested the same thing with different values in the playground, and it is pulling back information as I expect this to return

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 49,924 Points

According to the instructions the first column you are to select is genre: Include the genre column first and the genre_count as the second column of information

You will also want to use COUNT(*) to include null values in your count. COUNT(genre) only counts non null values for genre. See this video @ 2:19