Deal of The Day! 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

Posted by Kathrine on Aug 22, 2024 at 05:26 PM

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;

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
38 comments · newest first
WI
Wilburn 10 months ago
I thought rollbacks removed everything after the savepoint!
RO
Ronnie 11 months ago
Nope, definitely 2 rows. The rollback is key here.
JE
Jerlene 11 months ago
Wait, are you sure? I thought it would be 3 rows!
ON
Onita 11 months ago
Agreed, the rollback cancels the second insert.
SH
Shalon 11 months ago
Only 2 rows in t1 after all that.
JO
Johanna 12 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?
NA
Nada 12 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?
MA
Maryrose 12 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.
LI
Ligia 1 year ago
I think after the rollback, only the first insert should count, so maybe it's 1 row?
HE
Heidy 1 year ago
Alright, I'm feeling confident about this. The sequence of operations is clear, and I'm ready to select the correct answer.
VI
Vincent 1 year ago
I think I've got it! The ROLLBACK TO sp command undoes the second INSERT, so the final table should have 2 rows.
RE
Rene 1 year 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.
RO
Rosalyn 1 year ago
Okay, let me think this through step-by-step. The BEGIN, INSERT, SAVEPOINT, and ROLLBACK operations are key to understanding the final result.
TR
Trina 1 year 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.
ED
Edwin 1 year ago
This looks like a straightforward question about Splunk alerts. I'm pretty confident I can handle this one.
MY
Myra 2 years ago
I think the answer is E) 0 rows because of the ROLLBACK statement.
LE
Leonor 2 years 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?
WI
Wilford 2 years ago
↳ replying to Leonor
I'm sticking with 4 rows just to play it safe.
FI
Fidelia 2 years ago
↳ replying to Leonor
I'm sticking with 4 rows, just to be safe.
SH
Shizue 2 years ago
↳ replying to Leonor
I agree, I'll go with 2 rows as well.
MA
Marshall 2 years ago
↳ replying to Leonor
I'm not sure, maybe it's 0 rows because of the ROLLBACK.
LA
Lashawnda 2 years ago
↳ replying to Leonor
But then the COMMIT should make it 3 rows, right?
OR
Oretha 2 years ago
↳ replying to Leonor
I think it's 2 rows because of the ROLLBACK to the SAVEPOINT.
MI
Mitsue 2 years ago
↳ replying to Leonor
I think it's actually 2 rows because of the ROLLBACK to the SAVEPOINT sp.
LE
Leonard 2 years ago
I'm not sure, but I think the answer might be D) 4 rows.
FA
Fanny 2 years 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.
LO
Lorrine 2 years ago
↳ replying to Fanny
Yes, the 'B' row is never committed, so the final count is 2 rows.
MO
Mollie 2 years ago
↳ replying to Fanny
I agree, the ROLLBACK TO sp statement is key here.
FE
Fernanda 2 years ago
I disagree, I believe the answer is C) 3 rows.
ER
Erasmo 2 years 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.
MA
Marquetta 2 years ago
↳ replying to Erasmo
Yes, you're right. The ROLLBACK TO sp undoes the insertion of 'B', so the final result is 3 rows.
JE
Jeanice 2 years ago
↳ replying to Erasmo
I think it's 3 rows.
XO
Xochitl 2 years ago
I think the answer is B) 2 rows.
MI
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.
GR
Graciela 2 years ago
↳ replying to Micheline
You're right, it's A) 1 row.
AD
Adaline 2 years ago
↳ replying to Micheline
Actually, it should be A) 1 row.
FA
Fatima 2 years ago
↳ replying to Micheline
No, I believe it's B) 2 rows.
MI
Mitsue 2 years ago
↳ replying to Micheline
I think it's A) 1 row.
0/2000 characters

Save Cancel