Oracle Database 12c: SQL Fundamentals — Question 37
Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seq1 -
START WITH 100 -
INCREMENT BY 10 -
MAXVALUE 200 -
CYCLE -
NOCACHE;
The SEQ1 sequence 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?
Answer options
- A. 1
- B. 10
- C. 100
- D. an error
Correct answer: A
Explanation
The correct answer is A because the sequence has cycled back to its starting value of 100 after reaching the maximum of 200. Options B and C are incorrect as they refer to values that the sequence would produce before reaching the maximum, and D is not applicable since the sequence does not throw an error but instead resets.