Recall & Review
beginner
What is a savepoint in MySQL?
A savepoint is a marker within a transaction that allows you to roll back part of the transaction instead of the whole thing.
Click to reveal answer
beginner
How do you create a savepoint in MySQL?
Use the SQL command
SAVEPOINT savepoint_name; to create a savepoint inside a transaction.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 the transaction active.
Click to reveal answer
intermediate
How do you release a savepoint?
Use
RELEASE SAVEPOINT savepoint_name; to remove a savepoint. After releasing, you cannot roll back to it.Click to reveal answer
beginner
Can you use savepoints outside a transaction?
No, savepoints only work inside transactions. You must start a transaction before creating savepoints.
Click to reveal answer
Which command creates a savepoint named 'sp1' in MySQL?
✗ Incorrect
The correct syntax to create a savepoint is
SAVEPOINT savepoint_name;.What does
ROLLBACK TO SAVEPOINT sp1; do?✗ Incorrect
It undoes all changes made after the savepoint 'sp1' but keeps the transaction active.
What happens if you try to create a savepoint outside a transaction?
✗ Incorrect
Savepoints require an active transaction; otherwise, MySQL returns an error.
Which command removes a savepoint named 'sp1'?
✗ Incorrect
The correct command to remove a savepoint is
RELEASE SAVEPOINT savepoint_name;.After rolling back to a savepoint, what is the state of the transaction?
✗ Incorrect
Rolling back to a savepoint keeps the transaction active for further operations.
Explain what a savepoint is and how it helps in managing transactions.
Think about how you can undo part of your work without losing everything.
You got /3 concepts.
Describe the steps and commands to create, rollback to, and release a savepoint in MySQL.
Remember the order: create, rollback, release.
You got /4 concepts.