Isolation Levels Flashcards

1
Q

What are the isolation levels in t-sql?

A
Read Uncommitted
Read Committed
Repeatable Read
Serializable
Snapshot
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the default isolation level for SQL?

A

Read Committed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Read Uncommitted - dirty read?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Read Uncommitted - Non Repeatable Read

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Read Uncommitted - Phantom Read?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Dirty Read?

A

When one transaction is permitted to read another that is changing data but has not committed yet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Non Repeatable Read?

A

Data read twice inside the same transaction cannot be guaranteed to contain the same value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Phantom Read?

A

In the course of a transaction, new rows are added or removed by another transaction to the records being read.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Read Committed - Dirty Read?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Read Committed - Non Repeatable Read

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Read Committed - Phantom

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Repeatable read - Dirty Read

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Repeatable read - Non Repeatable Read

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Repeatable read - Phantom

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Snapshot - Dirty Read

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Snapshot - Non Repeatable Read

17
Q

Snapshot - Phantom

18
Q

Serializable - Dirty Read

19
Q

Serializable - Non Repeatable Read

20
Q

Serializable - Phantom

21
Q

What are the Lock modes?

A
Exclusive Lock (X)
Shared Lock (S)
Update Lock (U)
Intent Lock (I)
22
Q

What are the Regular Intent Locks?

A
Intent Exclusive (IX)
Intent Shared (IS)
Intent Update (IU)
23
Q

What are the Conversion Locks?

A

Shared With Intent Exclusive (SIX)
Shared with Intent Update (SIU)
Update with Intent Exclusive (UIX)
Bulk Update Locks (BU)

24
Q

What is the Locking Hierarchy?

A

DATABASE -> TABLE -> PAGE -> ROW

25
What is the Locking Hierarchy for a Select Statement?
Database - Shared Lock (S) Table - Intention Shared Lock (IS) Page - Intention Shared Lock (IS) Row - Shared Lock (S)
26
What is the Locking Hierarchy of a DML statement?
Database - Shared Lock (S) Table - Intent Exclusive (IX) or Intent Update (IU) Page - Intent Exclusive (IX) or Intent Update (IU) Row - Exclusive (X) or Update (U)
27
What lock types can you have with Intent Shared?
``` Intent Shared Shared Update Intent Exclusive Shared with Intent Exclusive ```
28
What lock types can you have with Shared?
Intent Shared Shared Update
29
What lock types can you have with Update?
Intent Shared | Shared (already existing, not new)
30
What lock types can you have with Intent Exclusive?
Intent Shared | Intent Exclusive
31
What lock types can you have with Shared with Intent Exclusive?
Intent Shared