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!
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
Scott Paterson
26,869 PointsDatabase 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

Ben Rubin
Courses Plus Student 14,658 PointsThe question says to "filter out" any averages over 2, which means you don't want to include any averages over 2.

Scott Paterson
26,869 PointsAh ha that explains it, i misread the question and took it to mean over thanks Ben

Will Lam
7,027 PointsAn 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
6,671 Pointsbut 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...

Ben Rubin
Courses Plus Student 14,658 PointsYes, 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.

ryanjones6
13,797 PointsGo here: https://teamtreehouse.com/community/code-challenge-3-2
for good code examples.