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 trialMUZ141094 Smart Mashegede
3,335 Points"Group all reviews by "movie_id" and get the average "score" and alias it as "average"
Please help i don't know where i'm lost here
3 Answers
Joel Koh
3,499 PointsThe question should inform which table to reference from.
MUZ141094 Smart Mashegede
3,335 PointsSELECT movie_id, AVG(score) AS average FROM reviews GROUP BY reviews.movie_id;
MUZ141094 Smart Mashegede
3,335 Pointsi finally got it: SELECT AVG(score) AS average FROM reviews GROUP BY movie_id;
Joel Koh
3,499 PointsThanks!
A X
12,842 PointsThis isn't working for me. You need the movie_id in the SELECT statement as well, even though this isn't explicitly said.
Alex Clark
2,966 PointsAlex Clark
2,966 PointsAgreed. It does correlate with the treehouse_movie_db but that isn't implied ;P
A X
12,842 PointsA X
12,842 PointsIt most certainly does, and it hasn't been fixed in over a year.