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!
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
Adam Peterka
9,626 PointsCode challenge: inserting, updating and deleting
The second objective:
Update the film alien to have the year 1979.
I don't know why this doesn't work:
Update movies set year=1979 where title=1979
Please help.
Thanks.
8 Answers

Lee Chavers
22,506 PointsI think your query should be: UPDATE movies set year = 1979 WHERE title='Alien';

Lee Chavers
22,506 PointsAlban, I just used this command on the quiz and it worked for me
update movies set year = 1979 where title = 'Alien';

Alban JACQ
Courses Plus Student 4,172 PointsThanks for your answer Lee.
I just registered yesterday and I'm observing some strange behavior on the platform from my computer.
Yesterday I wasn't able to check the answers on code challenge because of communication errors, and earlier I swear I typed the exact same statement you indicated and it didn't worked and I just retried right now and now it's working .....
My computer is huanted or something ! ;)
thank you for your answer though CHeers A.

Lee Chavers
22,506 PointsI'm glad it's working for you now Alban.

Alban JACQ
Courses Plus Student 4,172 PointsI'm unearthing this post because for me this statement give me an error : UPDATE movies SET year = 1979 WHERE title="Alien"; return > Couldn't find the movie with the title 'Alien' in the year 1979 (which doesn't make sense considering my request)
And I don't get why .
I'm using the exact same statement on my local MySql server and it succeed.
A.

Ary de Oliveira
28,298 PointsAlban Hi I would like to ask a question, you are still having trouble with your computer. I read your testimony speaking up about your computer's behavio?

Clayton Perszyk
Treehouse Moderator 48,602 PointsComment removed.

Lee Chavers
22,506 PointsClayton, the only issue with that is Aliens is not the same movie as Alien ;)

Clayton Perszyk
Treehouse Moderator 48,602 PointsI was under the impression that the second question was updating and replacing the data from the first question; but now I see that it was independent of the first question and updating different data. Thanks for the response, you're definitely right. I removed my comment so it doesn't confuse anyone.

Ary de Oliveira
28,298 PointsChallenge Task 1 of 3
Insert a new row into the movies table where the title is the string 'Aliens' and the year is an integer 1986.
INSERT INTO movies (title, year) VALUES ("Aliens", 1986);
Challenge Task 2 of 3
Update the film 'Alien' to have the year 1979.
update movies set year = 1979 where title = 'Alien';
Challenge Task 3 of 3
Remove all movies from the year 1985 from the movies table.
DELETE FROM movies WHERE year = "1985";

Lee Chavers
22,506 PointsYou might need to encapsulate your values in ' ' or " ". Also you might want to check the movie title ;)

darius goore
3,803 PointsThe following is not working for me: UPDATE movies SET year=1979 WHERE name='Alien';
Thoughts?

darius goore
3,803 PointsSilly mistake. Thanks!