INSERT INTO city VALUES(1,'上海',2018,32679,2418);
INSERT INTO city VALUES(2,'北京',2018,30320,2171);
INSERT INTO city VALUES(3,'深圳',2018,24691,1253);
INSERT INTO city VALUES(4,'廣州',2018,23000,1450);
INSERT INTO city VALUES(5,'重慶',2018,20363,3372);
INSERT INTO city VALUES(6,'上海',2019,38155,2424);
INSERT INTO city VALUES(7,'北京',2019,35371,2171);
INSERT INTO city VALUES(8,'深圳',2019,26927,1302);
INSERT INTO city VALUES(9,'廣州',2019,23628,1491);
INSERT INTO city VALUES(10,'重慶',2019,23605,3372);
COUNT
查詢計(jì)算2019年一共有多少個(gè)城市錄入數(shù)據(jù)(答案 5個(gè))
SELECT COUNT(*) FROM city WHERE city_year = '2019';
MAX
查詢 2018年里 GDP 最高是多少;
SELECT MAX(city_gdp) FROM city WHERE city_year = '2018';
MIN
查詢 2018年里 GDP 最低是多少;
SELECT MIN(city_gdp) FROM city WHERE city_year = '2018';
SUM
查詢2019年里所有城市 GDP 總和;
SELECT SUM(city_gdp) FROM city WHERE city_year = '2019';
AVG
查詢2019年所有城市 GDP 平均值;
SELECT AVG(city_gdp) FROM city WHERE city_year = '2019';