Given Table - 'Employee'
Attributes - EmployeeID, Name, Salary
Identify the correct query for performing the following operations:
Increasing the salary by 40% of all employees.
Given Table - 'Employee'
Attributes - EmployeeID, Name, Salary
Identify the correct query for performing the following operations:
Increasing the salary by 40% of all employees.
Solution
SQL changes existing rows with the UPDATE statement, so the command must begin with UPDATE, not MODIFY (which is not a valid SQL command for this).
Increasing a value by 40% means the new salary is the old salary plus 40% of it:
So the query is: UPDATE EMPLOYEE SET SALARY = SALARY*1.40;
Since there is no WHERE clause, it applies to all employees.
Option 1: SALARY*0.40 sets the salary to 40% of the old value, which is a decrease and not an increase.
Options 2 and 4: MODIFY is not the SQL command for changing row data (ALTER TABLE ... MODIFY changes column definitions, not values).
Related questions:
2026: 21 May Shift 1