OCP-1Z0-051 第167题 DELETE语句注意事项

一、原题
Evaluate the following DELETE statement:
DELETE FROM sales;
There are no other uncommitted transactions on the SALES table.
Which statement is true about the DELETE statement?
A. It would not remove the rows if the table has a primary key.
B. It removes all the rows as well as the structure of the table.
C. It removes all the rows in the table and deleted rows can be rolled back.
D. It removes all the rows in the table and deleted rows cannot be rolled back.

答案:C

二、题目翻译
评估下面的DELETE语句:
在SALES表上没有其它未提交的事务。
关于DELETE语句哪句话是正确的?
A.如果表中有主键则不能移除行。
B.移除表中所有行及表结构。
C.移除表中所有行,并且删除的行可以回滚。
D.移除表中所有行,并且删除的行不可以回滚。

三、题目解析
DELETE FROM sales; 语句,
1.没有where子句,所以是删除表中所有的行数据。
2.delete是DML语句,在执行的时候,会记录undo信息,而且这里没有commit,所以可以用rollback回滚。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值