SQL UPDATE vs INSERT: Modify Data in SQL Tables
If you’re learning SQL, it’s important to understand how to modify data. A common question beginners ask is the difference between SQL UPDATE vs INSERT. These two commands serve very different purposes in SQL databases: INSERT is used to add new data, while UPDATE is used to change existing records.
In this post, I will show you what is an UPDATE query, how to update values in your database, and how to handle common update scenarios using real-world SQL examples.
SQL UPDATE vs INSERT: What’s the Difference?
INSERT | UPDATE |
---|---|
Adds new records to a table | Modifies existing records in a table |
INSERT INTO ... VALUES (...) | UPDATE ... SET ... WHERE ... |
Yes | No |
No | Yes |
Use INSERT
when you’re adding something new. Use UPDATE
when you’re correcting or changing something that already exists.
Here is what they look like in SQL Server Management Studio:

What Is an UPDATE Query?
An UPDATE query in SQL is used to change the values of one or more columns in existing rows.
Here’s the basic syntax:
UPDATE table_name
SET column1 = value1, column2 = value2
WHERE condition
Example: Update customer’s city
UPDATE Customers
SET City = 'London'
WHERE CustomerID = 'ISLAT'
This updates the city for the customer with ID = ‘ISLAT’.
Here is what it looks like in SSMS:

Once you execute this code, you will see that the value changed for the customer with ID = ‘ISLAT’:

Update Value in Database
Let’s say you want to increase all employee bonuses by 10%:
UPDATE EmployeeBonus
SET Amount = Amount * 1.10
This updates every row in the EmployeeBonus
table:

SQL UPDATE Without WHERE
Updating all of the records inside the table is not always a good thing. A common mistake is running an UPDATE
without a WHERE
clause, which updates every row in the table – often unintentionally.
Here is the example:
UPDATE Products
SET Price = 0
This would set the price of every product to 0. Always double-check your WHERE
clause when updating!
SQL UPDATE for Each Row in SELECT
You can combine UPDATE
with JOIN
or EXISTS
to update rows based on another query:
Example: Update each order’s ship address using Customers as a lookup table:
UPDATE ord
SET ord.ShipAddress = cust.Address
FROM Orders ord
JOIN Customers cust ON ord.CustomerID = cust.CustomerID
This updates each order’s ShipAddress
using the matching customer record:

SQL UPDATE IS NULL
You can use IS NULL
to update records that have missing data.
Example:
UPDATE Customers
SET Region = 'Not Provided'
WHERE Region IS NULL
This fills in missing Region with the value ‘Not Provided’ instead of NULL:

SQL UPDATE to NULL
To clear a value in a column, you can set it to NULL
.
Example:
UPDATE Products
SET CategoryID = NULL
WHERE UnitsInStock = 0
This removes the CategoryID
for products that have 0 units in stock:

SQL UPDATE to Uppercase
SQL’s UPPER()
function helps you standardize data by converting text to uppercase.
Example:
UPDATE Products
SET ProductName = UPPER(ProductName)
All product names will now be in capital letters:

Conclusion
Understanding the difference between SQL UPDATE vs INSERT is key to managing your database effectively. Use INSERT
when you’re adding new data and UPDATE
when you’re modifying existing records. With the examples above, you now know how to:
- Update specific values in a database
- Avoid updating all rows accidentally
- Handle
NULL
values - Use
UPDATE
withSELECT
orJOIN
- Format text using
UPPER()
Mastering the UPDATE
statement gives you powerful control over your SQL tables – and helps ensure your data stays clean and accurate.
If you missed my previous SQL blog post on How to Insert Data in SQL Database, make sure you check it out here.
If you would like to learn more about SQL queries, make sure you buy this book: T-SQL Fundamentals (Developer Reference)