OCP-1Z0-051 补充题库 第42题 DROP TABLE命令的影响

来源:互联网 发布:少女前线数据库 编辑:程序博客网 时间:2024/05/23 11:21
一、原题
You issue the following command to drop the PRODUCTS table:
SQL>DROP TABLE products;
What is the implication of this command? (Choose all that apply.)
A. All data in the table are deleted but the table structure will remain
B. All data along with the table structure is deleted
C. All views and synonyms will remain but they are invalidated

D. The pending transaction in the session is committed
E. All indexes on the table will remain but they are invalidated

答案: B,C,D

二、题目翻译
PRODUCTS表执行drop table products;命令,
这个命令执行后会发生什么结果?
A.所有的数据都被删除,但表结构会被保留。
B.所有的数据和表结构都被删除了。
C.所有的和这张表相关的视图和同义词会被保留,但是已经失效了。
D.在这个会话中,没提交的事务会被提交。
E.这张表相关的索引会被保留,但是已经失效了。

三、题目解析
1.drop命令是删除表,不光是数据,表结构也删除了。
2.基于这张表的索引会被删除,但是视图和同义词会被保留,详细可查看联机文档,关于drop table 的说明:
        http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9003.htm#SQLRF01806
        If the table is a base table for a view, a container or master table of a materialized view, or if it is referenced in a stored procedure, function, or package, then the database invalidates these dependent objectsbut does not drop them. You cannot use these objects unless you re-create the table or drop and re-create the objects so that they no longer depend on the table.

        All table indexes and domain indexes are dropped, as well as any triggers defined on the table, regardless of who created them or whose schema contains them. If table is partitioned, then any corresponding local index partitions are also dropped.

3.drop table 是DDL语句,DDL语句会提交没有提交的事务。


0 0
原创粉丝点击