Update SQL Tutorial

Update Syntax:

UPDATE table_name SET column1 = new_value1, column2 = new_value2,... WHERE {condition}

IF you don't put the {condition} then all records on the updated column will be changed.

Store table:

OBJECT_IDPRICENAME
1200A
2500B
3900C
4500D

Example 1:

UPDATE store SET price = 300 WHERE object_id=1 AND name='A';

SELECT * FROM store WHERE object_id=1 AND name='A';

OBJECT_IDPRICENAME
1300A

Example 2:

UPDATE store SET price = 1000, name = 'Y' WHERE object_id=3;

SELECT * FROM store WHERE object_id=3;

OBJECT_IDPRICENAME
31000Y