Updating Data

UPDATE Statement: Used to modify existing records in a table.Syntax:

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

Example:

UPDATE employees
SET salary = salary * 1.10
WHERE department_id = 10;

Explanation: This increases the salary of all employees in department 10 by 10%. The WHERE clause ensures that only the relevant records are updated.


Comments

Leave a Reply

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