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 With SQL

Daniel Cronin
Daniel Cronin
4,466 Points

As far as I can tell I am correctly updating the rows in the table but the Challenge Task keeps failing.

I have tried update phone_book set (first_name, last_name) = ('Mystery', 'Person');

AND

update phone_book set first_name = 'Mystery'; update phone_book set last_name = 'Person';

1 Answer

Steven Parker
Steven Parker
231,268 Points

You're close, and your second try would actually work in practice. But the challenge wants you to to construct a single query that sets both values.

To set multiple values at a time, you can just separate them by commas. Here's a generic example:

UPDATE table SET field1 = value1, field2 = value2;
Daniel Cronin
Daniel Cronin
4,466 Points

Thank you for the help. I could have sworn I tried that syntax originally but I guess not. Grouping with parentheses works in my IDE. Is it not correct syntax for SQLite?

Steven Parker
Steven Parker
231,268 Points

That would also work in practice, I'm not sure why it doesn't pass the challenge. But it's probably not the technique that was shown in the videos.

I'd normally suggest submitting a bug report, but considering the recent changes, I suspect there's nobody to handle it.