bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL UPDATE Statement

Concept visual

SQL UPDATE Statement

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

The SQL UPDATE Statement

The UPDATE

statement is used to update or modify one or more records in a table.

UPDATE Syntax

Update

table_name

Set

column1 = value1, column2 = value2, ...

Where

condition

;

Note:

Be careful when updating records in a table! Notice the WHERE

clause in the UPDATE

statement.

The WHERE

clause specifies which record(s) that should be updated. If you omit the WHERE clause, all records in the table will be updated!

Demo Database

Below is a selection from the

Customers table used in the examples:

CustomerID

CustomerName

ContactName

Address

City

PostalCode

Country

Alfreds Futterkiste

Maria Anders

Obere Str. 57

Berlin

12209

Germany

Ana Trujillo Emparedados y helados

Ana Trujillo

Avda. de la Constitución 2222 México D.F. 05021

Mexico

Antonio Moreno Taquería

Previous

SQL NULL Values

Next

SQL DELETE Statement