nerdexam
Snowflake

SOL-C01 · Question #59

A table 'CUSTOMER DATA' exists within the 'PUBLIC" schema of the database 'CUSTOMER DB'. The table contains a column named 'CUSTOMER ID. You need to create a sequence named 'CUSTOMER SEQ and configure

The correct answer is A. CREATE SEQUENCE CUSTOMER SEQ START WITH 1000 INCREMENT BY 10 MAXVALUE. Option A is correct because creating a sequence that cycles requires both MAXVALUE 2000 (to define the upper boundary where cycling occurs) and CYCLE (to instruct the database to restart from the minimum value after hitting that maximum) - together these two clauses fully impleme

Snowflake Overview and Architecture

Question

A table 'CUSTOMER DATA' exists within the 'PUBLIC" schema of the database 'CUSTOMER DB'. The table contains a column named 'CUSTOMER ID. You need to create a sequence named 'CUSTOMER SEQ and configure it to automatically increment by 10 for each new customer inserted into the 'CUSTOMER DATA' table. The sequence should start at 1000 and cycle back to the beginning after reaching 2000. What is the correct SQL statement to create and configure this sequence?

Options

  • ACREATE SEQUENCE CUSTOMER SEQ START WITH 1000 INCREMENT BY 10 MAXVALUE
  • BCREATE SEQUENCE CUSTOMER SEQ START WITH 1000 INCREMENT BY 10 MINVALUE
  • CCREATE SEQUENCE CUSTOMER SEQ START WITH 1000 INCREMENT BY 10 MAXVALUE
  • DCREATE SEQUENCE CUSTOMER SEQ START WITH 1000 INCREMENT BY 10 CYCLE;
  • ECREATE SEQUENCE CUSTOMER SEQ START WITH 1000 INCREMENT BY 10 MAXVALUE

How the community answered

(56 responses)
  • A
    82% (46)
  • B
    5% (3)
  • C
    9% (5)
  • D
    2% (1)
  • E
    2% (1)

Explanation

Option A is correct because creating a sequence that cycles requires both MAXVALUE 2000 (to define the upper boundary where cycling occurs) and CYCLE (to instruct the database to restart from the minimum value after hitting that maximum) - together these two clauses fully implement the cycling behavior described.

Option D fails despite including CYCLE because it omits MAXVALUE 2000, meaning the sequence has no defined ceiling to cycle back from and would either use a system default maximum or error. Options C and E likely include MAXVALUE but omit CYCLE, so the sequence would simply stop (or error) at 2000 rather than wrapping around. Option B uses MINVALUE instead of MAXVALUE, which sets a floor rather than a ceiling and does nothing to enforce the upper bound of 2000.

Memory tip: Think of the pair as a gate and a rule - MAXVALUE is the gate (where to stop), and CYCLE is the rule (what to do when you hit it). You need both for cycling behavior, just like a revolving door needs both a frame and a mechanism to spin.

Topics

#Sequences#CREATE SEQUENCE#DDL#Schema Objects

Community Discussion

No community discussion yet for this question.

Full SOL-C01 Practice