What is the term for when a database searches an indexed value?
SEEK
What is the term for when a database searches for a non indexed value?
SCAN
What are the characteristics of a transaction?
What is it called when you write a statement that starts and ends without the user telling the computer that it’s a transaction?
Implicit Transaction.
What is it called when you tell the computer when you start and end a transaction?
Explicit Transaction.
What are the two ways to end a transaction?
COMMIT TRANSACTION
ROLLBACK TRANSACTION
How do you assign in the log the name of a transaction?
BEGIN TRANSACTION tranName WITH MARK
ROLLBACK TRANSACTION tranName
What is the net effect if you rollback a transaction that has nested transactions?
Any transactions that were committed within the parent transaction will be rolled back as well.
What happens if you rollback a child nested transaction and try to commit the parent transaction?
It will fail because a rollback transaction rolls back EVERYTHING.
How do you find out the nested level of a transaction?
SELECT @@TRANCOUNT
What are the scope and types of locks?
What are the elements of shared locks? (SELECT query)
What are the elements of Update Locks?
What are the elements of Exclusive Locks?
2. Used by INSERT, UPDATE, DELETE
What are the elements of Intent Locks?
What are the scopes where locks are used?
Rows, Pages and Tables
What is the order that locks go?
Shared -> Update -> Exclusive
How can you delay a transaction from running for a specified amount of time (EX. 10 Seconds)?
WAITFOR DELAY ‘00:00:10’
How can you specify when to run a transaction at a specific time (EX. 10am)?
WAITFOR TIME ‘10:00:00’
What are the problems with no concurrency control (ie: no locks, etc)
What are the transaction isolation levels?
What are the transaction isolation level effects for:
Read Uncommitted
Dirty Read - YES
NonRepeatable Read - YES
Phantom - YES
What are the transaction isolation level effects for:
Read Committed
Dirty Read - NO
NonRepeatable Read - YES
Phantom - YES
What are the transaction isolation level effects for:
Repeatable Read
Dirty Read - NO
NonRepeatable Read - NO
Phantom - YES