Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
1. Consider a distributed database for a bookstore with 4 sites called S1, S2, S3 and S4.
Consider the following relations:
Books ( ISBN, primary Author, topic, total Stock, price )
Book Store (store No, city, state, zip, inventoryValue )
Stock (store No, ISBN, Qty )
Total Stock is the total number of books in stock and inventory Value is the total
inventory value for the store in dollars.
Consider that Books are fragmented by price amounts into:
F1: Books: price up to $20
F2: Books: price from $20.01 to $50
F3: Books: price from $50.01 to $100
F4: Books: price $100.01 and above
Similarly, Book Stores are divided by ZIP codes into:
S2: Bookstore: Zip 25001 to 50000
S3: Bookstore: Zip 50001 to 75000
S4: Bookstore: Zip 75001 to 99999
Task: Write SQL query for the following
1. Insert and Display details in each table.
2. Find the total number of books in stock where price is between $15 and $55.
3. Update the book price of book No=1234 from $45 to $55 at site S3.
4. Find total number of book at site S2.


2. Implement deadlock detection algorithm for distributed database using wait-for graph
and test with the following information.
Consider five transactions T1, T2, T3, T4 and T5 with
T1 initiated at site S1 and spawning an agent at site S2
T2 initiated at site S3 and spawning an agent at site S1
T3 initiated at site S1 and spawning an agent at site S3
T4 initiated at site S2 and spawning an agent at site S3
T5 initiated at site S3
The locking information for these transactions is shown in the following table
Transactions Data items locked
by transactions
Data items transaction is
waiting for
Site involved
in operations
T1 X1 X8 S1
T1 X6 X2 S2
T2 X4 X1 S1
T2 X5 - S3
T3 X2 X7 S1
T3 - X3 S3
T4 X7 - S2
T4 X8 X5 S3
T5 X3 X7 S3
Produce local wait for graph for each of the sites and construct global wait for graph and
check for dead lock.
Posted

For Q1 i had solution , i dont no whether it is correct or not


I created four users scott1, scott2,scott3,scott4 and i created tables in each user. I connect each user by giving grant all on table name to user name for all tables. atlast i started to update the table or insert the values and acces the table from all users.
I did in single sys
whether it is correct can any one give suggestion
 
Share this answer
 
Comments
Member 10596539 19-Feb-14 2:53am    
if i want to use multiple system.. then how can i do?
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you get stuck on a specific part, then fine, ask about it. But don't just post up your homework and expect us to do it for you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900