Revising Aggregations - Averages
https://www.hackerrank.com/challenges/revising-aggregations-the-average-function/problem
SELECT AVG(population)
FROM CITY
WHERE District = "California"
Revising Aggregations - The Sum Function
https://www.hackerrank.com/challenges/revising-aggregations-sum/problem
SELECT SUM(population)
FROM CITY
WHERE District = "California"
Revising Aggregations - The Count Function
https://www.hackerrank.com/challenges/revising-aggregations-the-count-function/problem
SELECT COUNT(COUNTRYCODE)
FROM CITY
WHERE POPULATION > 100000
Weather Observation Station 4
https://www.hackerrank.com/challenges/weather-observation-station-4/problem
SELECT COUNT(CITY) - COUNT(DISTINCT CITY)
FROM STATION
Top Earners
https://www.hackerrank.com/challenges/earnings-of-employees/problem
SELECT salary * months AS earnings , COUNT(*)
FROM Employee
GROUP BY earnings
ORDER BY earnings DESC
LIMIT 1
Japan Population
https://www.hackerrank.com/challenges/japan-population/problem
SELECT SUM(POPULATION)
FROM CITY
WHERE COUNTRYCODE='JPN'
Weather Observation Station 13
https://www.hackerrank.com/challenges/weather-observation-station-13/problem
SELECT TRUNCATE(SUM(LAT_N),4)
FROM STATION
WHERE LAT_N>=38.7880 AND LAT_N<=137.2345
Weather Observation Station 3
https://www.hackerrank.com/challenges/weather-observation-station-3/problem
SELECT CITY
FROM STATION
WHERE ID%2=0
GROUP BY CITY
'기존학습자료 > leetcode, hackerrank' 카테고리의 다른 글
해커랭크 - INNER JOIN, LEFT JOIN (0) | 2023.06.25 |
---|---|
해커랭크 - 올림/내림/반올림, 절대값/제곱/제곱근 (0) | 2023.06.25 |
해커랭크 - The Report (SELECT + CASE) (0) | 2023.06.25 |
해커랭크 - Challenges (0) | 2023.06.25 |
해커랭크 - Top earners (0) | 2023.06.25 |