SQL Exercises: UPDATE
Update Exercises
These exercises require you to update existing records in the keywords, person and movie tables from Movies database. You will need to use UPDATE statement. This makes use of the UPDATE, SET and WHERE keywords.
💡Remember: If you make a mistake you can always remove the container and start a new one.
- Write a statement to change the name of
terrorkeyword tohorror. - Write a statement to change the all the keywords
horrortosecret keyword. - Write a statement to change
nameof the personRZAtoRobert Fitzgerald Diggs. - Write a statement to change the
homepageof all the movies with a revenue higher than 1m to the Wikipedia page for Avatar - The Way of Water.
Now that we've wrecked these tables, let's look at the production_company and movie tables:
-
The production company behind
Forrest Gumpmovie recently changed their name. They have requested that we update the company name toParamount+. -
They also requested that you change all homepages for the movies that they produced to the Paramount+ streaming service.
You will have to check the movie_company table to see which movie ids correspond to the desired production company.
Extra points if you complete this exercise using a JOIN statement (as opposed to multiple SELECTs).