Question: Consider a database with two tables: 'Employees' ( columns: 'EmpID', 'Name', 'Department', 'Salary' ) and 'Departments' ( columns: 'DeptID', 'DeptName', 'ManagerID' ) . You need

Consider a database with two tables: 'Employees' (columns: 'EmpID', 'Name', 'Department', 'Salary') and 'Departments' (columns: 'DeptID', 'DeptName', 'ManagerID'). You need to update the 'Salary' of all employees by 5% who work under a manager whose salary is greater than $50,000. Which of the following SQL queries correctly performs this operation?
Group of answer choices
UPDATE Employees SET Salary = Salary *1.05 WHERE EXISTS (SELECT * FROM Departments WHERE ManagerID = EmpID AND Salary >50000)
UPDATE Employees E SET E.Salary = E.Salary *1.05 FROM Departments D WHERE E.Department = D.DeptName AND D.ManagerID IN (SELECT EmpID FROM Employees WHERE Salary >50000)
UPDATE Employees SET Salary = Salary *1.05 WHERE EmpID IN (SELECT ManagerID FROM Departments WHERE Salary >50000)
UPDATE Employees SET Salary = Salary *1.05 WHERE Department IN (SELECT DeptName FROM Departments WHERE ManagerID IN (SELECT EmpID FROM Employees WHERE Salary >50000))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!