Multiple choice technology programming languages

Which of the following SQL statement create a sequence SE with starting value as 30 and in increments of 20?

  1. GENERATE SEQUENCE SE START WITH 30 ADD BY 20;

  2. CREATE SEQUENCE SE START WITH 30 ADD BY 20;

  3. CREATE SEQUENCE SE START WITH 30 INCREMENT BY 20;

  4. GENERATE SEQUENCE SE INITIATE WITH 30 INCREMENT BY 20;

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

The correct syntax is 'CREATE SEQUENCE SE START WITH 30 INCREMENT BY 20'. Options A and D incorrectly use 'GENERATE' instead of 'CREATE'. Option B uses 'ADD BY' which is not valid - the keyword is INCREMENT BY. Option C has the correct CREATE keyword, START WITH for initial value, and INCREMENT BY for the step value.