Here is the solution (MySQL) for Hackerrank challenge The Blunder
SELECT CEIL((AVG(salary)) - (AVG(REPLACE(salary, '0', '')))) AS avg_salary FROM employees;
- REPLACE() : used to remove 0 from salary.
- AVG() : used to calculate average salary.
- CEIL() : used to get next rounded integer.