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 Modifying Data with SQL Updating Data in a Database Updating Data in a Database Review

Sebastiaan van Vugt
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sebastiaan van Vugt
Python Development Techdegree Graduate 13,554 Points

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
231,184 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.