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 Database Foundations SQL Calculating, Aggregating and Other Functions Grouping, Joining and Cleaning Up

Juliette Tworsey
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Points

Like before, group reviews by "movie_id", get the average "score" as "average" and only include averages under 2.

For the life of me I cannot figure out why my code is failing....

Can anyone see what I am missing?

Thanks-

2 Answers

Daniel Markham
Daniel Markham
10,976 Points

Hi again Julie,

Not sure what your code was, but this is what I got when I went through the challenge:

        ```sql
       SELECT AVG(score) as average FROM reviews GROUP BY movie_id HAVING AVG(score)<2;
        ```

Hope this helps.

Dan M.

Andrew Breslin
Andrew Breslin
10,177 Points

I had the above statement exactly -or so I thought -and could not figure out for the life of me why it would not work. Then I realized I had an extra space preceding my SELECT. When I removed the space, changing nothing else, it went through fine. My understanding is that an actual SQL statement would execute fine with an extra space at the beginning, but this interactive lesson was not able to handle the space. Please let me know if I am mistaken on this point and that SQL will not work with an extra space at the beginning or elsewhere in the statement.

Angelos Bolovinos
Angelos Bolovinos
3,958 Points

Hi Andrew, the space was the reason for me also to fail..

This also happened to me, and that's really goofy that it fails because of that...and not only that, but the error message doesn't reflect the correct reason for the fail either.