Question
Hello, I would like to solve these questions(2,3) today as text, please Question 1 Consider a bank database with this partial schema: Branch(bNo, bAddress, Bphone)
Hello, I would like to solve these questions(2,3) today as text, please
Question 1
Consider a bank database with this partial schema: Branch(bNo, bAddress, Bphone) Customer(cID, name, phone, cAddress) Account(aNo, type, balance, bNo)
Customers Accounts(cID, aNo)
Apply the equivalence rules to generate an optimized final tree of this query: SELECT C.name, C.phone, A.aNo, A.balance
FROM Branch B, Customers Accounts CA, Account A, Customer C
WHERE A.balance > 10,000 AND B. bAddress = "Riyadh" AND C. phone > B.Bphone AND C.cAddress=B. bAddress AND B.bNo=A.bNo AND CA.aNo=A.aNo AND CA.cID=C.cID;
Note: the joins costs are CA on A = 100; 000 records, A on B = 150; 000 and C on CA = 95; 000 records.
Question 2
Consider the following schedule S, consisting of transactions T1, T2 and T3
T1 | T2 | T3 |
begin | ||
begin | ||
begin | ||
Write(A) | ||
Read(A) | ||
Write(B) | ||
Write(B) | ||
Write(B) | ||
commit | ||
Write(A) | ||
Read(B) | ||
Read(B) | ||
commit | ||
commit |
- Draw the precedence graph of transactions to determine whether the schedule is conflict-serializable.
- For the same schedule determine if they are view serializable. If found be view serializable, give a corresponding serial schedule, if not view serializable provide a suitable justification.
Question 3
For the following schedule, determine the following:
- Has a deadlock occurred in the schedule? Show the WFG.
- Which transaction(s), if any, would abort using Wait-Die technique and when?
- Which transaction(s), if any, would abort using Wound-Wait technique and when?
T1 | T2 | |
t1 | begin | |
t2 | begin | |
t3 | Lock-s(y) | |
t4 | Read(y) | |
t5 | Lock-X(x) | |
t6 | Read(x) | |
t7 | Write(x) | |
t8 | Lock-S(x) | |
t9 | Read(x) | |
t10 | Lock-X(y) | |
t11 | Read(y) | |
t12 | Write(y) | |
t13 | Commit/unlock (y,x) | |
t14 | Commit/unlock (x,y) |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started