Complete the code to set the transaction isolation level to READ COMMITTED.
SET TRANSACTION ISOLATION LEVEL [1];The READ COMMITTED level allows a transaction to see only committed data, preventing 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 all concurrency anomalies.
Fix the error in the code to set the isolation level to REPEATABLE READ.
SET TRANSACTION ISOLATION [1] REPEATABLE READ;The correct syntax is SET TRANSACTION ISOLATION LEVEL followed by the level name.
Fill the three blanks to complete the command that sets the isolation level to READ UNCOMMITTED for the current session.
SET SESSION TRANSACTION ISOLATION [1] [2] [3];
The correct syntax is SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;. This is the least strict isolation level, allowing dirty reads.
Fill all three blanks to write a query that shows the current transaction isolation level.
SELECT @@transaction_isolation AS [1], @@[2] AS [3];
This query selects the current transaction isolation level using system variables. '@@transaction_isolation' is standard, '@@tx_isolation' is a synonym in some systems, and aliasing helps readability.