Raise Every Engineering Salary by 10%
Mediumsql
Write an UPDATE that gives every employee in the 'Engineering' department a 10% raise: new salary = FLOOR(salary * 1.1) (rounding down to the nearest whole number). Do not touch employees in other departments. The checker runs SELECT id, name, salary FROM employees ORDER BY id; afterward.
sqlCREATE TABLE employees ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, department TEXT NOT NULL, salary INTEGER NOT NULL );
Sample data (this is the starting state before your statement runs):
sqlINSERT INTO employees (id, name, department, salary) VALUES (1, 'Asha', 'Engineering', 80000), (2, 'Rohan', 'Engineering', 70000), (3, 'Neha', 'Sales', 60000);
Example 1
Input
(none)
Output
id name salary 1 Asha 88000 2 Rohan 77000 3 Neha 60000
Filter with WHERE department = 'Engineering' so only the right rows change. Reference: UPDATE employees SET salary = FLOOR(salary * 1.1) WHERE department = 'Engineering';