0
0
MySQLquery~10 mins

Why transactions ensure data integrity in MySQL - Test Your Understanding

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'
ASAVEPOINT
BCOMMIT
CROLLBACK
DTRANSACTION
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT or ROLLBACK to start a transaction.
Using SAVEPOINT to start a transaction.
2fill in blank
medium

Complete the code to save changes permanently in a transaction.

MySQL
[1];
Drag options to blanks, or click blank then click option'
ASTART TRANSACTION
BROLLBACK
CCOMMIT
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using START TRANSACTION to save changes.
Using ROLLBACK instead of COMMIT.
3fill in blank
hard

Fix the error in the code to undo changes in a transaction.

MySQL
[1];
Drag options to blanks, or click blank then click option'
ACOMMIT
BROLLBACK
CSTART TRANSACTION
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT to undo changes.
Using START TRANSACTION to undo changes.
4fill in blank
hard

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

MySQL
SAVEPOINT [1];
ROLLBACK TO [2];
Drag options to blanks, or click blank then click option'
Asp1
Btransaction1
Csave1
Drollback1
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 start a transaction, update a value, and commit the changes.

MySQL
START [1];
UPDATE accounts SET balance = balance [2] 100 WHERE id = 1;
[3];
Drag options to blanks, or click blank then click option'
ATRANSACTION
B+
CCOMMIT
DROLLBACK
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROLLBACK instead of COMMIT to save changes.
Using '-' instead of '+' to add money.