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
- 입문
- 추천시스템
- DFS
- eda
- MySQL
- 나는리뷰어다
- Segmentation
- Semantic Segmentation
- TEAM-EDA
- TEAM EDA
- 스택
- 나는 리뷰어다
- 튜토리얼
- 알고리즘
- 프로그래머스
- Python
- Machine Learning Advanced
- 큐
- 엘리스
- DilatedNet
- 파이썬
- pytorch
- Object Detection
- 3줄 논문
- Image Segmentation
- hackerrank
- 한빛미디어
- Recsys-KR
- 협업필터링
- 코딩테스트
Archives
- Today
- Total
TEAM EDA
[HackerRank] Basic Aggregation : Revising Aggregations 본문
Input Format
The CITY table is described as follows:
Q1. Query the total population of all cities in CITY where Districtis California.
SELECT SUM(POPULATION) FROM CITY
WHERE DISTRICT = 'California'
Q2. Query the average population of all cities in CITY where District is California.
SELECT AVG(POPULATION) FROM CITY
WHERE DISTRICT = 'California'
Q3. Query the average population for all cities in CITY, rounded down to the nearest integer.
SELECT FLOOR(AVG(POPULATION)) FROM CITY
Q4. Query the sum of the populations for all Japanese cities in CITY. The COUNTRYCODE for Japan is JPN.
SELECT SUM(POPULATION) FROM CITY
WHERE COUNTRYCODE = 'JPN'
Q5. Query the difference between the maximum and minimum populations in CITY.
SELECT MAX(POPULATION) - MIN(POPULATION) FROM CITY
'EDA Study > SQL' 카테고리의 다른 글
[HackerRank] Basic Aggregation : Top Earners (0) | 2021.02.09 |
---|---|
[HackerRank] Basic Aggregation : The Blunder (0) | 2021.02.09 |
[HackerRank] Basic Join : Top Competitors (0) | 2021.02.08 |
[HackerRank] Basic Join : The Report (2) | 2021.02.08 |
[HackerRank] Basic Join : Average Population of Each Continent (0) | 2021.02.08 |