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
Colton Wollin738 Points
How can I find everything that isn't one of the numbers?
Review ratings should be only be 1-5. Find all the invalid ratings in one query. So far I have
SELECT * FROM reviews WHERE ratings and then I'm not sure how to go from there.
Carlos Federico Puebla Larregle21,073 Points
Then you do it like this:
SELECT * FROM reviews WHERE ratings NOT BETWEEN 1 AND 5;
I hope that helps a little bit.
You use NOT BETWEEN.
Colton, I assume you're referring to a code challenge, but I have no idea which one as the ones after Filtering Out have to do with books not ratings. I think what you're asking about has to do with using BETWEEN:
SELECT * FROM reviews WHERE ratings BETWEEN 1 AND 5;
So this query will return all fields from reviews where the rating of the review is between 1 and 5. You may want to review "Searching within a Range of Values": https://teamtreehouse.com/library/sql-basics/finding-the-data-you-want/searching-within-a-range-of-values for more information.
If this isn't what you're looking for, I'm happy to help, but it might be good to re-phrase your question and point to a specific challenge...if that's the issue.
Bartlomiej ZabielskiCourses Plus Student 10,363 Points
yeah NOT BETWEEN i got confused and kept trying IS NOT BETWEEN derp derp