Complete the code to declare a cursor named my_cursor for selecting all rows from the employees table.
DECLARE my_cursor CURSOR FOR SELECT * FROM [1];The cursor is declared to select all rows from the employees table.
Complete the code to open the cursor named my_cursor.
[1] my_cursor;The OPEN statement is used to start the cursor so it can be used to fetch rows.
Fix the error in the code to fetch one row from the cursor my_cursor into the variable emp_record.
FETCH [1] my_cursor INTO emp_record;The NEXT option fetches the next row from the cursor, which is the default and correct choice here.
Fill both blanks to close the cursor and then deallocate it.
[1] my_cursor; [2] my_cursor;
First, the cursor is CLOSEd to stop it, then DEALLOCATEd to free resources.
Fill all three blanks to declare a cursor named emp_cursor for employees with salary over 50000, open it, and fetch one row into emp_rec.
DECLARE [1] CURSOR FOR SELECT * FROM employees WHERE salary [2] 50000; [3] [1]; FETCH NEXT [1] INTO emp_rec;
The cursor is named emp_cursor. It selects employees with salary greater than 50000. Then it is OPENed before fetching.