New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

PostgreSQL PGCES-02 Exam - Topic 11 Question 75 Discussion

Actual exam question for PostgreSQL's PGCES-02 exam
Question #: 75
Topic #: 11
[All PGCES-02 Questions]

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;

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

0/2000 characters
Adolph
3 months ago
No way, it should return 3 rows!
upvoted 0 times
...
Roxane
3 months ago
Wait, does that mean an error could happen?
upvoted 0 times
...
Pete
3 months ago
Definitely 2 rows returned!
upvoted 0 times
...
Staci
4 months ago
I think the FETCH will return 1 row, right?
upvoted 0 times
...
Johna
4 months ago
The cursor starts at the first row, so moving forward 2 goes to the third row.
upvoted 0 times
...
Nohemi
4 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!
upvoted 0 times
...
Zack
4 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.
upvoted 0 times
...
Armando
4 months ago
I'm not entirely sure, but I remember something about FETCH returning rows based on the current position of the cursor.
upvoted 0 times
...
Juan
5 months ago
I think the cursor starts at the first row, so moving forward 2 should put it at the third row, right?
upvoted 0 times
...
Lynsey
5 months 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.
upvoted 0 times
...
Margart
5 months 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.
upvoted 0 times
...
Ben
5 months 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.
upvoted 0 times
...
Alton
5 months 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.
upvoted 0 times
...
Cordelia
5 months 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.
upvoted 0 times
...
Julio
1 year 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.
upvoted 0 times
Leigha
1 year ago
Definitely C, let's hope we're right.
upvoted 0 times
...
Annalee
1 year ago
I'm not sure, but C seems like the correct answer.
upvoted 0 times
...
Ernie
1 year ago
Yeah, I agree. C sounds right.
upvoted 0 times
...
Glenn
1 year ago
I think the answer is C.
upvoted 0 times
...
...
Virgina
1 year ago
I'm not sure, but I think the answer is C.
upvoted 0 times
...
Rasheeda
1 year ago
I agree with Pamella, the FETCH statement should return 1 row.
upvoted 0 times
...
Wilda
1 year 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?
upvoted 0 times
...
Pamella
1 year ago
I think the correct answer is B.
upvoted 0 times
...
Kirk
1 year 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.
upvoted 0 times
Kaycee
1 year ago
I believe it's A. The FETCH statement will return 0 rows because of an error in the execution.
upvoted 0 times
...
Latrice
1 year ago
I think it's B. The FETCH statement will return only 1 row after moving the cursor forward 2 positions.
upvoted 0 times
...
Cristen
1 year ago
I agree, the answer is C. The FETCH statement will return 2 rows after moving the cursor forward 2 positions.
upvoted 0 times
...
...

Save Cancel