急急急!!!!考试题目,求助啊~~~~PL/SQL

来源:百度知道 编辑:UC知道 时间:2024/06/04 16:15:08
1.设计一个函数,给定员工的编号,返回该员工所应交纳的税。计算税的公式如下:
Sal<2000 tax=sal*10%
2000<=Sal<=4000 tax=sal*15%
Sa>4000 tax=sal*20%
写一个匿名块调用该函数。(50分)

2.设计一个过程,将给定部门名称的员工sal增加100元。写一个匿名块调用该过程。(50分)

PL/SQL块结构自己写,只说关键的
1 begin
select
(case sal<2000 then sal*.1
case sal>=2000 and sal <=4000 then sal*.15
case sal>4000 then sal*.2) into tax......;
return tax;
2 begin
update sal所在表名 set sal=sal+100 where.....;
commit;
......代表查询条件