44. View the Exhibit and examine the structure of the ORD table.
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.
创建序列器的时候如果不带任何参数,默认的起始值是1,没有最大值,步长是1、
A:所有语句都能正确执行,CUST_ID 101的ORD_NO的值是2(正确)
B:序列器创建语句不能执行,因为序列器的最小值和最大值没有指定(错误,默认最小值为1,无最大值)
C:序列器创建语句不能执行,因为序列器的起始值和步长没有指定(错误,起始值为1,步长为1)
D:所有语句都能正确执行,CUST_ID 101的ORD_NO的值是20,因为默认的CACHE是20(错误,默认的cache是20,但只是一次性取20个序列到内存中,如果内存崩溃,序列器将会从21开始。)