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 trialDaniel Rego
7,956 PointsConfused on this quiz question? 'UPDATE games SET platform = 'Cross-Platform' WHERE id [ ] (1,4)
Confused because --- when adding a WHERE clause, don't you need to make that WHERE clause = to a column name? In this case, wouldn't it be "= (1,4)"?
3 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Daniel,
It would be = if you were checking a specific column number as in WHERE id = 1
but here we're checking against a set of values. There's another keyword that you're supposed to use here.
As a hint, they're asking for what would be the shorter way to do this: WHERE id = 1 OR id = 4
Daniel Rego
7,956 PointsThanks Jason,
I realized the BETWEEN when I noticed before I even saw the second post. Much appreciated.
Jason Anello
Courses Plus Student 94,610 PointsYou're welcome.
Are you sure that it passed with BETWEEN
?
That wouldn't be correct. In my answer, I was trying to lead you to using IN
A X
12,842 PointsI'm rusty on using IN because so far I've used AND & OR more...when would we want to use IN vs. OR?
Jason Anello
Courses Plus Student 94,610 PointsI'd say use IN whenever you can because it's less typing and less chance of making an error.
In this example you have WHERE id = 1 OR id = 4
vs. WHERE id IN (1, 4)
The IN version is more concise and you only have to type the column name one time.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsI realized you might be having trouble with this because it's part of the prerequisite knowledge for this course.
Here's the video from "SQL Basics" that should help you with what you need for this question.
https://teamtreehouse.com/library/sql-basics/finding-the-data-you-want/searching-within-a-set-of-values
I would recommend you take that entire course if you haven't already. There's also a cheat sheet you can download in the teacher's notes which might help you get through this course easier.