Complete the code to declare a cursor named my_cursor.
DECLARE [1] CURSOR FOR SELECT * FROM employees;The cursor name is declared right after the DECLARE keyword. Here, my_cursor is the correct cursor name.
Complete the code to open the cursor named my_cursor.
OPEN [1];To start using a cursor, you must open it by its declared name. Here, my_cursor is the correct name to open.
Fix the error in the FETCH statement to get data from my_cursor.
FETCH [1] INTO employee_name, employee_id;The FETCH statement must use the exact cursor name declared and opened. Here, my_cursor is correct.
Fill both blanks to correctly close and deallocate the cursor named my_cursor.
CLOSE [1]; DEALLOCATE [2];
Both CLOSE and DEALLOCATE statements must use the exact cursor name to properly release resources. Here, my_cursor is correct for both.
Fill all three blanks to declare, open, and fetch from a cursor named emp_cur.
DECLARE [1] CURSOR FOR SELECT name, id FROM employees; OPEN [2]; FETCH [3] INTO emp_name, emp_id;
All cursor operations must use the same cursor name. Here, emp_cur is used for declaring, opening, and fetching.