数据库复习计划预习题2(内容答案.).doc
《数据库复习计划预习题2(内容答案.).doc》由会员分享,可在线阅读,更多相关《数据库复习计划预习题2(内容答案.).doc(9页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、/复习题(复习题(2)1、 试分别判断下列图中G1和G2是否互模拟(bisimulation),并说明理由:aaabccbG1=G2=abcabccG1G2ddd答案答案:(1) 在图中标出各点的状态,我们构造关系,可知 G2 可以模拟 G1,下面我们讨论/是否可模拟,在 G2 中有一个 a 变换可对应到 G1 中 2 个变换,即,。但有两个变换 b,c,而在 G1 中仅存在只有 b 或只有 c 的状态点,可知 G1 和 G2 不能互模拟。(2) 如图,标出各状态点,构造有关系可知其中 G1 中的点均可由 G2 中的点模拟,下面我们考虑可知同样其中 G2 中的点均可由 G1 中的点模拟. 所以
2、 G1 和 G2 为互模拟的。2、 给定如下数据图(Data Graph):r1c1c2s2s3s6s7s10company companyname addressnameurladdress“Widget”“Trenton”“Gadget”“www.gp.fr”“Paris”r1c1c2s2s3s6s7s10company companyname addressnameurladdress“Widget”“Trenton”“Gadget”“www.gp.fr”“Paris”p2p1p3s0s1s4s5s8s9person personperson“Smith”namepositionname
3、phonenameposition“Manager”“Jones”“5552121”“Dupont”“Sales”employeemanagesceoworks-forworks-forworks-forceo试给出其 Strong DataGuide 图/答案:答案:r1p1,p2,p3c1,c2s0,s4,s8s1,s9s5s2,s6s3,s7s10p2p1,p3personname positionphonename addressurlceoemployeemanagesworks-forStrong DataGuide 图3、 Consider the relation, r , s
4、hown in Figure 5.27. Give the result of the following query :Figure 5.27 Query 1: select building, room number, time_slo_ id, count(*) from r group by rollup (building, room number, time_slo_ id) Query 1: select building, room number, time_slo_ id, count(*) from r group by cube (building, room numbe
5、r, time_slo_ id)答案:答案:Query 1 返回结果集:为以下四种分组统计结果集的并集且未去掉重复数据。buildingroom numbertime_slo_ idcount(*)产生的分组种数:4 种;/第一种:group by A,B,CGarfield359A1Garfield359B1Saucon651A1Saucon550C1Painter705D1Painter403D1第二种:group by A,BGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D1第三种:group
6、by AGarfield359A2Garfield359B2Saucon651A2Saucon550C2Painter705D2Painter403D2第四种:group by NULL。本没有本没有 group by NULL 的写法,在这里指是为了方便说明,的写法,在这里指是为了方便说明,而采用之。含义是:没有分组,也就是所有数据做一个统计。例如聚合函数是而采用之。含义是:没有分组,也就是所有数据做一个统计。例如聚合函数是 SUM 的话,的话,那就是对所有满足条件的数据进行求和。那就是对所有满足条件的数据进行求和。Garfield359A6Garfield359B6Saucon651A6S
7、aucon550C6Painter705D6Painter403D6Query 2: group by 后带 rollup 子句与 group by 后带 cube 子句的唯一区别就是: 带 cube 子句的 group by 会产生更多的分组统计数据。cube 后的列有多少种组合(注意组 合是与顺序无关的)就会有多少种分组。 返回结果集:为以下八种分组统计结果集的并集且未去掉重复数据。buildingroom numbertime_slo_ idcount(*)产生的分组种数:8 种 第一种:group by A,B,CGarfield359A1Garfield359B1Saucon651A
8、1/Saucon550C1Painter705D1Painter403D1第二种:group by A,BGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D1第三种:group by A,CGarfield359A1Garfield359B1Saucon651A1Saucon550C1Painter705D2Painter403D2第四种:group by B,CGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D
9、1第五种:group by AGarfield359A2Garfield359B2Saucon651A2Saucon550C2Painter705D2Painter403D2第六种:group by BGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D1第七种:group by CGarfield359A2Garfield359B1Saucon651A2Saucon550C1/Painter705D2Painter403D2第八种:group by NULLGarfield359A6Garfield35
10、9B6Saucon651A6Saucon550C6Painter705D6Painter403D64、 Disks and Access TimeConsider a disk with a sector扇区 size of 512 bytes, 63 sectors 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
11、seek time is 9 msec, whereas the track-to-track seek time is 1 msec. Suppose that a page size of 4096 bytes is chosen. Suppose 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 (use these numbers in appropriate places in
12、 your calculation). (a) What is the capacity of the disk? (b) If the file is arranged sequentially on the disk, how many cylinders are needed? (c) How much time is required to read this file sequentially? (d) How much time is needed to read 10% of the pages in the file randomly?Answer:(a) Capacity =
13、 sector size * num. of sectors 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 sectors Each cylinder has 63 * 16
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据库 复习计划 预习 内容 答案
限制150内