Lesson 10 / 28

UPDATE

Change existing rows.

Updating rows

SET lists new values; WHERE picks which rows change.

UPDATE customers
SET email = 'asha.rao@example.com'
WHERE id = 1;

Output:

Query OK, 1 row affected

UPDATE without WHERE

Leave off WHERE and every row gets updated — always double-check the filter before running.