Vidyalelo
MySQL · Q395

MySQL

Programming · MySQL · question 395

Q395

What is the command to disable autocommit and launch a transaction?

A.
INITIATE TRANSACTION
B.
START TRANSACTION
Answer
C.
DISABLE AUTOCOMMIT
D.
TRANSACTION

Answer: Option B

Solution

Answer: Option B
Solution:
This question is about starting a transaction in MySQL. Transactions are a way to group multiple SQL statements together so they are treated as one unit. If all the statements in a transaction are successful, the changes are committed to the database. But if any statement fails, all the changes are rolled back.

The command to disable autocommit and launch a transaction is START TRANSACTION.

Here's why the other options are incorrect:

INITIATE TRANSACTION is not a valid MySQL command.
DISABLE AUTOCOMMIT only disables autocommit, but it doesn't start a transaction.
TRANSACTION is not a command but a keyword used in other commands.
Therefore, the correct answer is Option B: START TRANSACTION