0
0
SQLquery~10 mins

ACID properties mental model in SQL - Interactive Code Practice

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

Complete the SQL statement to start a transaction.

SQL
BEGIN [1];
Drag options to blanks, or click blank then click option'
ATRANSACTION
BCOMMIT
CROLLBACK
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT or ROLLBACK to start a transaction.
Omitting the TRANSACTION keyword.
2fill in blank
medium

Complete the SQL statement to save changes permanently.

SQL
[1] TRANSACTION;
Drag options to blanks, or click blank then click option'
ABEGIN
BCOMMIT
CROLLBACK
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using BEGIN instead of COMMIT to save changes.
Using ROLLBACK which cancels changes.
3fill in blank
hard

Fix the error in the SQL statement to undo changes in a transaction.

SQL
ROLLBACK [1];
Drag options to blanks, or click blank then click option'
ACOMMIT
BSAVEPOINT
CTRANSACTION
DBEGIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROLLBACK SAVEPOINT instead of ROLLBACK TRANSACTION.
Using COMMIT or BEGIN with ROLLBACK.
4fill in blank
hard

Fill both blanks to create a savepoint and rollback to it.

SQL
SAVEPOINT [1]; ROLLBACK TO [2];
Drag options to blanks, or click blank then click option'
Asp1
Bsp2
Csave1
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for savepoint and rollback.
Using reserved words as savepoint names.
5fill in blank
hard

Fill all three blanks to demonstrate atomicity with a transaction.

SQL
BEGIN [1]; UPDATE accounts SET balance = balance - 100 WHERE id = 1; UPDATE accounts SET balance = balance + 100 WHERE id = 2; [2]; [3];
Drag options to blanks, or click blank then click option'
ATRANSACTION
BCOMMIT
CROLLBACK
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting BEGIN TRANSACTION or COMMIT.
Using SAVEPOINT instead of COMMIT or ROLLBACK here.