SQL

SQL update statement with example

SQL update statement allows updating a value in an existing table.

Input Table

Assignment: Update salary for employees with age equal to or more than 34 with an increase of 35%.

update employees set salary = salary* 1.4 where age in (select age from employees where age >34);

Output table:

subquery update input data

 

Related Articles

Leave a Reply

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

Back to top button