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 trialGary Law
14,632 PointsCannot pass the Code Challenge task 2 of 3 of Stage 7: SQL Calculating, Aggregating and Other Functions -
Could anyone help to advise what is the problem for below code. thanks.
Stage 7: SQL Calculating, Aggregating and Other Functions
Challenge task 2 of 3 Like before, group reviews by "movie_id", get the average "score" as "average" and filter out any averages over 2. Type in your command below, then press Enter.
select avg(score) as average from reviews group by movie_id having average>2;
3 Answers
bobkingstone
27,869 PointsHi Gary,
This one got me too, if you read the question again it says filter out any averages over 2, your statement is asking for values greater than 2. It should read less than < 2:
SELECT avg(score) as average FROM reviews GROUP BY movie_id HAVING average < 2;
Hope this helps. Bob
Gary Law
14,632 PointsThanks so much for your help
Christopher Andrew Kemur
7,709 Pointsthis post really help me, turn out i translated the question wrong. thank you guys.