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

Databases

database foundations

stuck again...

this time it's the following link:

https://teamtreehouse.com/library/database-foundations/sql-calculating-aggregating-and-other-functions/grouping-joining-and-cleaning-up-2

here's my answer that comes back as incorrect:

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;

your input would be appreciated.

2 Answers

Hi Bill,

You need a comma after the title column name.

Also, in your ON clause you have movies_id which should be movies.id

hello jason...i added the comma after title and changed the on clause and it still didn't work.

Maybe refresh and try again.

The following passed task 3 for me:

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;

All I did was copy and paste your statement into task 3 and then made those 2 changes.

thank you jason!!! i tried it again, and it worked this time...don't know what i did wrong the first time.