What is displayed by the SELECT statement?

Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seq1
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 seq1.nextval FROM dual;
What is displayed by the SELECT statement?

Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seq1
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 seq1.nextval FROM dual;
What is displayed by the SELECT statement?

A.
1

B.
10

C.
100

D.
an error



Leave a Reply 10

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


the blogger

the blogger

The SELECT seq1.nextval FROM dual; query will display 100

smitha

smitha

The query will return 1. As they mentioned “The sequence SEQ1 has generated numbers up to the maximum limit of 200 ” . So after reaching the max value since it is cycle , again it starts from 1 and increments by 10.

Anshul Jain

Anshul Jain

should display 100 because it starts from 100.even it reached to max limit 200 ,it will recycle from 100 again.

cosmina

cosmina

I test it, and the next value after reached to 200, is 1. The correct answer is A

Anurag

Anurag

this answer is 1 because when
SELECT seq1.nextval FROM dual;
reach maxvalue 200
then restart with 1
because minvalue is not define

Igor

Igor

Nonsence. A realy useless feature. Why would anyone in the world need this? It is more logical to retrieve “10” instead of 1.

dames

dames

CYCLE option makes MINVALUE option required, and its default is 1.

shadow

shadow

The SELECT seq1.nextval FROM dual; query will display 100 . i test it

networkmanagers

networkmanagers

I agree with the answer. A