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!
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

Lolidie Jeena Zubiri
13,238 PointsmySQL Grouping, Joining and Cleaning Challenge 3 of 3
Help! I don't know why my code is not working.
Here's the challenge: 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.
What's wrong in my answer? 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;

Lolidie Jeena Zubiri
13,238 PointsThank you Richard. ^_^

Samantha Ferrer
7,809 PointsHello! I did write the same code as before, but it's not working. I refreshed the browser and did again the previews two challenges but I'm stuck in this stage, some help?
1 Answer

Lolidie Jeena Zubiri
13,238 PointsThanks Andrew Chalkley! Can't wait for the next Stages in mySQL ^_^
Richard Crawford-Wilson
6,094 PointsRichard Crawford-Wilson
6,094 PointsIFNULL(AVG(score) . 0), that period is supposed to be a comma