0
0
SQLquery~10 mins

BEGIN TRANSACTION syntax 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 in SQL.

SQL
[1];
Drag options to blanks, or click blank then click option'
ACOMMIT TRANSACTION
BBEGIN TRANSACTION
CROLLBACK TRANSACTION
DSAVE TRANSACTION
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT TRANSACTION to start a transaction.
Using ROLLBACK TRANSACTION instead of BEGIN TRANSACTION.
2fill in blank
medium

Complete the code to start a transaction and ensure changes can be undone if needed.

SQL
[1]; -- start transaction
Drag options to blanks, or click blank then click option'
ACOMMIT TRANSACTION
BSAVE TRANSACTION
CROLLBACK TRANSACTION
DBEGIN TRANSACTION
Attempts:
3 left
💡 Hint
Common Mistakes
Using SAVE TRANSACTION to start a transaction.
Using COMMIT TRANSACTION at the start.
3fill in blank
hard

Fix the error in this SQL code that tries to start a transaction.

SQL
BEGIN [1];
Drag options to blanks, or click blank then click option'
AROLLBACK
BCOMMIT
CTRANSACTION
DSAVE
Attempts:
3 left
💡 Hint
Common Mistakes
Using BEGIN COMMIT instead of BEGIN TRANSACTION.
Using BEGIN ROLLBACK which is invalid.
4fill in blank
hard

Fill both blanks to correctly start and then commit a transaction.

SQL
[1];
-- some SQL statements
[2];
Drag options to blanks, or click blank then click option'
ABEGIN TRANSACTION
BCOMMIT TRANSACTION
CROLLBACK TRANSACTION
DSAVE TRANSACTION
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROLLBACK TRANSACTION instead of COMMIT TRANSACTION to save changes.
Not starting with BEGIN TRANSACTION.
5fill in blank
hard

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

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