Conditional Bonus Calculation
Pay a 10% bonus to employees in department 1 and 5% to everyone else, but 0 for employees whose name starts with 'M'. Return name and bonus rounded to two decimals, ordered by name.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(50), department_id INT, salary INT)Sample data
id | name | department_id | salary
1 | Alice | 1 | 1000
2 | Mark | 1 | 2000
3 | Zed | 2 | 1000
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.