Professional Documents
Culture Documents
Assignment Title:
Submitted to:
MD ANSARUL ISLAM
Lecturer
Dept. of Computer Science and Engineering
Green University of Bangladesh
(1)To maintain the consistency of database during
transactions which properties are used? Briefly explain
each property.
Example:
T1 T2
Read(B_bal) Read(B_bal)
B_bal*=0.2 B_bal +=20
Write(B_bal) Write(B_bal)
Ans:
Conflict Serialzability : If a given non-serial schedule can be converted
into a serial schedule by swapping its non-conflicting operations, then it is
called as a conflict serializable schedule.
T1 T2 T1 T2
Read(X) Write(X)
Swap
Read(Y) Write(Y)
Write(X) Read(X)
Write(Y) Read(Y)
Schedule S Schedule S’
T1 T2 T1 T2
Read(A) Read(A)
Read(A) Read(A)
Read(B) Read(B)
Schedule S Schedule S’
Joy
101
Mehedi
102
HASHING
Rifath
103
Nila
104
Here a user does not find any match in his search for Course_name without
the Course_Id.For the partial fuctional dependency the user may find this
table given below.
Std_Id Std_Name Course_ Id
For,Course_Name user can just only apply the query for the Course_Id in
spite of Stud_Id and it will show the Course_Name in the table.
For the Grade attribute we both need the Std_Id and Course_Id.
Std_IdStd_Name,Course_Id.
Course_IdCourse_Name(Partial Fuctional Dependency).
Std_Id,Course_IdGrade.
Course_Id Course_Name Std_Id Course_Id Grade
T1 T2
R(A)
W(A)
R(A)
R(B)
R(B)
W(B)
Now after the first swap we can swap again for the R(B) of T1 and R(A) of
T2.After the swap R(B) of T1 takes place of R(A) of T2 and R(A) of T2 takes
the place of R(B) of T1.They are not conflicting.
T1 T2
R(A)
W(A)
R(B)
R(A)
R(B)
W(B)
After that we are going to swap W(B) of T1 and R(B) of T2 and now the
transaction can not be done because swapping for W(B) of T1 and R(B) of T2
are conflicting.
So by doing the swapping between 2 non-conflict operation and 1 conflicting
operation we can say that the avobe transaction cannot be serialized .So it is
not conflict serializable schedule.
The End