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 trial
Cant get the last code challenge
Here is my answer, I'm sure its just some small thing but I have to go to work now and don't have time to debug:
select title, ifnull(avg(score),0) as average from reviews left outer join reviews on movies.id=reviews.movie_id group by movie_id having average<2;
Daniel Johnson104,132 Points
You almost had it, but you can't join a table to itself. You had FROM reviews LEFT OUTER JOIN reviews, but it should be FROM movies LEFT OUTER JOIN reviews.
SELECT title, IFNULL(AVG(score), 0) AS average FROM movies LEFT OUTER JOIN reviews ON movies.id = reviews.movie_id GROUP BY movie_id HAVING average < 2;
Robert Kulagowski4,954 Points
I concur that the question is misleading, because it's written poorly and makes you believe that you're supposed to retrieve the values from the reviews table.
But since the question hasn't been updated in 3 months based on feedback, I'd be surprised if it ever is.