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

General Discussion

problem with code challenge in database foundations

grouping-joining-and-cleaning-up code challenge. question 3 of 3

it keeps complaining about no outer join but there is. here is the code I used to answer the question.

SELECT title,IFNULL(AVG(score),0) as average from reviews right join movies on movie_id = movies.id group by movie_id having average < 2

1 Answer

I know this was posted 3 months ago, but I just had problems with it and figured it out. So incase anyone else might need help with it, here is what I did:

SELECT title, 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;