What is displayed by the SELECT statement?

Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seql
START WITH 100
INCREMENT BY 10
MAXVALUE 200
CYCLE
NOCACHE;
The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue
the following SQL statement:
SELECT seql.nextval FROM dual;
What is displayed by the SELECT statement?

Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seql
START WITH 100
INCREMENT BY 10
MAXVALUE 200
CYCLE
NOCACHE;
The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue
the following SQL statement:
SELECT seql.nextval FROM dual;
What is displayed by the SELECT statement?

A.
1

B.
10

C.
100

D.
an error



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Bes

Bes

C
A is incorrect.

swiez

swiez

For me the “A” answer is correct. If you “CREATE SEQUENCE seql START WITH 3 INCREMENT BY 1 MAXVALUE 7 CYCLE NOCACHE;” and run “select seql.nextval from dual;” few times, the result after 7 will be 1, not 3.

João Ramos

João Ramos

C is incorrect. When the sequence reaches its max value, the next value will be the MINVALUE specified in the CREATE SEQUENCE command. As you didn’t specify it, default value is 1.