savepiont oracle,PL/SQL Challenge 每日一题:2016-5-13 SAVE POINT

最先答对且答案未经编辑的puber将获得纪念章一枚(答案不可编辑但可发新贴补充或纠正),其他会员如果提供有价值的分析、讨论也可获得纪念章一枚。

每两周的优胜者可获得itpub奖励的技术图书一本。

以往旧题索引:

http://www.itpub.net/forum.php?m ... eid&typeid=1808

原始出处:

http://www.plsqlchallenge.com/

作者:Kim Berg Hansen

运行环境:SQLPLUS, SERVEROUTPUT已打开

注:本题给出答案时候要求给予简要说明才能得到奖品

我有一张员工表,包含每个员工的薪资:

create table plch_employee (

id       integer primary key

, name     varchar2(10)

, salary   number

)

/

insert into plch_employee values (1, 'Zaphod', 1000)

/

commit

/

每个选项包含一系列语句。

哪些选项能成功地执行所有语句不出异常,并且使得执行之后Zaphod的薪资为2000, 因此下列查询会得到所示的输出:

select id, name, salary

from plch_employee

order by id

/

ID NAME           SALARY

---------- ---------- ----------

1 Zaphod           2000

(A)

update plch_employee

set salary = 2000

where id = 1

/

savepoint

/

update plch_employee

set salary = 3000

where id = 1

/

rollback to savepoint

/

(B)

update plch_employee

set salary = 2000

where id = 1

/

savepoint savepoint

/

update plch_employee

set salary = 3000

where id = 1

/

rollback to savepoint savepoint

/

(C)

update plch_employee

set salary = 2000

where id = 1

/

savepoint after_2000

/

update plch_employee

set salary = 3000

where id = 1

/

rollback to savepoint after_2000

/

(D)

update plch_employee

set salary = 2000

where id = 1

/

savepoint after_upd

/

update plch_employee

set salary = 3000

where id = 1

/

savepoint after_upd

/

rollback to after_upd

/

(E)

update plch_employee

set salary = 1500

where id = 1

/

savepoint after_1500

/

update plch_employee

set salary = 2000

where id = 1

/

savepoint after_2000

/

update plch_employee

set salary = 2500

where id = 1

/

savepoint after_2500

/

rollback to after_2000

/

(F)

update plch_employee

set salary = 1500

where id = 1

/

savepoint after_1500

/

update plch_employee

set salary = 2000

where id = 1

/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值