SQL

UPDATE Statement

Modify existing records in a table.

By TechCoder TeamLast updated: 2026-06-02
In a Nutshell

Modify existing records in a table. This hands-on tutorial focuses on practical implementation of update statement concepts.

UPDATE Statement

The UPDATE statement is used to modify the existing records in a table.

[!WARNING] Be careful when updating records. If you omit the WHERE clause, ALL records in the table will be updated!

Syntax

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

Example

Assume we have a customer named "Alfreds Futterkiste". We want to change the contact person and the city.

UPDATE Customers
SET ContactName = 'Alfred Schmidt', City = 'Frankfurt'
WHERE CustomerID = 1;

Update Multiple Records

If the WHERE clause matches multiple records, all of them will be updated.

-- Update the ContactName to 'Juan' for ALL customers in Mexico
UPDATE Customers
SET ContactName = 'Juan'
WHERE Country = 'Mexico';
SQL PLAYGROUND
⏳ Loading editor…