Multiple choice technology databases

Which clause of the CREATE SEQUENCE statement will cause the sequence to continue to generate numbers even after the maximum limit is reached?

  1. MAXVALUE

  2. MINVALUE

  3. CYCLE

  4. INCREMENT BY

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The CYCLE clause causes a sequence to automatically restart from MINVALUE when MAXVALUE is reached (or from MAXVALUE when MINVALUE is reached for descending sequences). MAXVALUE sets the upper limit, MINVALUE sets the lower limit, and INCREMENT BY defines the step between values.

AI explanation

CYCLE is correct. In Oracle's CREATE SEQUENCE statement, the CYCLE clause tells the sequence to wrap around and start generating from MINVALUE again once it hits MAXVALUE (or MINVALUE again in descending sequences), rather than raising an error when the limit is exhausted. MAXVALUE and MINVALUE merely define the bounds — they don't cause continuation past them. INCREMENT BY just sets the step size between values. Without CYCLE (the default is NOCYCLE), the sequence would raise an ORA-08004 error upon reaching its limit.