Which sequence begins a transaction and then commits it?

Study for the SQL Basics Test. Improve your knowledge with multiple choice questions and detailed explanations. Prepare effectively to master SQL concepts!

Multiple Choice

Which sequence begins a transaction and then commits it?

Explanation:
In SQL, a transaction must be opened before you can commit it. You start a transaction with a command like START TRANSACTION (or BEGIN TRANSACTION), perform your operations, and then use COMMIT to make all those changes permanent (or use ROLLBACK to discard them). The sequence START TRANSACTION; COMMIT; fits the pattern exactly: it opens the transaction first, then finalizes the changes with a commit. The other options start with rollback or mix up the order, which doesn’t end with a committed, permanent set of changes. In many databases you could also see BEGIN TRANSACTION as the opening command, but the essential idea remains the same: open, then commit.

In SQL, a transaction must be opened before you can commit it. You start a transaction with a command like START TRANSACTION (or BEGIN TRANSACTION), perform your operations, and then use COMMIT to make all those changes permanent (or use ROLLBACK to discard them). The sequence START TRANSACTION; COMMIT; fits the pattern exactly: it opens the transaction first, then finalizes the changes with a commit. The other options start with rollback or mix up the order, which doesn’t end with a committed, permanent set of changes. In many databases you could also see BEGIN TRANSACTION as the opening command, but the essential idea remains the same: open, then commit.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy