nerdexam
Snowflake

COF-C02 · Question #379

Which type of loop requires a BREAK statement to stop executing?

The correct answer is B. LOOP. In Snowflake Scripting, the LOOP construct is an unconditional infinite loop - it has no built-in termination condition. The only way to exit a LOOP is by using a BREAK statement (typically inside an IF condition). FOR loops iterate over a cursor or a fixed range and terminate…

Data Transformations

Question

Which type of loop requires a BREAK statement to stop executing?

Options

  • AFOR
  • BLOOP
  • CREPEAT
  • DWHILE

How the community answered

(33 responses)
  • A
    9% (3)
  • B
    88% (29)
  • C
    3% (1)

Explanation

In Snowflake Scripting, the LOOP construct is an unconditional infinite loop - it has no built-in termination condition. The only way to exit a LOOP is by using a BREAK statement (typically inside an IF condition). FOR loops iterate over a cursor or a fixed range and terminate automatically. WHILE loops evaluate a condition before each iteration and stop when it is false. REPEAT loops execute the body first, then evaluate an UNTIL condition to decide whether to stop - they do not require BREAK.

Topics

#SQL Scripting#Control Flow#Loops#BREAK statement

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice