SQL UPDATE Statement
SQL UPDATE statement allows you to modify the existing records of database table. Here is syntax of SQL UPDATE statement:
UPDATE <table_or_view_name>
SET {<column_name> = <literal> | <expression>
| (<single_row_select_statement>) | NULL |
DEFAULT,...} [WHERE <predicate>]
With SQL UPDATE statement, you can only update one table at a time. You can update single or multiple columns of single or multiple rows. The SET clause specify the column(s) to update and new value(s) to assign. WHERE clause are the place you use your condition to specify which row to be updated. Here is an example of using SQL UPDATE statement to update all employees which have salary less than 2000.(in the real world it could be a salary increment)
UPDATE employees SET salary = 2000 WHERE salary < 2000
So every employee which has salary less than 2000$ is updated and now have salary 2000$.