Oracle Database Programming MCQs with Answers
Practice important Oracle Database Programming MCQs with answers and explanations.
Multiple Choice Questions
Q161: What does the %NOTFOUND attribute of a cursor indicate?
- A: Whether the cursor is open
- B: Whether a row was fetched
- C: Whether the previous FETCH returned a row
- D: Whether the cursor has been closed
View Answer
C
Q162: Which cursor attribute returns the number of records fetched?
- A: %ROWCOUNT
- B: %FOUND
- C: %NOTFOUND
- D: %ISOPEN
View Answer
A
Q163: What is the first step in processing a cursor?
- A: Fetching the cursor
- B: Closing the cursor
- C: Opening the cursor
- D: Declaring the cursor
View Answer
D
Q164: In the implicit cursor example, what will %ROWCOUNT show after the update statement?
- A: Number of rows updated
- B: Number of rows inserted
- C: Number of rows deleted
- D: Number of rows fetched
View Answer
A
Q165: What is the purpose of the FETCH statement in PL/SQL cursors?
- A: To close the cursor
- B: To open the cursor
- C: To retrieve data from the cursor
- D: To declare the cursor
View Answer
C
Q166: How is an explicit cursor defined in a PL/SQL block?
- A: In the BEGIN section
- B: In the DECLARE section
- C: In the EXECUTE section
- D: In the OPEN section
View Answer
B
Q167: What does the %ISOPEN attribute of a cursor indicate?
- A: If the cursor has processed all rows
- B: If the cursor is currently open
- C: If the cursor has been declared
- D: If the cursor is being fetched
View Answer
B
Q168: Which PL/SQL block demonstrates the use of an explicit cursor to display employee names and designations?
- A: Processing Explicit Cursor –I
- B: Processing Explicit Cursor –II
- C: Processing Explicit Cursor –III
- D: Processing Explicit Cursor –IV
View Answer
A
Q169: In which cursor example is the total salary updated and displayed for employees with at least 10 years of service?
- A: Processing Explicit Cursor –V
- B: Processing Explicit Cursor –VI
- C: Processing Explicit Cursor with SQL–I
- D: Processing Explicit Cursor with SQL–II
View Answer
C
Q170: How are rows processed in the FOR loop with an explicit cursor?
- A: Using FETCH statements
- B: Using INSERT statements
- C: Using UPDATE statements
- D: Automatically without explicit FETCH
View Answer
D