2024. Calculate Special Bonus
My accepted SQL solution to LeetCode problem 2024, Calculate Special Bonus, running in 617ms.
- Difficulty: Easy
- SQL
- Runtime 617ms
- Memory 0.0B
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
SQL
Accepted on LeetCode — runtime 617ms, memory 0.0B, accepted 2025-12-31.
SELECT employee_id,
IF(employee_id % 2 = 1 AND name NOT LIKE 'M%', salary, 0) AS bonus
FROM Employees
ORDER BY employee_id