Updating Data Already In The Database
Updating is basically taking selects and inserts and jamming them together to form an update.
As an example, lets say we want to update the zip for Jim Smith:
update addresses set zip="10000" where id=1;
The where statement is similar to select, in this regard. Pretty much anything you can do with a select, you can do with an update as long as it happens after the where clause.
You could also do something like this:
update addresses set zip="10000" where zip="90000";
Keep in mind that if we had multiple people in the table with the zip code 90000, we just updated all those records. It's best to be more specific when doing updates. For example, you might want to only use the unique id of the table, like:
mysql> update addresses set zip="10000" where id=1;