Loading Data Driven Insights
Preparing your learning content.
Preparing your learning content.
A beginner-friendly guide to the SQL UPDATE statement, including basic syntax, WHERE conditions, and a practical SQL Server-style example.
On this page
Jump to a lesson section
The UPDATE statement is used to change existing values in a table.
You use it when a record already exists, but one or more values need to be corrected, refreshed, or changed.
A basic UPDATE statement uses SET to choose the column and new value. It usually needs a WHERE condition so SQL knows exactly which row should be changed.
UPDATE table_name
SET column_name = new_value
WHERE condition;
UPDATE Employees
SET salary = 50000
WHERE employee_id = 4;
employee_id is 4.WHERE carefully when updating specific rows.We will update Noah Harris's salary using UPDATE.
UPDATE.This query updates one row in the Employees table.
UPDATE Employees
SET salary = 50000
WHERE employee_id = 4;
employee_id = 4.WHERE condition.After updating the salary, Noah Harris now has a salary value of 50000.
Without a proper WHERE condition, it can update more rows than expected.
SQL Roadmap Progress
Topic 10 of 111
9% complete
Next in SQL Roadmap
Continue with the next SQL topic in the recommended roadmap order.
Continue learning →