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

Development Tools

mySQL 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;

IFNULL(AVG(score) . 0), that period is supposed to be a comma

Thank you Richard. ^_^

Samantha Ferrer
Samantha Ferrer
7,809 Points

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

Thanks Andrew Chalkley! Can't wait for the next Stages in mySQL ^_^