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 trialCharles Kaelin
4,003 PointsCODE CHALLENGE QUESTION: Grouping, Joining and Cleaning Up Question #3
For some reason, the code challenge isn't accepting my answer even though my results seem to fulfill the question. Any help would be highly appreciated... The specific question is: Challenge task of 3 Like before, group by "movie_id" on reviews, select average "score" as "average", filter out averages over 2 and do an outer join on the movies table. Bring back the movie "title" first then the average. Clean up the average and set it to 0 if null. My proposed answer is: SELECT title, AVG(score) AS average, IFNULL(AVG(score),0) AS average FROM reviews RIGHT OUTER JOIN movies ON movies.id = reviews.movie_id GROUP BY movie_id HAVING average > 2; Checking your answer...
4 Answers
Ben Rubin
Courses Plus Student 14,658 PointsThe question says "filter out" averages over 2, which means that you don't want anything over 2. What you have is almost correct, just flip your > operator. The wording of the question is a bit confusing.
Charles Kaelin
4,003 PointsAppreciate the help Ben! Your response does help to clarify the question.
Jeff Jones
8,544 PointsIf it helps, that was the bit that fooled me too. It's always the little things...
ryanjones6
13,797 PointsGood code examples and explanations here: https://teamtreehouse.com/community/code-challenge-3-2