发布时间 : 星期日 文章sql server实验报告更新完毕开始阅读
13.统计在业务科工作且在1973年或1967年出生的员工人数和平均工资
select count(employeeNo) 人数, avg(salary) 平均工资 from employee
where year(birthday) in('1973', '1967') and department = '业务科'
SQL Server 实验报告(二)
指导老师:韦向远
学生姓名:彭之群 学生学号:3130835238
1. 查询同一天进入公司的员工
select distinct a.employeeNo, a.employeeName, a.hireDate
from employee a, employee b
where a.employeeNo != b.employeeNo and a.hireDate = b.hireDate
2. 查询与“陈诗杰”在同一个工作单位的员工姓名,性别,部门和职务
select a.employeeName 员工姓名, case a.sex when 'M' then '男' when 'F' then '女'
end 性别, a.department 部门, a.headship 职务 from employee a, employee b where a.department = b.department and b.employeeName = '陈诗杰'