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 trialMicah Dunson
34,368 PointsAnswer works in browser but not Treehouse challenge?
I don't know what the challenge is asking for ?
Challenge Task 3 of 3
In the "reviews" table, with the column "score", return the average of all movie's joint scores. Alias the aggregated column as "average_all_scores".
My Answer
SELECT MIN(score) AS minimum_score, MAX(score) AS maximum_score, AVG(score) AS average_all_scores FROM reviews;
My answer works fine in the browser however treehouse indicates it is wrong
Treehouse: Bummer! There's something wrong with your query, alias the AVG(score) AS min_score and SELECT from the 'reviews' table.
3 Answers
jcorum
71,830 PointsMicah, thanks. The problem is that you have sort of combined the queries for Tasks 2 and 3 together. But the editor wants each one done separately, and not combined with any other. So Task 3 would be:
SELECT AVG(score) AS average_all_scores FROM reviews;
Micah Dunson
34,368 PointsYou're absolutely right! I'm thinking too hard lol. Thanks
Nathan Williams
Python Web Development Techdegree Student 6,851 PointsFrom the hint you copied, I think the issue is that the result needs to be aliased as min_score
, not minimum_score
jcorum
71,830 Pointsjcorum
71,830 PointsMicah, can you give us a link to the challenge. Your SQL does look OK, but it's not clear what the challenge is asking you to do, so I can't tell what it wants different.