본문 바로가기

Algorithm/MySQL

[해커랭크(Hacker Rank)] Revising Aggregations - Averages (MySQL)

문제

Query the average population of all cities in CITY where District is California.
Input Format
The CITY table is described as follows: 

 

코드

SELECT AVG(population)
FROM city
WHERE district = 'California'

 

풀이

  1. population의 평균 구하기
  2. district는 California

 

출처

반응형