SQL UPDATE COMMAND


The SQL UPDATE Query is used to modify the existing records in a table.
use WHERE clause with UPDATE query to update selected rows otherwise all the rows will be affected.

SYNTAX:

UPDATE table_name
SET column1 = value1, column2 = value2....columnN=valueN
[ WHERE  CONDITION ];

EXAMPLE:

UPDATE student SET name='KALA' WHERE no=103;
Updates the new value kala to the column name where no=103.

UPDATE CUSTOMERS SET ADDRESS = 'Pune', SALARY = 1000.00;
Modifies all ADDRESS and SALARY column values in CUSTOMERS table.

No comments:

Post a Comment