일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- sort
- 프로그래머스
- Python
- kakao
- stak
- Programmers
- Word2vec
- 딥러닝
- 신경망
- hash
- SQL
- DeepLearning
- Sigmoid
- Heap
- backward
- MySQL
- 파이썬
- affine
- 자연어처리
- que
- boj
- FullyConnectedLayer
- dl
- Stack
- CBOW
- PPMI
- Numpy
- select
- skip-gram
- algorithm
Archives
- Today
- Total
혜온의 이것저것
[HackerRank] Weather Observation Station 20 (MySQL) 본문
https://www.hackerrank.com/challenges/weather-observation-station-20/problem?isFullScreen=true
문제
A median is defined as a number separating the higher half of a data set from the lower half. Query the median of the Northern Latitudes (LAT_N) from STATION and round your answer to 4 decimal places.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
풀이
set @r=0;
select round(avg(lat_n),4)
from (select (@r:=@r+1) as r, lat_n from station order by lat_n) s
where
r=(select ceil(count(*)/2)from station) or
r=(select floor(count(*)/2+1) from station)
'Data Analysis > SQL' 카테고리의 다른 글
[HackerRank] African Cities (MySQL) (0) | 2022.08.29 |
---|---|
[HackerRank] Population Census (MySQL) (0) | 2022.08.29 |
[HackerRank] Weather Observation Station 19 (MySQL) (0) | 2022.08.22 |
[HackerRank] Weather Observation Station 18 (MySQL) (0) | 2022.08.22 |
[HackerRank] Weather Observation Station 17 (MySQL) (0) | 2022.08.16 |
Comments