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 trialChristian Bryant
2,018 PointsCode 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!
4 Answers
Fred Tarbox
Courses Plus Student 17,110 Pointscorrection: you have a space between COUNT and (*). Its throwing an error in my test table
Christian Bryant
2,018 PointsThanks! the spacing was the issue
Fred Tarbox
Courses Plus Student 17,110 PointsHappy to help!
I totally spaced when I thought you forgot the table name.....too may hours on the computer that day.
Christian Bryant
2,018 Pointswouldn't FROM users;
be calling from the users table?
Mike Morales
19,833 PointsHi 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
5,591 PointsI 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;
Fred Tarbox
Courses Plus Student 17,110 PointsFred Tarbox
Courses Plus Student 17,110 Pointsyou have a space between COUNT and (*). Its throwing an error in my test table