codegurukool.com · Free coding tutorials & online compiler

Home › SQL Tutorial › SQL UPDATE

SQL UPDATE

Change existing rows.

UPDATE ... SET changes values. Always add WHERE: without it every row in the table is changed.

Example code

UPDATE Customers
SET city = 'Delhi'
WHERE id = 4;

SELECT name, city FROM Customers
WHERE id = 4;

Run this code in the online editor

← SQL INSERT INTO and NULLSQL DELETE →