HackerRank MySQL - The Blunder


Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not realize her keyboard's key was broken until after completing the calculation. She wants your help finding the difference between her miscalculation (using salaries with any zeroes removed), and the actual average salary.

  1. SELECT CEIL(AVG(SALARY) - AVG(REPLACE(SALARY, '0', '')))
  2. FROM EMPLOYEES;

download android app