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

Alina Li
Alina Li
1,820 Points

task #2 from Modifying Data with SQL

Task: update all contacts to first name "Mystery" and last name "Person"

my code:

update phone_book set first_name = "Mystery"
update phone_book set last_name = "Person"

there is Bummer!

What's wrong with my code?

2 Answers

Steven Parker
Steven Parker
231,128 Points

You forgot to provide a link to the challenge, but I'd bet it wants you to set both values with one UPDATE statement instead of two separate ones.

Josh Keenan
Josh Keenan
20,315 Points

Tried that and that didn't work, neither did his code, any ideas?

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

How can I get it to pass?

Steven Parker
Steven Parker
231,128 Points

Where is "his code"? And you still forgot to link to the challenge page.

But when setting multiple columns, use the word "set" only once, and separate the individual settings with commas.

Alina Li
Alina Li
1,820 Points

Thanks to everybody!

Steven Parker was right

''' update phone_book set first_name = "Mystery", last_name = "Person"