Complete the code to set the transaction isolation level to READ COMMITTED.
SET TRANSACTION ISOLATION LEVEL [1];The READ COMMITTED isolation level ensures that any data read is committed at the moment it is read. This prevents dirty reads.
Complete the code to start a transaction with the SERIALIZABLE isolation level.
START TRANSACTION ISOLATION LEVEL [1];SERIALIZABLE is the strictest isolation level, preventing phantom reads and ensuring full transaction isolation.
Fix the error in the code to set the isolation level globally.
SET GLOBAL TRANSACTION ISOLATION LEVEL [1];The default global isolation level in MySQL is REPEATABLE READ. This command sets it correctly.
Fill both blanks to complete the query that shows the current transaction isolation level.
SELECT @@transaction_isolation AS [1], @@global.transaction_isolation AS [2];
The query returns the current session isolation level as 'isolation_level' and the global isolation level as 'global_level'.
Fill the blanks to complete the code that sets the isolation level for the next transaction and then starts it.
SET SESSION TRANSACTION ISOLATION LEVEL [1]; START TRANSACTION [2];
The first statement sets the session isolation level to READ COMMITTED. The second starts a transaction with SERIALIZABLE isolation level specified explicitly.