Skip to content

Commit ca04c92

Browse files
committed
更新了SQL代码
1 parent 00a3941 commit ca04c92

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Day36-40/code/HRS_create_and_init.sql

+7-6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dno int comment '所在部门编号',
3232
primary key (eno)
3333
);
3434

35+
alter table tb_emp add constraint fk_emp_mgr foreign key (mgr) references tb_emp (eno);
3536
alter table tb_emp add constraint fk_emp_dno foreign key (dno) references tb_dept (dno);
3637

3738
insert into tb_emp values
@@ -51,22 +52,22 @@ insert into tb_emp values
5152
(3588, '朱九真', '会计', 5566, 2500, null, 10);
5253

5354

54-
-- 查询月薪最高的员工姓名和工资
55+
-- 查询月薪最高的员工姓名和月薪
5556

5657
-- 查询员工的姓名和年薪((月薪+补贴)*13)
5758

5859
-- 查询有员工的部门的编号和人数
5960

6061
-- 查询所有部门的名称和人数
6162

62-
-- 查询月薪最高的员工(Boss除外)的姓名和工资
63+
-- 查询月薪最高的员工(Boss除外)的姓名和月薪
6364

64-
-- 查询薪水超过平均薪水的员工的姓名和工资
65+
-- 查询薪水超过平均薪水的员工的姓名和月薪
6566

66-
-- 查询薪水超过其所在部门平均薪水的员工的姓名、部门编号和工资
67+
-- 查询薪水超过其所在部门平均薪水的员工的姓名、部门编号和月薪
6768

68-
-- 查询部门中薪水最高的人姓名、工资和所在部门名称
69+
-- 查询部门中薪水最高的人姓名、月薪和所在部门名称
6970

7071
-- 查询主管的姓名和职位
7172

72-
-- 查询月薪排名4~6名的员工姓名和工资
73+
-- 查询月薪排名4~6名的员工姓名和月薪

0 commit comments

Comments
 (0)