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.
in MySQL
SELECT CONCAT(total_earnings, ' ', employee_count) AS result
FROM (
SELECT
(Salary * Months) AS total_earnings,
COUNT(*) AS employee_count
FROM Employee
GROUP BY Salary * Months
ORDER BY total_earnings DESC
LIMIT 1
) t;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Top Earners
You are viewing a single comment's thread. Return to all comments →
in MySQL SELECT CONCAT(total_earnings, ' ', employee_count) AS result FROM ( SELECT (Salary * Months) AS total_earnings, COUNT(*) AS employee_count FROM Employee GROUP BY Salary * Months ORDER BY total_earnings DESC LIMIT 1 ) t;