SQL for Beginners
About Lesson

UPDATE

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

The syntax is as follows:

Note! Notice the WHERE clause in the UPDATE syntax. The WHERE clause specifies which record or records that should be updated. If you omit the WHERE clause, all records will be updated!

Example:

update CUSTOMER set AreaCode=46 where CustomerId=2

Before update:

After update:

 

If you don’t include the WHERE clause the result becomes:

→ So make sure to include the WHERE clause when using the UPDATE command!

 

Update Data in the Designer Tools:

The same way you insert data you can also update the data. Right-click on the specific table and select “Edit Top 200 Rows”:

Then you can change your data: