Complete the code to declare a variable named 'counter' with initial value 0.
DECLARE counter [1];In MySQL, to declare a variable with an initial integer value, use INT DEFAULT 0.
Complete the code to set the variable 'counter' to 5.
SET [1] = 5;
In MySQL stored programs, local variables are referenced by their name without any prefix.
Fix the error in the IF statement to check if 'counter' is less than 10.
IF counter [1] 10 THEN SET counter = counter + 1; END IF;
In MySQL, the less than operator is < to compare values.
Fill both blanks to create a WHILE loop that runs while 'counter' is less than 5.
WHILE counter [1] 5 DO SET counter = counter [2] 1; END WHILE;
The loop continues while counter is less than 5, and increments counter by 1 each time.
Fill all three blanks to declare a variable 'total', set it to 0, and increment it by 'value' inside a loop.
DECLARE [1] INT DEFAULT 0; SET [2] = 0; SET total = total [3] value;
Declare 'total' as INT with default 0, initialize it to 0, then add 'value' to 'total'.