#1.查询公司员工工资的最大值,最小值,平均值,总和
SELECT
MAX(salary),MIN(salary),ROUND(AVG(salary),2),SUM(salary)
FROM
employees;
#2.查询员工表中的最大入职时间和最小入职时间的相差天数 (datediff函数)
SELECT DATEDIFF(MAX(hiredate),MIN(hiredate)) AS 相差天数 FROM employees;
#3.查询部门编号为90的员工个数
SELECT
COUNT(*) AS 个数
FROM
employees
WHERE
department_id = 90;