Updating Data

Syntax: To modify existing records in a table:

UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition;

Example:

UPDATE employees SET salary = salary * 1.10 WHERE hire_date < '2020-01-01';

Notes: The WHERE clause is crucial; omitting it will update all rows in the table.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *