CodingSpace

[HackerRank/SQL] Revising Aggregations - Averages 본문

HackerRank/SQL

[HackerRank/SQL] Revising Aggregations - Averages

개발자_조이킴 2022. 7. 12. 09:03

Problem. Revising Aggregations - Averages


Link.

https://www.hackerrank.com/challenges/revising-aggregations-the-average-function/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign

 

Revising Aggregations - The Sum Function | HackerRank

Query the total population of all cities for in the District of California.

www.hackerrank.com


Description.

Query the average population of all cities in CITY where District is California.

 

CITY 테이블


Key Point. 

SELECT,

 

AVG,

 

WHERE,


My Answer. 

SELECT AVG(POPULATION)
FROM CITY
WHERE DISTRICT = "California";

References. 

 

Comments