We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The problem I was experiencing is that I wasn't casting the SALARY column as FLOAT, so the resulting average for it was 4046, not 4046.75. Once I did AVG(CAST(SALARY AS FLOAT)) when calculating the average salary, I could get the final result right.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Blunder
You are viewing a single comment's thread. Return to all comments →
The problem I was experiencing is that I wasn't casting the SALARY column as FLOAT, so the resulting average for it was 4046, not 4046.75. Once I did AVG(CAST(SALARY AS FLOAT)) when calculating the average salary, I could get the final result right.