2023/06 32

해커랭크 - 올림/내림/반올림, 절대값/제곱/제곱근

* CEIL - 소수점 첫째 자리에서 올림 * FLOOR - 소수점 첫째 자리에서 내림 * ROUND - 숫자를 각 자리에서 반올림 * TRUNCATE(숫자, 버릴 자릿수) - 숫자를 버릴 자릿수 아래로 버림 * ABS - 절대값 * POWER - 제곱 * SQRT - 양수 x 에 대한 제곱근을 반환 Average Population https://www.hackerrank.com/challenges/average-population/problem SELECT Floor(AVG(population)) FROM CITY Weather Observation Station 2 https://www.hackerrank.com/challenges/weather-observation-station-2/submiss..

해커랭크 - Top earners

Top earners - 서브쿼리 https://www.hackerrank.com/challenges/earnings-of-employees/problem SELECT months*salary as earnings , count(*) FROM employee WHERE months*salary = (SELECT MAX(months*salary) FROM employee) GROUP BY earnings -- Having >>> GROUP BY 결과물을 다시 한 번 필터링 해줄 때 SELECT months*salary AS earnings , count(*) FROM employee GROUP BY earnings HAVING earnings = (SELECT MAX(months*salary) FROM e..