85. Employee Salary
A company stores employee details in an Employees table. After a performance review, the HR team decided to give a salary hike to employees working in a specific department.
Table: Employees
โโโโโโโโโโโโโโโฆโโโโโโโโโโโ โ Column Name โ Type โ โ โโโโโโโโโโโโโโฌโโโโโโโโโโโฃ โ employee_id โ int โ โโโโโโโโโโโโโโโผโโโโโโโโโโโ โ name โ varchar โ โโโโโโโโโโโโโโโผโโโโโโโโโโโ โ department โ varchar โ โโโโโโโโโโโโโโโผโโโโโโโโโโโ โ salary โ int โ โโโโโโโโโโโโโโโฉโโโโโโโโโโโ
- employee_id is the primary key.
- Each row represents one employee.
Existing Data
โโโโโโโโโโโโโโโฆโโโโโโโโโโโฆโโโโโโโโโโโโโโฆโโโโโโโโโโโ โ employee_id โ name โ department โ salary โ โ โโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโฃ โ 1 โ Aarav โ Engineering โ 70000 โ โโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโ โ 2 โ Neha โ HR โ 50000 โ โโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโ โ 3 โ Rohan โ Engineering โ 80000 โ โโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโ โ 4 โ Meera โ Finance โ 65000 โ โโโโโโโโโโโโโโโฉโโโโโโโโโโโฉโโโโโโโโโโโโโโฉโโโโโโโโโโโ
Increase the salary of all employees in the Engineering department by 10,000. Only employees belonging to Engineering should be updated.
Example 1:
Output (After Update)
โโโโโโโโโโโโโโโฆโโโโโโโโโโโฆโโโโโโโโโโโโโโฆโโโโโโโโโโโ โ employee_id โ name โ department โ salary โ โ โโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโฃ โ 1 โ Aarav โ Engineering โ 80000 โ โโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโ โ 2 โ Neha โ HR โ 50000 โ โโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโ โ 3 โ Rohan โ Engineering โ 90000 โ โโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโ โ 4 โ Meera โ Finance โ 65000 โ โโโโโโโโโโโโโโโฉโโโโโโโโโโโฉโโโโโโโโโโโโโโฉโโโโโโโโโโโ
Still unsure what the problem is asking ?
Letโs go through a few more examples, step by step, to make it clearer.