Updating Data with UPDATE
UPDATE modifies existing rows in a table. Use WHERE to target specific rows.
Basic UPDATE Syntax
UPDATE table_name
SET column1 = value1, column2 = value2
WHERE condition;
Warning: Without WHERE, UPDATE modifies ALL rows!
Exercises
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
UPDATE with Products
Loading exercise...
Loading exercise...
Danger: UPDATE Without WHERE
-- This updates EVERY row!
UPDATE users SET city = 'Unknown';
Always double-check your WHERE clause before running UPDATE.
Free Practice
Loading SQL editor...
Try:
- Update an email address
- Increase all ages by 1
- Reset the database and try different updates

