Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

  1. Has a deadlock occurred in the schedule? Show the WFG.
  2. Which transaction(s), if any, would abort using Wait-Die technique and when?
  3. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions

Question

Patient goes to registration booth and is registered (3 minutes).

Answered: 1 week ago

Question

Discuss the determinants of direct financial compensation.

Answered: 1 week ago