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

Scott Paterson
Scott Paterson
26,869 Points

Database Foundation Grouping and Joining question 2 passed but confusion

Hi Guys the question is - Like before, group reviews by "movie_id", get the average "score" as "average" and filter out any averages over 2.

I have completed the question and i don't want to put the whole answer but for the last part it passed as

HAVING average < 2;

I thought that bracket was less than? and isnt the average suppose to be over 2 which would be

HAVING average > 2;

little bit confused? Scott

6 Answers

The question says to "filter out" any averages over 2, which means you don't want to include any averages over 2.

Scott Paterson
Scott Paterson
26,869 Points

Ah ha that explains it, i misread the question and took it to mean over thanks Ben

Will Lam
Will Lam
7,027 Points

An important lesson to us all on carefully reading through the problem and fully understanding it rather than trying to spit out what we just learned lol. Thanks for chiming in, Ben!

Michele Guido
Michele Guido
6,671 Points

but shouldn't it be HAVING average <= 2 because it says filter out anything ABOVE two but that would mean that averages that are exactly 2 should be included...

Yes, you're correct Michele.

It'll actually pass the quiz both ways because there aren't any averages exactly equal to 2 in the data. However, if there were any averages exactly equal to 2, then it would have to be <= 2.