--5. 查询工资高于平均工资的员工姓名、工资、所在部门名称。基于数据库
时间: 2024-05-22 17:16:05 浏览: 223
查询大于部门总平均工资的部门-oracle 经典sql
SELECT e.name, e.salary, d.name AS department
FROM employee e
JOIN department d ON e.department_id = d.id
WHERE e.salary > (SELECT AVG(salary) FROM employee)
ORDER BY e.salary DESC;
阅读全文