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 Cronin
4,466 PointsAs 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
231,269 PointsYou'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
4,466 PointsDaniel Cronin
4,466 PointsThank 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
231,269 PointsSteven Parker
231,269 PointsThat 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.