< Sql Tutorial

Sql Update

← Previous Next →


SQL UPDATE statement is used to update records in a table.


The SQL UPDATE Statement

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

SQL UPDATE Syntax

UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value;

Lets see an example,

update Student set age=18 where s_id=102;
S_id S_Name age
101 Adam 15
102 Alex 18
103 chris 14

Example to Update multiple columns

UPDATE Student set s_name='Abhi',age=17 where s_id=103; 

The above command will update two columns of a record.

S_id S_Name age
101 Adam 15
102 Alex 18
103 Abhi 17
← Previous Next →