Unit_8 Flashcards
Stored Procedure
structures allow a single command, or a group of statements, to be executed repeatedly.
Looping / Loops
Stored Procedure
WHILE loops are commonly used with ________ to process a set of data one row at a time.
cursors
Using Loops
Three loop statements in MySQL
(W,R,L)
While
Repeat
Loop
loop checks the expression at the beginning of each iteration.
WHILE
loop is called pretest loop because it checks the expression before the statements execute.
WHILE
First, MySQL executes the statements, and then it evaluates the expression.
What loop is this?
REPEAT loop
If the expressionevaluates to FALSE, MySQL executes the statements repeatedly until the expression evaluates to TRUE.
What loop is this?
REPEAT Loop
Because this checks the statements expression after the execution of statement thefore this loop statement is also known as post-test loop
REPEAT Loop
This command specifies that the control should pass to the command immediately following the current loop.
BREAK command
In MySQL, ________ is used to exit the flow control construct that has the given label. If the label is for the outermost stored program block, ________ exits the program.
LEAVE
If you wish to terminate a single iteration of a loop you can use the ________ command.
This command immediately stops the current iteration and rechecks the loop’s condition.
CONTINUE
In MySQL, The ________ statement allows you to skip the entire code under it and start a new iteration.
Also means “start the loop again”
ITERATE
A ________ is a database object that permits the data set generated by a query to be processed one row at a time
cursor
This provides a pointer to a single row and allows the information in that row to be extracted and processed.
cursor
Commonly a ________ is combined with a ________ loop to enable row-by-row processing of an entire data set.
cursor, WHILE