Thuta Learning
IntermediateData & Databasesbeginner

UPDATE

Relax. We'll talk through this in plain words — no textbook voice.

UPDATE is used to modify data that already exists. It's commonly used for editing a user profile, changing an order status, or updating a product price.

The most important warning

WHERE clause and run UPDATE, every row in the table can end up changed. This is SQL's "one slip changes everything" zone. Always double-check your condition before you hit run.

sql
UPDATE Customers
SET ContactName = 'Alfred Schmidt', City = 'Frankfurt'
WHERE CustomerID = 1;
You should see
What this code does: Updates the ContactName and City for the customer whose CustomerID = 1. Safe workflow: Before editing, run SELECT * FROM Customers WHERE CustomerID = 1; to confirm you've got the right row, then run the UPDATE. Common mistake: Forgetting the WHERE clause can change every row in the table.
UPDATE | Thuta Learning