일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 딥러닝
- dl
- Numpy
- boj
- PPMI
- backward
- Heap
- affine
- FullyConnectedLayer
- 자연어처리
- SQL
- MySQL
- Word2vec
- hash
- 신경망
- Stack
- stak
- Sigmoid
- skip-gram
- select
- algorithm
- 프로그래머스
- que
- kakao
- Python
- CBOW
- DeepLearning
- sort
- 파이썬
- Programmers
Archives
- Today
- Total
혜온의 이것저것
[HackerRank] Average Population of Each Continent (MySQL) 본문
Data Analysis/SQL
[HackerRank] Average Population of Each Continent (MySQL)
혜온 :) 2022. 8. 29. 15:19https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true
Average Population of Each Continent | HackerRank
Query the names of all continents and their respective city populations, rounded down to the nearest integer.
www.hackerrank.com
문제
Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.
Note: CITY.CountryCode and COUNTRY.Code are matching key columns.
Input Format
The CITY and COUNTRY tables are described as follows:
![](https://blog.kakaocdn.net/dn/4BxDH/btrKQR5l4PW/FP1dJShnkELPS8r2WaqWU1/img.jpg)
![](https://blog.kakaocdn.net/dn/YhGda/btrKJ7g8oVY/zrM1umRh8wnBWKZClwj9GK/img.jpg)
풀이
select c2.continent, floor(avg(c1.population))
from city c1, country c2
where c1.countrycode = c2.code
group by c2.continent
'Data Analysis > SQL' 카테고리의 다른 글
[HackerRank] Top Competitors (MySQL) (0) | 2022.09.06 |
---|---|
[HackerRank] The Report (MySQL) (0) | 2022.08.29 |
[HackerRank] African Cities (MySQL) (0) | 2022.08.29 |
[HackerRank] Population Census (MySQL) (0) | 2022.08.29 |
[HackerRank] Weather Observation Station 20 (MySQL) (0) | 2022.08.22 |
Comments