0
0
SQLquery~10 mins

Savepoints within transactions in SQL - 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.

SQL
BEGIN [1];
Drag options to blanks, or click blank then click option'
AROLLBACK
BSAVEPOINT
CCOMMIT
DTRANSACTION
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'.

SQL
SAVEPOINT [1];
Drag options to blanks, or click blank then click option'
Astart
Bsp1
Ccommit
Drollback
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 'sp1'.

SQL
ROLLBACK TO [1];
Drag options to blanks, or click blank then click option'
Asp1
Bcommit
Cstart
Dbegin
Attempts:
3 left
💡 Hint
Common Mistakes
Using reserved words like COMMIT or BEGIN instead of the savepoint name.
Using a different savepoint name than the one created.
4fill in blank
hard

Fill both blanks to release the savepoint named 'sp1' and then commit the transaction.

SQL
RELEASE [1];
COMMIT [2];
Drag options to blanks, or click blank then click option'
Asp1
BTRANSACTION
CSAVEPOINT
Dsp2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'SAVEPOINT' instead of 'TRANSACTION' after COMMIT.
Using a wrong savepoint name like 'sp2'.
5fill in blank
hard

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

SQL
BEGIN [1];
SAVEPOINT [2];
ROLLBACK TO [3];
Drag options to blanks, or click blank then click option'
ATRANSACTION
Bsp1
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using SAVEPOINT instead of TRANSACTION to start the transaction.
Using different names for savepoint creation and rollback.