UPDATE query is used to modify the existing records in a table. You can use the
WHERE clause with the
UPDATE query to update selected rows; otherwise, all the rows will be updated.
The basic syntax of the
UPDATE query with the
WHERE clause is as follows:
UPDATE table_name SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition];
You can combine n number of conditions using the
The following is an example that will update
SALARY for an employee whose
UPDATE employee SET SALARY = 15000 WHERE ID = 6;
This will update the salary to
ID = 6.