0
0
MySQLquery~10 mins

BEGIN, COMMIT, ROLLBACK 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
[1];
Drag options to blanks, or click blank then click option'
ACOMMIT
BROLLBACK
CBEGIN
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT to start a transaction instead of BEGIN.
Using ROLLBACK 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'
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 code to cancel all changes in the current transaction.

MySQL
[1];
Drag options to blanks, or click blank then click option'
AROLLBACK
BBEGIN
CCOMMIT
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT instead of ROLLBACK to cancel changes.
Using BEGIN which starts a transaction.
4fill in blank
hard

Fill both blanks to start a transaction and then save changes.

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

Fill all three blanks to start a transaction, cancel changes, and then start a new transaction.

MySQL
[1];
-- some SQL statements
[2];
[3];
Drag options to blanks, or click blank then click option'
ABEGIN
BCOMMIT
CROLLBACK
DSAVEPOINT
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT instead of ROLLBACK to cancel changes.
Not starting a new transaction after rollback.