Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
| 29 | 30 | 31 |
Tags
- programmers
- 클라우드컴퓨팅
- hackerrank
- Git
- 온라인협업
- early stopping
- HTML
- coding
- L2정규화
- 교차 엔트로피
- AWS
- branch
- github
- RLIKE
- L1정규화
- window function
- 선형 모형
- 깃헙협업
- CSS
- elastic net
- sql
- 코딩공부
- merge
- PYTHON
- full request
- 버전충돌
- mysql
- conflict
- 편향-분산 교환
- leetcode
Archives
- Today
- Total
Im between cherry
Hackerrank | MySQL | Average Population of Each Continent 본문
데이터분석/practice_query
Hackerrank | MySQL | Average Population of Each Continent
meal 2020. 8. 29. 16:11Average Population of Each Continent
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.
SELECT country.continent, FLOOR(AVG(city.population))
FROM city
LEFT JOIN country ON city.countrycode = country.code
GROUP BY country.continent
HAVING country.continent IS NOT NULL
SELECT COUNTRY.Continent, FLOOR(AVG(CITY.Population))
FROM City
INNER JOIN Country ON CITY.CountryCode = COUNTRY.Code
GROUP BY COUNTRY.Continent
'데이터분석 > practice_query' 카테고리의 다른 글
| Hackerrank | MySQL | Draw The Triangle 2 (0) | 2020.08.29 |
|---|---|
| Hackerrank | MySQL | Draw The Triangle 1 (0) | 2020.08.29 |
| Hackerrank | MySQL | African Cities (0) | 2020.08.29 |
| Hackerrank | MySQL | Asian Population (0) | 2020.08.29 |
| Hackerrank | MySQL | Weather Observation Station 17 (0) | 2020.08.29 |
Comments