0
0
MySQLquery~10 mins

Savepoints in MySQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a transaction in MySQL.

MySQL
START [1];
Drag options to blanks, or click blank then click option'
ATRANSACTION
BSAVEPOINT
CCOMMIT
DROLLBACK
Attempts:
3 left
💡 Hint
Common Mistakes
Using SAVEPOINT instead of TRANSACTION to start a transaction.
Using COMMIT or ROLLBACK to start a transaction.
2fill in blank
medium

Complete the code to create a savepoint named 'sp1'.

MySQL
SAVEPOINT [1];
Drag options to blanks, or click blank then click option'
Astart
Brollback
Ccommit
Dsp1
Attempts:
3 left
💡 Hint
Common Mistakes
Using reserved words like 'commit' or 'rollback' as savepoint names.
Using 'start' which is not the intended savepoint name.
3fill in blank
hard

Fix the error in the code to rollback to the savepoint named 'sp1'.

MySQL
ROLLBACK TO [1];
Drag options to blanks, or click blank then click option'
Astart
Bsp1
Ccommit
Drollback
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' or 'rollback' as savepoint names in rollback statement.
Using 'start' which is not a savepoint name.
4fill in blank
hard

Fill both blanks to declare a savepoint named 'sp2' and then release it.

MySQL
SAVEPOINT [1];
RELEASE SAVEPOINT [2];
Drag options to blanks, or click blank then click option'
Asp2
Bsp1
Csp3
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using different savepoint names in savepoint and release statements.
Using invalid names like 'start' or 'sp3' instead of 'sp2'.
5fill in blank
hard

Fill all three blanks to start a transaction, create a savepoint 'sp3', and rollback to it.

MySQL
START [1];
SAVEPOINT [2];
ROLLBACK TO [3];
Drag options to blanks, or click blank then click option'
ASAVEPOINT
BTRANSACTION
Csp3
DCOMMIT
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'SAVEPOINT' instead of 'TRANSACTION' to start the transaction.
Using different savepoint names in savepoint and rollback statements.
Using 'COMMIT' in the first blank which does not start a transaction.