我对Distributed DataBase有疑问。 [英] I had doubt in Distributed DataBase.

查看:61
本文介绍了我对Distributed DataBase有疑问。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怀疑在分布式数据库中我的实验室程序。



I had doubt In Distributed database my lab program.

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:
S1: Bookstore: Zip up to 25000
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

[Transactions]  [Data items locked   [Data items transaction  [Site involved
                  by transactions]   is waiting for]           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.







请帮帮我....!

提前致谢....!




please help me....!
Thanks in advance....!

推荐答案

20
F2:图书:价格从
20 F2: Books: price from


20.01到


50
F3 :书籍:价格来自
50 F3: Books: price from


这篇关于我对Distributed DataBase有疑问。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆