p24 今日内容
p25 DQL_排序查询
-- 排序查询
SELECT * FROM student ORDER BY math ASC; -- 默认是升序
SELECT * FROM student ORDER BY math DESC;
SELECT * FROM student ORDER BY math DESC,english ASC;
p26 DQL_聚合函数
-- 聚合函数
SELECT COUNT(english) FROM student;
SELECT COUNT(IFNULL(english,0)) FROM student;
SELECT COUNT(id) FROM student;
SELECT MAX(math) FROM student;
SELECT MIN(math) FROM student;
SELECT SUM(english) FROM student;
SELECT AVG(math) FROM student;