-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab#6_A.sql
More file actions
56 lines (42 loc) · 1.07 KB
/
Lab#6_A.sql
File metadata and controls
56 lines (42 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
USE C12565
SELECT * FROM LLEVA
-- Escenario 1: Nivel de aislamiento read uncommitted
-- 6
set implicit_transactions off; -- default
set transaction isolation level read uncommitted;
begin transaction t1;
PRINT @@TRANCOUNT
Select avg(Nota) from Lleva;
-- 8
Select avg(Nota) from Lleva;
-- 10
Select avg(Nota) from Lleva;
Commit transaction t1;
-- Escenario 2: Nivel de aislamiento read committed
-- 12
set implicit_transactions off;
set transaction isolation level read committed;
begin transaction t3;
Select avg(Nota) from Lleva;
-- 14
Select max(Nota) from Lleva;
-- 16
Commit transaction t3;
-- Escenario 3: Nivel de aislamiento repeatable read
-- 18
set implicit_transactions off;
set transaction isolation level repeatable read;
begin transaction t5;
Select avg(Nota) from Lleva;
-- 20
Select avg(Nota) from Lleva;
commit transaction t5;
-- Escenario 4: Nivel de aislamiento serializable
-- 22
set implicit_transactions off;
set transaction isolation level serializable;
begin transaction t7;
Select avg(Nota) from Lleva;
-- 24
Select avg(Nota) from Lleva;
commit transaction t7;