Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases Modifying Data with SQL Updating Data in a Database Updating Data in a Database Review

replacing null values

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

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

My Question: Replacing the 3 dots with "in" is accepted as the correct answer. Does that however not change platform to "Cross-Platform" independent of current entries being empty (Null)? This statement will simply update id 1 and 4 if I understand it correctly.

1 Answer

Steven Parker
Steven Parker
218,691 Points

You are exactly right, but the current table is shown in the example and you can clearly see that the items with id's 1 and 4 have "NULL" for the platform. So those are indeed the items that need to be updated.

If you were writing a query from scratch, you'd naturally want to test the current value in the WHERE clause; but the quiz question wanted to see if you could get the job done within the constrains given.