OCP—051试题

FROM:

http://blog.itpub.net/26736162/viewspace-1252569/?page=2

http://blog.csdn.net/elearnings/article/details/10103611

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:

Which statement is true regarding the above command? (B)


CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE) AS

SELECT prod_id, cust_id, time_id FROM sales;

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.


CREATE TABLE T2

(

Col1 NUMBER(2) PRIMARY KEY,

Col2 VARCHAR2(10)

);

CREATE TABLE T3 AS SELECT * FROM T2;

隐式声明的NOT NULL约束(例如主键的NOT NULL约束)不会继承。

(上面的例子能说明能说明这点?)

Creating a Table Using a Subquery

Create a table and insert rows by combining the CREATE

TABLE statement and the AS subquery option.

CREATE TABLE table

[(column, column...)]

AS subquery;

Match the number of specified columns to the number of subquery columns.

Define columns with column names and default values.

Guidelines

The table is created with the specified column names, and the rows retrieved by the

SELECT statement are inserted into the table.

The column definition can contain only the column name and default value.

If column specifications are given, the number of columns must equal the number of

columns in the subquery SELECT list.

If no column specifications are given, the column names of the table are the same as the column

names in the subquery.

The column data type definitions and the NOT NULL constraint are passed to(被传递) the new table.

Note that only the explicit(显式的) NOT NULL constraint will be inherited. The PRIMARY KEY column will

not pass the NOT NULL feature to the new column. Any other constraint rules are not passed to

the new table. However, you can add constraints in the column definition.

时间: 2024-10-11 01:00:45

OCP—051试题的相关文章

051 题库

序号 OCP 051题库 1 :  OCP-1Z0-051 第1题 CTAS语句建表注意事项 2 :  OCP-1Z0-051 第2题 视图的WITH CHECK OPTION选项 3 :  OCP-1Z0-051 第3题 转义字符 4 :  OCP-1Z0-051 第4题 单行函数 5 :  OCP-1Z0-051 第5题 to_char的数字的格式 6 :  OCP-1Z0-051 第6题 case when和decode的用法 7 :  OCP-1Z0-051 第7题 ON和USING子句

Oracle OCP 11G 051(61题版本)答案解析目录

Oracle OCP 11G 051(61题版本)答案解析目录 61题版本 V9.02 1 http://blog.csdn.net/rlhua/article/details/17635843 2  http://blog.csdn.net/rlhua/article/details/17635887 3 http://blog.csdn.net/rlhua/article/details/17635919 86 4 http://blog.csdn.net/rlhua/article/det

OCP试题解析之053-17 CONFIGURE CONTROLFILE AUTOBACKUP ON

17.You configure AUTOBACKUP to ON in an RMAN session. When will RMAN back up the control file? (Choose all that apply.) A. When you run an RMAN BACKUP command B. When you run an RMAN ALLOCATE command C. When you add or drop a table in the SYSTEM tabl

OCP试题解析之052-- DROP PROFILE app_user

133.You created a profile APP_USER and assigned it to the users. After a month, you decide to drop the profile. Some user sessions are currently connected to the database instance and are using the APP_USER profile. This command is used to drop the p

OCP试题解析之053-61 RMAN set command id to

61.You frequently have multiple RMAN sessions running, and you want to be able to easily identify each job via the CLIENTJNFO column of the dynamic performance view V$SESSION. What RMAN command can you run to set the value for this column? A. set cli

OCP试题解析之053-16 MEMORY_TARGET

16.Setting which of the following initialization parameters enables Automatic Memory Management? A. MEMORYJARGET B. MEMORY_MAX_TARGET C. SGATARGET D. PGA AGGREGATE TARGET Answer: A [解析] 11g中新增MEMORY_MAX_TARGET参数,此参数一出现就如在10g中第一次出现SGA_MAX_SIZE参数一样给人以耳

OCP试题

SQL Code 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100   2. View the Exhibit toexamine the description 

OCP准备记录

0628: 051 OK053 1-192! 加油了,每天至少100道吧明天复习一下626,627,628这几天的成果先看一遍对的,再看一遍错的!!最少要把051复习一遍 0629: 今天忙了太久 只看了051前两页的错题! 明天任务: 051后几页的错题. 053所有的错题. OCP准备记录,布布扣,bubuko.com

Linux运维MySQL必会面试题100道

老男孩教育Linux运维班MySQL必会面试题100道 (1)基础笔试命令考察 (要求:每两个同学一组,一个口头考,一个上机实战作答,每5个题为一组,完成后换位) 1.开启MySQL服务 2.检测端口是否运行 3.为MySQL设置密码或者修改密码. 4.登陆MySQL数据库. 5.查看当前数据库的字符集 6.查看当前数据库版本 7.查看当前登录的用户. 8.创建GBK字符集的数据库oldboy,并查看已建库完整语句 9.创建用户oldboy,使之可以管理数据库oldboy 10.查看创建的用户o