0
0
SQLquery~10 mins

Auto-commit behavior 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 check if auto-commit is enabled.

SQL
SHOW VARIABLES LIKE '[1]';
Drag options to blanks, or click blank then click option'
Acommit_mode
Bauto_commit
Cautocommit
Dtransaction_mode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'auto_commit' instead of 'autocommit'.
Trying to check 'commit_mode' which is not a variable.
2fill in blank
medium

Complete the SQL command to disable auto-commit for the current session.

SQL
SET SESSION [1] = 0;
Drag options to blanks, or click blank then click option'
Aautocommit
Bauto_commit
Ccommit_mode
Dtransaction_mode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'auto_commit' instead of 'autocommit'.
Trying to set 'commit_mode' which is invalid.
3fill in blank
hard

Fix the error in the SQL command to commit a transaction.

SQL
[1];
Drag options to blanks, or click blank then click option'
ACOMMIT TRANSACTION
BROLLBACK
CSAVEPOINT
DCOMMIT
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'COMMIT TRANSACTION' which is not standard SQL.
Confusing commit with rollback or savepoint.
4fill in blank
hard

Fill both blanks to start a transaction and then disable auto-commit.

SQL
START [1]; SET [2] = 0;
Drag options to blanks, or click blank then click option'
ATRANSACTION
Bautocommit
Cauto_commit
DSESSION
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'auto_commit' instead of 'autocommit'.
Using 'SESSION' instead of 'autocommit' for the second blank.
5fill in blank
hard

Fill all three blanks to create a transaction, insert a row, and commit the changes.

SQL
BEGIN [1]; INSERT INTO users (name) VALUES ('Alice'); [2]; [3];
Drag options to blanks, or click blank then click option'
ATRANSACTION
BCOMMIT
CROLLBACK
DSTART
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROLLBACK instead of COMMIT to save changes.
Using START instead of BEGIN for the first blank.