Skip to main content

Notice: Workspaces are undergoing maintenance and are temporarily unavailable.

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

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

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

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • 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,835 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,835 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.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

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

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord