1Z0-051 QUESTION 1 利用CREATE TABLE AS创建表
2014-05-06 22:50
387 查看
QUESTION 1
View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES
tables.
The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the
CUSTOMERS and TIMES tables, respectively.
Evaluate the following CREATE TABLE command:
CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE)
AS
SELECT prod_id, cust_id, time_id
FROM sales;
Which statement is true regarding the above command?
A. The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the
column definition.
B. The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified
columns would be passed to the new table.
C. The NEW_SALES table would not get created because the column names in the CREATE TABLE
command and the SELECT clause do not match.
D. The NEW_SALES table would get created and all the FOREIGN KEY constraints defined on the
specified columns would be passed to the new table.
答案:B
解析:
首先,新表是可以创建成功的,排除了AC,而BD中,在使用CREATE TABLE AS创建表时会把NOT NULL约束带到新表,而主键,唯一,外键,check约束,分区,索引以及列的默认值不会带到新表。
可参考oracle联机文档CREATETABLE 的 AS subquery :
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_7002.htm#SQLRF54626
View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES
tables.
The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the
CUSTOMERS and TIMES tables, respectively.
Evaluate the following CREATE TABLE command:
CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE)
AS
SELECT prod_id, cust_id, time_id
FROM sales;
Which statement is true regarding the above command?
A. The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the
column definition.
B. The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified
columns would be passed to the new table.
C. The NEW_SALES table would not get created because the column names in the CREATE TABLE
command and the SELECT clause do not match.
D. The NEW_SALES table would get created and all the FOREIGN KEY constraints defined on the
specified columns would be passed to the new table.
答案:B
解析:
首先,新表是可以创建成功的,排除了AC,而BD中,在使用CREATE TABLE AS创建表时会把NOT NULL约束带到新表,而主键,唯一,外键,check约束,分区,索引以及列的默认值不会带到新表。
可参考oracle联机文档CREATETABLE 的 AS subquery :
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_7002.htm#SQLRF54626
相关文章推荐
- OCP 1Z0 051 QUESTION NO: 5
- OCP 1Z0 051 QUESTION NO: 26
- OCP 1Z0 051 QUESTION NO: 48
- 1Z0-051 QUESTION 8 子查询和JION的用法
- 1Z0-051 QUESTION 11 运算顺序
- OCP 1Z0 051 QUESTION NO: 6
- OCP 1Z0 051 QUESTION NO: 27
- OCP 1Z0 051 QUESTION NO: 37
- OCP 1Z0 051 QUESTION NO: 49
- OCP 1Z0 051 QUESTION NO: 56
- 1Z0-051 QUESTION 4 单行函数Single-Row Functions
- 1Z0-051 QUESTION 21 LONG数据类型应该注意的地方
- 1Z0-051 QUESTION 26 table的命名规则
- OCP 1Z0 051 QUESTION NO: 7
- OCP 1Z0 051 QUESTION NO: 28
- OCP 1Z0 051 QUESTION NO: 50
- OCP 1Z0 051 QUESTION NO: 57
- 1Z0-051 QUESTION 9 关于INTERSECT的用法
- 1Z0-051 QUESTION 27 table的命名规则
- OCP 1Z0 051 QUESTION NO: 8