1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 36


Examine the description of the BOOKS table:

The table has 100 rows.

Examine this sequence of statements issued in a new session:

INSERT INTO books VALUES ('ADV112', 'Adventures of Tom Sawyer', NULL, NULL);

SAVEPOINT a;

DELETE FROM books;

ROLLBACK TO SAVEPOINT a;

ROLLBACK;

Which two statements are true? (Choose two.)

Show Answer
Correct Answer: CD

The sequence of operations first inserts one row into the BOOKS table, leading to a total of 101 rows. The first SAVEPOINT 'a' allows for a partial rollback to this point. The DELETE FROM books statement then removes all the rows in the table, reducing the count to 0. The first ROLLBACK TO SAVEPOINT 'a' undoes the DELETE operation, restoring the table to its state immediately following the INSERT command (101 rows, including the newly inserted row). The final ROLLBACK without specifying a savepoint undoes all changes made in the current transaction, which includes the insert operation, reverting the table to its initial state of 100 rows. Therefore, the first ROLLBACK command restores the 101 rows that were deleted, leaving the inserted row still to be committed, while the second ROLLBACK command undoes the insert.

Discussion

4 comments
Sign in to comment
Orxan_HOptions: CD
Apr 17, 2023

Rollback without savepoint: - end of the transaction - delete savepoints - undoes all changes in the transactions

TheOracleWasTakenOptions: CD
Aug 1, 2023

Seems right!

yaya32Options: DE
Jan 12, 2024

For me DE

alelejajaOptions: CD
May 28, 2024

CD are correct