The SET clause can use expressions instead of fixed values. SQL evaluates the expression for each affected row and stores the calculated result.
Many business operations require calculated updates such as salary increments, price increases, discounts, bonus calculations, and inventory adjustments.
The company gives every Sales employee a 10% salary increase using a mathematical expression.
UPDATE Employees
SET Salary = Salary * 1.10
WHERE Department = 'Sales';
Expression-based updates are common in payroll systems, inventory management, financial calculations, pricing engines, and sales reporting.
- Supports arithmetic expressions.
- Can reference existing column values.
- Works with SQL functions.
- Useful for bulk calculations.
- Can update thousands of rows.
- Supports mathematical operators.
- Frequently used for salary and price updates.
Can UPDATE perform calculations?
Yes. UPDATE can use arithmetic expressions and SQL functions in the SET clause.
Give one example of an UPDATE expression.
SET Salary = Salary * 1.10 increases the salary by ten percent.