The SET Clause

The SET clause specifies the column(s) to be changed and the changed value(s). The WHERE clause determines which row or rows are updated. Note that if you don't specify a WHERE clause, the specified columns of all rows are updated with the values given in the SET clause.

For example, if all the publishing houses in the publishers table move their head offices to Atlanta, Georgia, this is how to update the table:

UPDATE publishers
SET city = 'Atlanta', state = 'GA'

In the same way, you can change the names of all the publishers to NULL with this statement:

UPDATE publishers
SET pub_name = null

You can also use computed column values in an update. To double all the prices in the titles table, use this statement:

UPDATE titles
SET price = price * 2

Since there is no WHERE clause, the change in prices is applied to every row in the table.