该怎么做...给我一些想法......这是我的实验室计划。 [英] how to do it... give me some idea... this is my lab program.
问题描述
1。考虑一个书店的分布式数据库,其中有4个站点,分别为S1,S2,S3和S4。
考虑以下关系:
书籍(ISBN,主要作者,主题,总数库存,价格)
书店(商店号,城市,州,邮编,库存价值)
库存(商店号,ISBN,数量)
总库存是库存和库存中的总库存数量值是商店的总库存价值。
考虑到书籍按价格数量分段:
F1:书籍:价格高达20美元
F2:书籍:价格从20.01美元到50美元
F3:书籍:价格从50.01美元到$ 100
F4:书籍:价格100.01美元及以上
同样,书店按邮政编码分为:
S2:书店:邮编25001到50000
S3:书店:Zip 50001到75000
S4:书店:Zip 75001到99999
任务:编写以下SQL查询
1.在e中插入和显示详细信息ach table。
2.查看价格在15美元到55美元之间的库存书籍。
3.更新书籍No = 1234的书籍价格从$ 45在S3站点$ 55.
4.在S2站点查找书籍总数。
2使用等待图实现分布式数据库的死锁检测算法
并使用以下信息进行测试。
考虑五个事务T1,T2,T3,T4和T5与
T1在站点S1发起并在站点S2产生代理
T2在站点S3发起并在站点S1产生代理
T3发起于站点S1并在站点S3产生代理
T4在站点S2发起并在站点S3产生代理
T5在站点S3发起
这些交易的锁定信息如下表所示
交易数据项锁定
按交易
数据项交易是
等待
网站涉及
运营
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
为每个站点生成本地等待图并构建全局等待图表和
检查死锁。
20
F2:图书:价格来自
20.01 to
50
F3:图书:价格来自
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.
20
F2: Books: price from
20.01 to
50
F3: Books: price from
这篇关于该怎么做...给我一些想法......这是我的实验室计划。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!