Japan Population
select sum(population)
from city
where Countrycode = 'JPN'
The Blunder
select ceil(avg(salary) - (select avg(replace(salary, 0, '')) from employees))
from employees
Weather Observation Station 2
select round(sum(lat_n), 2), round(sum(long_w), 2)
from station
Weather Observation Station 13
select round(sum(lat_n), 4)
from station
where 38.7880 < lat_n and lat_n < 137.2345
Weather Observation Station 14
select round(max(lat_n), 4)
from station
where lat_n < 137.2345
Weather Observation Station 16
select round(min(lat_n), 4)
from station
where 38.778 < lat_n
Weather Observation Station 17
select round(long_w, 4)
from station
where lat_n = (select min(lat_n)
from station
where lat_n > 38.7780)
Weather Obseravation Station 18
select round((c-a) + (d-b), 4)
from
(select min(lat_n) as a,
min(long_w) as b,
max(lat_n) as c,
max(long_w) as d
from station) t1
Weather Observation Station 19
select round(sqrt(power((b-a),2) + power((d-c),2)),4)
from
(select min(lat_n) as a,
max(lat_n) as b,
min(long_w) as c,
max(long_w) as d
from station) as t1
(문제 출처 - https://www.hackerrank.com/domains/sql)
'섭섭의 공부 > SQL' 카테고리의 다른 글
[22.02.09] HackerRank 문제 풀이 (0) | 2022.02.09 |
---|---|
[22.02.08] HackerRank 문제 풀이 (0) | 2022.02.08 |
[22.01.16] HackerRank 문제 풀이 (0) | 2022.01.16 |
[22.01.15] HackerRank 문제 풀이 (0) | 2022.01.15 |
[22.01.12] HackerRank 문제 풀이 (0) | 2022.01.12 |