Command Shift

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.

  1. Write a statement to change the name of terror keyword to horror.
  2. Write a statement to change the all the keywords horror to secret keyword.
  3. Write a statement to change name of the person RZA to Robert Fitzgerald Diggs.
  4. Write a statement to change the homepage of 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:

  1. The production company behind Forrest Gump movie recently changed their name. They have requested that we update the company name to Paramount+.

  2. 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).

On this page