Structured Query Language/UPDATE 1

Hint: Be careful and deactivate AUTOCOMMIT.

The UPDATE command modifies one or more existing rows.

Values are assigned to the named columns. Unmentioned columns remain unchanged. The search_condition acts in the same way as in the SELECT command. It restricts the coverage of the command to those rows that satisfy the specified criteria. If the WHERE keyword and the search_condition are omitted, all rows of the table are affected. It is possible to specify search_conditions which hit no rows. In this case, no rows are updated - and no error or exception occurs.

As shown previously in the introductory page, the UPDATE command is very flexible. Within one command, we can choose an arbitrary combination of the two features: Additionally, values can have a dynamic nature like system date, timestamp, or timezone - depending on your implementation.
 * change one or more columns
 * change zero, one or more rows - depending on the search_condition.

For a recapitulation here is an example:

Further Information
We present some more information about additional opportunities of the UPDATE command here.

Exercises
Change column remark of row Fishing in table hobby to: 'Catching fishes with or without tools.'.

Change column remark of all rows in table hobby to: 'A creative leisure activity.'. Check the success of the command without COMMIT-ting. Revert the changes.

Find a solution for the previous exercise, which uses a WHERE clause.