✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 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

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

  • 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
    • Showing results for:
    • Databases
    • Reporting with SQL
    • Aggregate and Numeric Functions
    • Counting Groups
    • Close
  • Cristian Luca
    Cristian Luca
    4,102 Points

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

    Posted on Oct 17, 2022 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 on Feb 18, 2022 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 on Nov 16, 2021 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 on Nov 1, 2020 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 on Oct 12, 2020 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 on Aug 20, 2020 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 on May 27, 2020 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 on May 26, 2020 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 on May 26, 2020 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 on May 18, 2020 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 on Apr 28, 2020 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 on Apr 21, 2020 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 on Apr 17, 2020 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 on Apr 9, 2020 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 on Mar 25, 2020 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 on Nov 20, 2019 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 on Sep 25, 2019 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 on Sep 16, 2019 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 on Jan 19, 2019 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 on Jan 9, 2019 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 on Dec 21, 2018 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 on Nov 2, 2018 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 on Oct 24, 2018 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 on Sep 19, 2018 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 on Sep 16, 2018 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 on Aug 16, 2018 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 on Jul 31, 2018 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,184 Points

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

    Posted on Jun 11, 2018 by Joe Marcallini
    Joe Marcallini
    Courses Plus Student 14,184 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 on Jan 31, 2017 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.