OCP-1Z0-051 第44题 SEQUENCE的缺省值
2014-05-06 14:25
239 查看
一、原题
View the Exhibit and examine the structure of the ORD table.
Evaluate the following SQL statements that are executed in a user session in the specified order:
CREATE SEQUENCE ord_seq;
SELECT ord_seq.nextval
FROM dual;
INSERT INTO ord
VALUES (ord_seq.CURRVAL, '25-jan-2007',101);
UPDATE ord
SET ord_no= ord_seq.NEXTVAL
WHERE cust_id =101;
What would be the outcome of the above statements?
A. All the statements would execute successfully and the ORD_NO column would contain the value 2 for the CUST_ID 101.
B. The CREATE SEQUENCE command would not execute because the minimum value and maximum value for the sequence have not been specified.
C. The CREATE SEQUENCE command would not execute because the starting value of the sequence and the increment value have not been specified.
D. All the statements would execute successfully and the ORD_NO column would have the value 20 for the CUST_ID 101 because the default CACHE value is 20.
答案:A
二、题目翻译
查看ORD表结构
按顺序执行下面的SQL语句:
上面语句执行后的结果是什么?
A. 所有语句执行成功,对于CUST_ID为101的ORD_NO列的值为2。
B. CREATE SEQUENCE命令不能执行,因为没有指定最大值和最小值。
C. CREATE SEQUENCE命令不能执行,因为起始值和步长值没有指定。
D. 所有语句执行成功,对于CUST_ID为101的ORD_NO列的值为20,因为CACHE默认为20。
三、题目解析
CREATE SEQUENCE时可以省略所有参数,默认起始值为1,步长为1,无上限。
关于D选项,CACHE关键字:
如果建立序列时不指定CACHE和NOCACHE,默认值为CACHE 20,即一次性从序列里取20个数放入内存,如果内存崩溃,则这20个数就会丢失,再取值时从第21个数开始取值,CACHE设置的最小值为2。
View the Exhibit and examine the structure of the ORD table.
Evaluate the following SQL statements that are executed in a user session in the specified order:
CREATE SEQUENCE ord_seq;
SELECT ord_seq.nextval
FROM dual;
INSERT INTO ord
VALUES (ord_seq.CURRVAL, '25-jan-2007',101);
UPDATE ord
SET ord_no= ord_seq.NEXTVAL
WHERE cust_id =101;
What would be the outcome of the above statements?
A. All the statements would execute successfully and the ORD_NO column would contain the value 2 for the CUST_ID 101.
B. The CREATE SEQUENCE command would not execute because the minimum value and maximum value for the sequence have not been specified.
C. The CREATE SEQUENCE command would not execute because the starting value of the sequence and the increment value have not been specified.
D. All the statements would execute successfully and the ORD_NO column would have the value 20 for the CUST_ID 101 because the default CACHE value is 20.
答案:A
二、题目翻译
查看ORD表结构
按顺序执行下面的SQL语句:
上面语句执行后的结果是什么?
A. 所有语句执行成功,对于CUST_ID为101的ORD_NO列的值为2。
B. CREATE SEQUENCE命令不能执行,因为没有指定最大值和最小值。
C. CREATE SEQUENCE命令不能执行,因为起始值和步长值没有指定。
D. 所有语句执行成功,对于CUST_ID为101的ORD_NO列的值为20,因为CACHE默认为20。
三、题目解析
CREATE SEQUENCE时可以省略所有参数,默认起始值为1,步长为1,无上限。
关于D选项,CACHE关键字:
如果建立序列时不指定CACHE和NOCACHE,默认值为CACHE 20,即一次性从序列里取20个数放入内存,如果内存崩溃,则这20个数就会丢失,再取值时从第21个数开始取值,CACHE设置的最小值为2。
相关文章推荐
- OCP-1Z0-051 第45题 SEQUENCE(序列)的注意事项
- OCP-1Z0-051 补充题库 第44题 NATURAL JOIN自然连接
- OCP-1Z0-051 补充题库 第21题 SEQUENCE序列注意事项
- OCP-1Z0-051-V9.02-40题
- OCP-1Z0-051-V9.02-64题
- OCP-1Z0-051-V9.02-77题
- OCP-1Z0-051-V9.02-127题
- OCP-1Z0-051-V9.02-140题
- OCP-1Z0-051-V9.02-168题
- OCP-1Z0-051-V9.02-27题
- OCP-1Z0-051-V9.02-130题
- OCP-1Z0-新051-61题版本-4
- OCP-1Z0-新051-61题版本-20
- OCP-1Z0-新051-61题版本-34
- OCP-1Z0-新051-61题版本-46
- OCP-1Z0-051-2015-43题
- OCP-1Z0-051-2015-56题
- OCP-1Z0-051 第30题 主外键约束,check约束
- OCP-1Z0-051 第35题 主外键规则
- OCP-1Z0-051 第75题 ROUND和RPAD函数