Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start a transaction in MySQL.
MySQL
[1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT to start a transaction instead of BEGIN.
Using ROLLBACK to start a transaction.
✗ Incorrect
The BEGIN statement starts a new transaction in MySQL.
2fill in blank
mediumComplete the code to save changes permanently in a transaction.
MySQL
[1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using BEGIN instead of COMMIT to save changes.
Using ROLLBACK which cancels changes.
✗ Incorrect
The COMMIT statement saves all changes made in the current transaction permanently.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT instead of ROLLBACK to cancel changes.
Using BEGIN which starts a transaction.
✗ Incorrect
The ROLLBACK statement cancels all changes made in the current transaction.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROLLBACK instead of COMMIT to save changes.
Using COMMIT before BEGIN.
✗ Incorrect
First, BEGIN starts the transaction, then COMMIT saves the changes.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using COMMIT instead of ROLLBACK to cancel changes.
Not starting a new transaction after rollback.
✗ Incorrect
First, BEGIN starts the transaction, then ROLLBACK cancels changes, and BEGIN starts a new transaction again.