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

Databases

SQL quiz question

Finish the following statement to replace NULL values with the value of "Cross-Platform".

Anyone that did this step is the fill in "=" ?

4 Answers

The answer is

in

Hi Dino,

Is this the one that ends with ___________ (1, 4)?

If so, the answer would be "=" if you were checking against a specific id value as in id = 4

In this case though we're checking against a set of values. There's a keyword that you need to use here.

This question probably falls under prerequisite knowledge that you would have learned in "SQL basics"

Here's the relevant video from that course: https://teamtreehouse.com/library/sql-basics/finding-the-data-you-want/searching-within-a-set-of-values

The Teacher's Notes section should help you out.

What confused me at first was that there were no NULL values in the table that was displayed.

This question seems to have 2 different images that show up. The one you've seen and the correct one which has NULL values for the platform in rows 1 and 4. Treehouse staff are aware of the problem.

THE ANSWER IS

IN

AS Asma Al-Marrikhi has said.

This code worked perfectly well.

UPDATE games SET platform = "Cross-Plaform" WHERE id IN (1,4);

UPDATE games SET platform = "Cross-Plaform" WHERE id = 4; (1,4); Answer is =4; because the value of platform 4 is null and we have to replace it into a cross-platform. i hope you got the right answer.

  • "Cross-Platform"

I think we also need to use the 'IN' keyword here instead of the '=' operator