数据库复习题2(答案)分析解析

更新时间:2023-06-16 19:08:21 阅读: 评论:0

复习题(2
1、 试分别判断下列图中G1G2是否互模拟(bisimulation),并说明理由:
答案
(1) 在图中标出各点的状态,我们构造关系
可知G2可以模拟G1,下面我们讨论
是否可模拟,在G2有一个a变换可对应到G12个变换,即。但休斯顿大学有两个变换bc,而在G1中仅存在只有b或只有c的状态点,可知G1G2不能互模拟。
galfan
(2) 如图,标出各状态点,构造有关系
可知其中G1中的点均可由G2中的点模拟,下面我们考虑
可知同样其中G2中的点均可由G1中的点模拟. 所以G1G2为互模拟的。
2、 给定如下数据图(Data Graph)
试给出其Strong DataGuide

答案:
Strong DataGuide
3、 Consider the relation, r fabricate, shown in Figure 5.27. Give the result of the following query :
Figure 5.27
Query 1:
lect building, room number, time_slo_ id, count(*)
from r
group by rollup (building, room number, time_slo_ id)
Query 1:
lect building, room number, time_slo_ id, count(*)
from r
group by cube (building, room number, time_slo_ id)
答案:
Query 1
返回结果集:为以下四种分组统计结果集的并集且未去掉重复数据。
初二英语辅导
building
room number
time_slo_ id
count(*)
产生的分组种数:4种;
第一种:group by A,B,C
Garfield
359
A
1
Garfield
359wolf是什么意思
B
1
Saucon
651
A
1
fortuneSaucon
550
C
1
Painter
705
D
1
Painter
403
D
1
第二种:group by A,B
Garfield
359
A
2
Garfield
359
B
2
Saucon
651
A
1
Saucon
550
C
1
Painter
705
D
1
Painter
403
D
1
第三种:group by A
Garfield
359
A
2
Garfield
359
B
2
Saucon
651
A
2
Saucon
550
C
2
Painter
705
D
2
Painter
403
D
2
第四种:group by NULL本没有group by NULL 的写法,在这里指是为了方便说明,而采用之。含义是:没有分组,也就是所有数据做一个统计。例如聚合函数是SUM的话,那就是对所有满足条件的数据进行求和。
Garfield
359
A
6
Garfield
359
B
6
Saucon
651
A
6
Saucon
550
C
6
Painter
705
D
6
Painter
403
D
6
Query 2:
group by后带rollup子句与group by后带cube子句的唯一区别就是:
带cube子句的group by会产生更多的分组统计数据。cube后的列有多少种组合(注意组合是与顺序无关的)就会有多少种分组。
返回结果集:为以下八种分组统计结果集的并集且未去掉重复数据。
烛台背后
building
room number
time_slo_ id
count(*)
产生的分组种数:8
第一种:group by A,B,C
Garfield
359
A
1
Garfield
359
B
1
Saucon
651
A
1
Saucon
550
C
1
Painter
705
D
1
Painter
403
D
1
第二种:group by A,B
Garfield
359
A
2
Garfield
359
说明方法B
2
Saucon
651
A
1
Saucon
550
C
1
Painter
705
D
1
Painter
403
D
1
第三种:group by A,C
Garfield
359
A
1
Garfield
359
B
1
Saucon
651
A
1
Saucon
550
C
1
Painter
705
D
2
Painter
403
D
2
第四种:group by B,C
Garfield
359
A
2
Garfield
359
B
2
Saucon
651
A
1
Saucon
550
C
1
Painter
705
D
1
Painter
403
D
1
第五种:group by A
Garfield
359
A
2
Garfield
359
B
2
Saucon
651
A
2
sounorSaucon
550
C
2
Painter
705
D
2
Painter
403
D
2
第六种:group by B
Garfield
359
A
2
Garfield
359
B
2
Saucon
651
A
1
Saucon
550
C
1
Painter
705
D
1
Painter
403
D
1
第七种:group by C
Garfield
359
A
2
Garfield
359
B
1
Saucon
651
A
2
Saucon
550
C
1
Painter
705
D
2
Painter
403
D
2
第八种:group by NULL
Garfield
359
A
6
Garfield
359
B
6
Saucon
651
A
6
Saucon
550
C
6
Painter
705
D
6
Painter
403
D
6
4、 [Disks and Access Time]Consider a disk with a ctor扇区 size of 512 bytes, 63 ctors per track磁道, 16,383 tracks per surface盘面, 8 double-sided platters柱面 (i.e., 16 surfaces). The disk platters rotate at 7,200 rpm (revolutions per minute). The average ek time is 9 mc, whereas the track-to-track ek time is 1 mc.
Suppo that a page size of 4096 bytes is chon. Suppo that a file containing 1,000,000 records of 256 bytes each is to be stored on such a disk. No record is allowed to span two pages (u the numbers in appropriate places in your calculation).
(a) What is the capacity of the disk?
(b) If the file is arranged quentially on the disk, how many cylinders are needed?
(c) How much time is required to read this file quentially?
(d) How much time is needed to read 10% of the pages in the file randomly?
Answer:
(a) Capacity = ctor size * num. of ctors per track * num. of tracks per surface * num of surfaces = 512 * 63 * 16383 * 16 = 8 455 200 768
(b) File: 1,000,000 records of 256 bytes each
Num of records per page: 4096/256 = 16
1,000,000/ 16 = 62,500 pages or 62,500 * 8 = 500,000 ctors
Each cylinder has 63 * 16 = 1,008 ctors
one timeSo we need 496.031746 cylinders.
(c) We analyze the cost using the following three components:
Seek time: This access eks the initial position of the file (who cost can be approximated using the average ek time) and then eks between adjacent tracks 496 times (who cost is the track-to-track ek time). So the ek time is 0.009 + 496*0.001 = 0.505 conds.
Rotational delay:
The transfer time of one track of data is 1/ (7200/60) = 0.0083 conds.
For this question, we u 0.0083/2 as an estimate of the rotational delay (other numbers between 0 and 0.00415 are also fine). So the rotational delay for 497 eks is 0.00415 * 497 = 2.06255.

本文发布于:2023-06-16 19:08:21,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/147295.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:分组   统计   组合   模拟   说明   状态   数据   结果
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图