Lesson 10 / 30
UPDATE
Change existing rows with UPDATE and SET, and always use WHERE to avoid updating every row.
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.