Transaction Control Language (TCL) Flashcards
7 cards from real SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Transaction Control Language (TCL) flashcards as text
Which phenomenon does SERIALIZABLE isolation prevent that REPEATABLE READ may not?
Answer: Phantom reads
SERIALIZABLE prevents phantom reads, which can occur under REPEATABLE READ in some systems.
If a session disconnects unexpectedly before COMMIT, what happens to its changes?
Answer: They are rolled back
Most databases roll back uncommitted changes when a session ends abnormally.
Which command begins an explicit transaction block in SQL Server?
Answer: BEGIN TRANSACTION
BEGIN TRANSACTION (or BEGIN TRAN) explicitly starts a transaction in SQL Server.
What does the standard SQL command START TRANSACTION do?
Answer: Begins a new transaction block
START TRANSACTION begins an explicit transaction in ANSI SQL and MySQL.
In MySQL, which setting disables automatic committing of each statement?
Answer: SET autocommit = 0
Setting autocommit to 0 requires explicit COMMIT to save changes.
Two transactions waiting on each other's locks indefinitely is called a:
Answer: Deadlock
A deadlock occurs when transactions each hold locks the other needs.
When a deadlock is detected, the database typically:
Answer: Rolls back one transaction as a victim
The DBMS chooses a victim transaction to roll back, freeing locks for the other.