一、原题
二、题目翻译
三、题目解析
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 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.移除表中所有行,并且删除的行不可以回滚。
在SALES表上没有其它未提交的事务。
关于DELETE语句哪句话是正确的?
A.如果表中有主键则不能移除行。
B.移除表中所有行及表结构。
C.移除表中所有行,并且删除的行可以回滚。
D.移除表中所有行,并且删除的行不可以回滚。
三、题目解析
DELETE FROM sales; 语句,
1.没有where子句,所以是删除表中所有的行数据。
2.delete是DML语句,在执行的时候,会记录undo信息,而且这里没有commit,所以可以用rollback回滚。
1.没有where子句,所以是删除表中所有的行数据。
2.delete是DML语句,在执行的时候,会记录undo信息,而且这里没有commit,所以可以用rollback回滚。