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 3

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


Bes

Bes

A is wrong;

C is correct.

Sue

Sue

No A is right. I just checked:
NEXTVAL
———-
190

SQL> /

NEXTVAL
———-
200

SQL> /

NEXTVAL
———-
1

Tejash

Tejash

A is correct as MINVALUE is not provided, so by default MINVALUE is 1 and whenever sequence reaches to its MAXVALUE and cycle option is enabled, it gives MINVALUE as its next number.