집계함수까지는 식은 죽 먹기다.
Revising Aggregations - Averages
select avg(population)
from city
where district = "california"
Query the total population of all cities in CITY where District is California.
select sum(population)
from city
where district = "california"
Query a count of the number of cities in CITY having a Population larger than 100,000.
select count(name)
from city
where population > 100000
Query the average population for all cities in CITY, rounded down to the nearest integer.
select floor(avg(population))
from city
Query the difference between the maximum and minimum populations in CITY.
select max(population) - min(population)
from city
Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table.
The STATION table is described as follows:
select count(city) - count(distinct city)
from station