北京优技教育科技有限公司

Oracle认证 OCP认证 OCM认证

当前位置: 优技教育 >> ocp考试 >

ocp题库解析:11g-1Z0-051-第1题

ocp题库解析:11g-1Z0-051-第1题

来源:优技教育    更新时间:2016/7/27 15:03:21    阅读次数:994

ocp题库解析:11g-1Z0-051-第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.

Answer: B

答案解析:

A答案:默认sysdate可以在列出被指定。

sh@TEST0924> CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE) AS

2 SELECT prod_id, cust_id, time_id FROM sales;

Table created.

B答案:NULL约束会传递。由以下可以看出,not null是可以传递的。B正确

C答案:

由A中所见,此表是可以创建的,虽然字段名不一样,但数据库类型一样,就可以创建表。C错误。

D答案:

由B第二种方法看出,仅仅只是传递了not null约束,而SALES_PRODUCT_FK,SALES_CUSTOMER_FK,SALES_TIME_FK这三个外键约束是没有被传递的。

OCA认证
OCP费用
OCP教程
OCP考试
OCM费用
OCM教程
OCM考试
ORACLE授权认证机构CUUG
CUUG与ORACLE合作15年,是ORACLE金牌合作伙伴,连续多年处于行业领先;
CUUG与工信部人才交流中心合作,是工信人才指定的PostgreSQL数据库培训合作伙伴;
CUUG与阿里云、腾讯云、人大金仓、奥星贝斯等众多数据库厂商合作,开设数据库认证与培训课程;
CUUG与企业合作提供人才输送、定制化培训、技术支持服务;

报名入口 点击进入

北京优技教育科技有限公司

联系电话:010-59426307

课程咨询:010-59426319

联系地址:海淀区紫竹院路88号