UPDATE
UPDATE

The following statement doubles the commission of salespeople in Hong-kong,
and sets their salary to some default value already defined for the column.


UPDATE Salespeople
SET Commissions=0.30, Salary=40000 WHERE City='Hong Kong' AND Year=2001

  • The statement "UPDATE" changes the values in the Salespeople table.
  • The SET is SQLPLUS command telling how to act.
  • The WHERE keyword tells ORACLE what qualifications you'd like to put on the information it is selecting for you.

The following illustration shows a work of UPDATE statement.

Salespeople.
CityCommissions SalaryYear
Hong Kong0.25500002000
Hong Kong0.30400002001
EXERCISE:

Write SQL UPDATE statement for the table created in the following example CREATE A TABLE




Back to SQL statements.