首页 小组 文章 相册 留言本 用户 搜索 我的社区 在线学堂 商城 购物车 支付钱包

[打卡]万物不及桐神1

2024-05-08 14:32:05
0
120

SELECT MAX(salary),MIN(salary),AVG(salary),SUM(salary)
from employees;

SELECT job_id,MAX(salary),MIN(salary),AVG(salary),SUM(salary)
FROM employees
GROUP BY job_id;

SELECT job_id,COUNT(*)
FROM employees
GROUP BY job_id;

SELECT MAX(salary),MIN(salary),MAX(salary)-MIN(salary) difference
FROM employees

SELECT manager_id,MIN(salary)
FROM employees
WHERE manager_id IS NOT NULL
GROUP BY manager_id
HAVING MIN(salary)>=6000;

SELECT department_name,location_id,COUNT(*),AVG(salary)
FROM employees e RIGHT JOIN departments d
ON e.department_id=d.department_id
GROUP BY department_name,location_id
ORDER BY AVG(salary) DESC;

评论
意见反馈