| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- TRUNCATE
- SUM
- hackerrank
- pandas
- MySQL
- Oracle
- GROUPBY
- 프로그래머스
- 결측값
- 데이터리안 웨비나
- having
- 다중 JOIN
- airflow.cfg
- 머신러닝
- Round
- 데이터시각화
- PostgreSQL
- solvesql
- 파이썬
- 데이터분석
- 전처리
- not in
- SQLite
- matplotlib
- join
- 그로스해킹
- SQL
- seaborn
- Limit
- airflow 설치
Archives
- Today
- Total
Milky's note
[HackerRank](E) Revising Aggregations - Averages 본문
Revising Aggregations - Averages | HackerRank
Query the average population of all cities in the District of California.
www.hackerrank.com
[문제]
Query the average population of all cities in CITY where District is California.
Input Format
The CITY table is described as follows:

[답]
-mysql
select round(avg(population),2) from city
where district = 'California'
사실 이 문제는 반올림은 안 해도 되는데 뒤에 2자리로 남기고 싶어서 round를 썼는데
이것도 정답으로 맞게 해주었당
'SQL > SQL 코딩 테스트-HackerRank' 카테고리의 다른 글
| [HackerRank](E) Japan Population (0) | 2022.03.25 |
|---|---|
| [HackerRank](E) Average Population (0) | 2022.03.25 |
| [HackerRank](E) Revising Aggregations - The Sum Function (0) | 2022.03.25 |
| [HackerRank](E) Revising Aggregations - The Count Function (0) | 2022.03.25 |
| [HackerRank](M) Binary Tree Nodes (0) | 2022.03.18 |
Comments