Recall & Review
beginner
What is a savepoint in a database transaction?
A savepoint is a marker within a transaction that allows you to roll back part of the transaction without undoing the entire transaction.
Click to reveal answer
beginner
How do you create a savepoint in SQL?
You create a savepoint using the SQL command:
SAVEPOINT savepoint_name;Click to reveal answer
intermediate
What happens when you roll back to a savepoint?
Rolling back to a savepoint undoes all changes made after that savepoint, but keeps changes made before it within the same transaction.
Click to reveal answer
intermediate
Can you release a savepoint? If yes, how?
Yes, you can release a savepoint to free resources using:
RELEASE SAVEPOINT savepoint_name;. After releasing, you cannot roll back to it.Click to reveal answer
beginner
Why are savepoints useful in transactions?
Savepoints let you handle errors or partial failures inside a transaction by rolling back only part of the work, not the entire transaction.Click to reveal answer
Which SQL command creates a savepoint named 'sp1'?
✗ Incorrect
The command to create a savepoint is SAVEPOINT followed by the savepoint name.
What does the command
ROLLBACK TO SAVEPOINT sp1; do?✗ Incorrect
ROLLBACK TO SAVEPOINT undoes changes made after the savepoint but keeps earlier changes.
After releasing a savepoint, what happens if you try to roll back to it?
✗ Incorrect
Releasing a savepoint removes it, so you cannot roll back to it afterward.
Which of the following is NOT true about savepoints?
✗ Incorrect
Savepoints do not commit transactions; they only mark points for partial rollback.
What is the main benefit of using savepoints in transactions?
✗ Incorrect
Savepoints let you undo part of a transaction without losing all progress.
Explain what a savepoint is and how it is used within a database transaction.
Think about marking a spot inside a transaction to go back to if needed.
You got /4 concepts.
Describe the difference between rolling back a whole transaction and rolling back to a savepoint.
Consider what happens to changes made before and after the savepoint.
You got /4 concepts.