Try Mentor AI โ€” Free Pilot! Get instant, personalized help while you learn. Be among the first to explore it and shape what comes next. JOIN NOW

๐Ÿค‘ Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! ๐Ÿš€start learning today!

๐ŸŒŸ Dreaming of a bright future? ๐ŸŽ“ Ask about the Treehouse Scholarship program! ๐Ÿš€

โœจ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Cristian Luca
    Cristian Luca
    4,102 Points

    What's wrong with my code? Thanks a lot!

    Posted October 17, 2022 6:34pm by Cristian Luca
    Cristian Luca
    4,102 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    3 Answers

  • Jason Kirkpatrick
    Jason Kirkpatrick
    2,117 Points

    Can't seem to get this, though I think I'm counting the numbers of books in each genre instead of each genre. How?

    Posted February 18, 2022 6:04pm by Jason Kirkpatrick
    Jason Kirkpatrick
    2,117 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • xczurymqdj
    xczurymqdj
    2,289 Points

    In need of some help again, My code is not working right. please help me.

    Posted November 16, 2021 8:21pm by xczurymqdj
    xczurymqdj
    2,289 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    6 Answers

  • Jenn Giulietti
    Jenn Giulietti
    4,888 Points

    GROUP OF ROWS SQL

    Posted November 1, 2020 8:18pm by Jenn Giulietti
    Jenn Giulietti
    4,888 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • John Richter
    John Richter
    2,351 Points

    My returned COUNT(genre) is incorrect, and i can not figure out why. Please let me know what i'm doing wrong.

    Posted October 12, 2020 4:34pm by John Richter
    John Richter
    2,351 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • theteamtreehouse
    theteamtreehouse
    3,472 Points

    Why wouldn't this also work?

    Posted August 20, 2020 10:55pm by theteamtreehouse
    theteamtreehouse
    3,472 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Derek Morse
    Derek Morse
    1,776 Points

    stuck

    Posted May 27, 2020 3:04pm by Derek Morse
    Derek Morse
    1,776 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Derek Morse
    Derek Morse
    1,776 Points

    NOT understanding

    Posted May 26, 2020 6:39pm by Derek Morse
    Derek Morse
    1,776 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • Derek Morse
    Derek Morse
    1,776 Points

    STUCK AGAIN

    Posted May 26, 2020 2:25pm by Derek Morse
    Derek Morse
    1,776 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Derek Morse
    Derek Morse
    1,776 Points

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

    Posted May 18, 2020 3:45pm by Derek Morse
    Derek Morse
    1,776 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • rajpal Saini
    rajpal Saini
    2,331 Points

    cant find the solution for challenge task 2 of 2

    Posted April 28, 2020 11:59am by rajpal Saini
    rajpal Saini
    2,331 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • lucas morrow
    lucas morrow
    2,243 Points

    query didn't match

    Posted April 21, 2020 2:58am by lucas morrow
    lucas morrow
    2,243 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Kawaljeet Singh
    Kawaljeet Singh
    3,820 Points

    GROUP BY

    Posted April 17, 2020 9:29am by Kawaljeet Singh
    Kawaljeet Singh
    3,820 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Caleb Newell
    Caleb Newell
    12,562 Points

    Write a query to count all the unique genres in the books table. Alias it as total_genres.

    Posted April 9, 2020 1:26pm by Caleb Newell
    Caleb Newell
    12,562 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Tafari Carnegie
    Tafari Carnegie
    2,679 Points

    select genre,count(distinct genre) as total_genres from books group by genre

    Posted March 25, 2020 10:15pm by Tafari Carnegie
    Tafari Carnegie
    2,679 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Riley Egan
    Riley Egan
    2,452 Points

    I'm at a loss as far as what to do. I've re-watched the video several times and cannot get past this point.

    Posted November 20, 2019 7:47pm by Riley Egan
    Riley Egan
    2,452 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • newtocoding
    newtocoding
    4,940 Points

    How to answer this challenge?

    Posted September 25, 2019 12:17pm by newtocoding
    newtocoding
    4,940 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • Zach Johnston
    Zach Johnston
    2,500 Points

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

    Posted September 16, 2019 10:43pm by Zach Johnston
    Zach Johnston
    2,500 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Richard Kรผlling
    Richard Kรผlling
    9,465 Points

    I don't see what's wrong with my query, it seems that it returns what is asked for, doesn't it?

    Posted January 19, 2019 6:35pm by Richard Kรผlling
    Richard Kรผlling
    9,465 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Thomas Dam
    Thomas Dam
    5,237 Points

    Having trouble with Task 2 of Challenge

    Posted January 9, 2019 2:31pm by Thomas Dam
    Thomas Dam
    5,237 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Tetiana lukerievas
    Tetiana lukerievas
    5,641 Points

    Is the test outcome correct?

    Posted December 21, 2018 8:52pm by Tetiana lukerievas
    Tetiana lukerievas
    5,641 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Jose Lopez
    Jose Lopez
    2,278 Points

    I'm trying to count unique genres in books and I can't figure it out.

    Posted November 2, 2018 3:20pm by Jose Lopez
    Jose Lopez
    2,278 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • MIkhail Vinogradov
    MIkhail Vinogradov
    2,669 Points

    what am i doing wrong here please?

    Posted October 24, 2018 5:51pm by MIkhail Vinogradov
    MIkhail Vinogradov
    2,669 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

  • Kevin May
    Kevin May
    1,435 Points

    When asked "Write a query to count all the unique genres in the books table. Alias it as total_genres." get wrong count?

    Posted September 19, 2018 2:04pm by Kevin May
    Kevin May
    1,435 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • Kevin Matter
    Kevin Matter
    2,507 Points

    Question Bug

    Posted September 16, 2018 3:26pm by Kevin Matter
    Kevin Matter
    2,507 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • kelvinvockins
    kelvinvockins
    6,906 Points

    Reporting with sql, 2nd code challenge COUNT BY GROUP incorrect code

    Posted August 16, 2018 6:48pm by kelvinvockins
    kelvinvockins
    6,906 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • Naoya Yuda
    Naoya Yuda
    6,185 Points

    Count Function

    Posted July 31, 2018 7:36am by Naoya Yuda
    Naoya Yuda
    6,185 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • Joe Marcallini
    PLUS
    Joe Marcallini
    Courses Plus Student 14,816 Points

    SELECT genre, COUNT(genre) AS genre_count FROM books GROUP BY genre; Can you please tell me what is wrong with this

    Posted June 11, 2018 8:29pm by Joe Marcallini
    Joe Marcallini
    Courses Plus Student 14,816 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    2 Answers

  • Gleb Sklyr
    Gleb Sklyr
    17,492 Points

    Why is the a NULL genre value complicating this challenge and howto solve it elegantly?

    Posted January 31, 2017 12:30am by Gleb Sklyr
    Gleb Sklyr
    17,492 Points
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.