To answer my own question:
When writing an update statement, write it out of order.
- Write
UPDATE [table-name]
- Write
WHERE [conditions]
- Go back and write
SET [columns-and-values]
Choosing the rows you want to update before you say what values you want to change is much safer than doing it in the other order. It makes it impossible for update person set email = 'bob@bob.com'
to be sitting in your query window, ready to be run by a misplaced keystroke, ready to mess up every row in the table.
Edit: As others have said, write the WHERE
clause for your deletes before you write DELETE
.