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 10 Question 69 Discussion

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

Table t1 is defined as follows: CREATE TABLE t1 (value VARCHAR(5)); A set of SQL statements were executed in the following order. Select the number of rows that table "t1" has after execution. BEGIN; INSERT INTO t1 VALUES ('A'); SAVEPOINT sp; INSERT INTO t1 VALUES ('B'); ROLLBACK TO sp; INSERT INTO t1 VALUES ('C'); COMMIT;

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

0/2000 characters
Wilburn
3 months ago
I thought rollbacks removed everything after the savepoint!
upvoted 0 times
...
Ronnie
3 months ago
Nope, definitely 2 rows. The rollback is key here.
upvoted 0 times
...
Jerlene
3 months ago
Wait, are you sure? I thought it would be 3 rows!
upvoted 0 times
...
Onita
4 months ago
Agreed, the rollback cancels the second insert.
upvoted 0 times
...
Shalon
4 months ago
Only 2 rows in t1 after all that.
upvoted 0 times
...
Johanna
4 months ago
I thought we would end up with 3 rows since we inserted 'A', 'B', and 'C', but the rollback complicates things. Maybe it's 2?
upvoted 0 times
...
Nada
4 months ago
I'm not entirely sure, but I feel like the rollback might affect more than just the last insert. Could it be 1 row?
upvoted 0 times
...
Maryrose
4 months ago
I remember practicing a similar question, and I believe the final count should be 2 rows since 'B' gets rolled back but 'A' and 'C' remain.
upvoted 0 times
...
Ligia
5 months ago
I think after the rollback, only the first insert should count, so maybe it's 1 row?
upvoted 0 times
...
Heidy
5 months ago
Alright, I'm feeling confident about this. The sequence of operations is clear, and I'm ready to select the correct answer.
upvoted 0 times
...
Vincent
5 months ago
I think I've got it! The ROLLBACK TO sp command undoes the second INSERT, so the final table should have 2 rows.
upvoted 0 times
...
Rene
5 months ago
I'm a bit confused by the SAVEPOINT and ROLLBACK commands. I'll need to review how those work in relation to the other statements.
upvoted 0 times
...
Rosalyn
5 months ago
Okay, let me think this through step-by-step. The BEGIN, INSERT, SAVEPOINT, and ROLLBACK operations are key to understanding the final result.
upvoted 0 times
...
Trina
5 months ago
Hmm, this one looks tricky. I'll need to carefully trace the sequence of SQL statements to determine the final state of the table.
upvoted 0 times
...
Edwin
5 months ago
This looks like a straightforward question about Splunk alerts. I'm pretty confident I can handle this one.
upvoted 0 times
...
Myra
1 year ago
I think the answer is E) 0 rows because of the ROLLBACK statement.
upvoted 0 times
...
Leonor
1 year ago
Wait, did they just throw in a COMMIT at the end to confuse us? I'm going with D) 4 rows, just to be on the safe side. Better safe than sorry, right?
upvoted 0 times
Wilford
1 year ago
I'm sticking with 4 rows just to play it safe.
upvoted 0 times
...
Fidelia
1 year ago
I'm sticking with 4 rows, just to be safe.
upvoted 0 times
...
Shizue
1 year ago
I agree, I'll go with 2 rows as well.
upvoted 0 times
...
Marshall
1 year ago
I'm not sure, maybe it's 0 rows because of the ROLLBACK.
upvoted 0 times
...
Lashawnda
1 year ago
But then the COMMIT should make it 3 rows, right?
upvoted 0 times
...
Oretha
1 year ago
I think it's 2 rows because of the ROLLBACK to the SAVEPOINT.
upvoted 0 times
...
Mitsue
1 year ago
I think it's actually 2 rows because of the ROLLBACK to the SAVEPOINT sp.
upvoted 0 times
...
...
Leonard
1 year ago
I'm not sure, but I think the answer might be D) 4 rows.
upvoted 0 times
...
Fanny
1 year ago
This is a tricky one, but I think I've got it. The ROLLBACK TO sp ensures that the 'B' row is never committed, so the final count is 2 rows. B) 2 rows is the way to go.
upvoted 0 times
Lorrine
1 year ago
Yes, the 'B' row is never committed, so the final count is 2 rows.
upvoted 0 times
...
Mollie
1 year ago
I agree, the ROLLBACK TO sp statement is key here.
upvoted 0 times
...
...
Fernanda
1 year ago
I disagree, I believe the answer is C) 3 rows.
upvoted 0 times
...
Erasmo
1 year ago
Ah, I see what's going on here. The ROLLBACK TO sp undoes the insertion of 'B', so the final result is 3 rows. C) 3 rows is the correct answer.
upvoted 0 times
Marquetta
1 year ago
Yes, you're right. The ROLLBACK TO sp undoes the insertion of 'B', so the final result is 3 rows.
upvoted 0 times
...
Jeanice
1 year ago
I think it's 3 rows.
upvoted 0 times
...
...
Xochitl
2 years ago
I think the answer is B) 2 rows.
upvoted 0 times
...
Micheline
2 years ago
Hmm, let's see... After the ROLLBACK TO sp, the table should only have the first row with 'A', so the answer is A) 1 row.
upvoted 0 times
Graciela
1 year ago
You're right, it's A) 1 row.
upvoted 0 times
...
Adaline
1 year ago
Actually, it should be A) 1 row.
upvoted 0 times
...
Fatima
1 year ago
No, I believe it's B) 2 rows.
upvoted 0 times
...
Mitsue
1 year ago
I think it's A) 1 row.
upvoted 0 times
...
...

Save Cancel