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 trialRobert Bilic
6,155 PointsLike before, select the average "score" as "average", setting to 0 if null, by grouping the "movie_id" from the "reviews" table. Also, do an outer join on the "movies" table with it's "id" column and display the movie "title" before the "average". Finally
Can't solve this i tried
SELECT CONCAT(first_name," (",username,")") AS display_name FROM users.
3 Answers
Andrew Barber
3,865 PointsCONCAT?
Carter Cochran
7,068 PointsI have this but it's still not working:
select m.title, ifnull(avg(r.score) as average, 0) from reviews r left join movies m on m.id = r.movie_id group by r.movie_id having average > 2;
Carter Cochran
7,068 PointsChange to:
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;
STILL not working. There's a bug in this one
Carter Cochran
7,068 Pointsderrrr....
I had greater than instead of less than.