The table "t1" is defined below. The column "id"
for table "t1" is of INTEGER type.
id | name ----
+-----------1 |
mammoth 2 |
tortoise 3 |
coelacanth
The following SQL statements were executed. Select the correct statement about the execution result. BEGIN; DECLARE c SCROLL CURSOR FOR SELECT name FROM t1 ORDER BY id;
MOVE FORWARD 2 FROM c; FETCH FORWARD ALL FROM c; COMMIT;
Suggested Answer: B
Get Premium PGCES-02 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
27 comments · newest first
AD
Adolph
10 months ago
No way, it should return 3 rows!
RO
Roxane
11 months ago
Wait, does that mean an error could happen?
PE
Pete
11 months ago
Definitely 2 rows returned!
ST
Staci
11 months ago
I think the FETCH will return 1 row, right?
JO
Johna
11 months ago
The cursor starts at the first row, so moving forward 2 goes to the third row.
NO
Nohemi
12 months ago
I’m confused about the MOVE statement. Does it actually skip the rows or just position the cursor? I hope I remember this correctly!
ZA
Zack
12 months ago
This reminds me of a practice question where we had to calculate the number of rows returned after moving the cursor. I think it might be 1 row returned here.
AR
Armando
12 months ago
I'm not entirely sure, but I remember something about FETCH returning rows based on the current position of the cursor.
JU
Juan
1 year ago
I think the cursor starts at the first row, so moving forward 2 should put it at the third row, right?
LY
Lynsey
1 year ago
This is a good test of understanding cursor operations. I'll need to carefully trace the cursor position and fetch behavior to determine the correct number of rows returned. Shouldn't be too difficult if I think it through methodically.
MA
Margart
1 year ago
I'm not entirely sure about this one. The cursor positioning and fetch logic seems a bit complex. I'll need to walk through it carefully step-by-step to figure out the right answer.
BE
Ben
1 year ago
Okay, I think I've got this. The MOVE FORWARD 2 statement positions the cursor on the third row, and the FETCH FORWARD ALL statement should return the remaining 1 row. The answer is C.
AL
Alton
1 year ago
Hmm, I'm a bit confused by the cursor MOVE and FETCH statements. I'll need to review how cursor positioning and fetching work to determine the correct number of rows returned.
CO
Cordelia
1 year ago
This looks like a tricky SQL question involving cursor operations. I'll need to carefully read through the details and think through the cursor positioning and fetch behavior.
JU
Julio
2 years ago
Oh man, cursors always trip me up. But I'm pretty sure the answer is C. Can't wait to be done with this exam and get back to my pet rock collection.
LE
Leigha
2 years ago
Definitely C, let's hope we're right.
AN
Annalee
2 years ago
I'm not sure, but C seems like the correct answer.
ER
Ernie
2 years ago
Yeah, I agree. C sounds right.
GL
Glenn
2 years ago
I think the answer is C.
VI
Virgina
2 years ago
I'm not sure, but I think the answer is C.
RA
Rasheeda
2 years ago
I agree with Pamella, the FETCH statement should return 1 row.
WI
Wilda
2 years ago
Hmm, I'm not so sure. The question mentions a SCROLL CURSOR, so I'm wondering if the cursor position can be reset somehow. Maybe the answer is D?
PA
Pamella
2 years ago
I think the correct answer is B.
KI
Kirk
2 years ago
I think the answer is C. The MOVE FORWARD 2 statement positions the cursor on the third row, and then the FETCH FORWARD ALL statement should return the remaining two rows.
KA
Kaycee
2 years ago
I believe it's A. The FETCH statement will return 0 rows because of an error in the execution.
LA
Latrice
2 years ago
I think it's B. The FETCH statement will return only 1 row after moving the cursor forward 2 positions.
CR
Cristen
2 years ago
I agree, the answer is C. The FETCH statement will return 2 rows after moving the cursor forward 2 positions.