Great! Now that you know how to add data to the database, it's time to learn how to modify existing data.
If you want to change the
name of the user with ID 7, you can use the command:
SET name = 'Elizabeth'
WHERE id = 7;
user is the modified table,
name is the modified column, and
'Elizabeth' is the new value of the column. The
WHERE condition tells the database which rows should be modified, and it can be any condition you'd write in a
SELECT clause. (Remember that you can always go to the SQL Basics course for more information).
After you run the query, the
name for the
id 7 will be set to
'Elizabeth'. Piece of cake!