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

Development Tools

Code Challenge Help: SQL Calculating, Aggregating, and other Functions

Im having a bit of trouble on the first question, of the first code challenge in SQL calculating, aggregating, and other functions.

The code challenge is asking:

Count all rows in the "users" table and alias it as "user_count".

Simple enough, I did a quick review in my notes and came up with this: SELECT COUNT (*) AS user_count FROM users;

All I get back is BUMMER! You're missing the COUNT() Function..

Any thoughts on what I am doing wrong? Thanks!

Fred Tarbox
Fred Tarbox
Courses Plus Student 17,110 Points

you have a space between COUNT and (*). Its throwing an error in my test table

4 Answers

Fred Tarbox
PLUS
Fred Tarbox
Courses Plus Student 17,110 Points

correction: you have a space between COUNT and (*). Its throwing an error in my test table

Thanks! the spacing was the issue

Fred Tarbox
Fred Tarbox
Courses Plus Student 17,110 Points

Happy to help!

I totally spaced when I thought you forgot the table name.....too may hours on the computer that day.

wouldn't FROM users;

be calling from the users table?

Mike Morales
Mike Morales
19,833 Points

Hi Christian, Try replacing the asterisk with id, I'm not sure if that will work but give it a try, that's if you haven't figured it out by now?

Mohammed Hossen
Mohammed Hossen
5,591 Points

I had the same issue but I replaced the key words with uppercase and it works just fine. I could be the case sensitive issue.

SELECT COUNT(*) AS user_count FROM users;