## 查询表有多少条记录
SELECT COUNT(*) AS num  FROM emp;
## 查询年龄大于40人员数量
SELECT COUNT(*) FROM emp WHERE age>40;
# sum()：求和
SELECT SUM(age) FROM emp
# avg(): 计算平均数
SELECT AVG(age) FROM emp
## 把平均数值小数点后面位数
SELECT AVG(age) AS avgnum FROM emp
#cast转换类型
SELECT CAST(AVG(age) AS DECIMAL(10,2)) AS avgnum FROM emp
#最大值和最小值
SELECT MAX(age) FROM emp;
SELECT MIN(age) FROM emp;

