ImageVerifierCode 换一换
格式:DOCX , 页数:20 ,大小:162.50KB ,
资源ID:18493940      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/18493940.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(数据库复习Word下载.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

数据库复习Word下载.docx

1、a)Access timeb)Insertion and deletion timec)Space overheadd)a and b onlye)All of the above6.Which of the following would not be considered a benefit of indexing? (c)-ba)To improve performance during data sorting.b)To insure uniqueness of key values.c)To avoid reading the records when processing quer

2、ies that retrieve only indexed columnsd)To improve performance during large sequential table scans.e)To help query optimizer in cost estimation7.The difference between a dense index and a sparse index is that (c)-ea)a dense index contains keys and pointers for a subset of the records whereas a spars

3、e index contains keys and pointers for every record.b)a dense index can only be a primary index whereas a sparse index can only be a secondary index. c)a dense index contains keys and pointers for each record whereas a sparse index contains keys and pointers for a subset of the records.d)the size of

4、 dense index is always smaller than the size of sparse index.8.For a B+-tree of n = 10, consisting of 3 levels, the maximum number of leaf nodes would be (c)-ba)121b)100c)1000d)36e)100119.Consider this relation: Car(VIN,Year, Model, Price) The car relation contains a total of 10,000 records. The dat

5、a includes the vehicle identification numbers, year, model, and base price for 50 different models over a 40 year period from 1960-1999 (inclusive). Each block of the file contains 20 records. The records in the file are ordered sequentially according to model. It would be possible (without reorgani

6、zing the file) to create a clustered index on attribute: (c)a)Vin b)Year c)Model d)Price 10.A secondary index: (b)a)Must use a tree structure such as a B+-tree or B-tree.b)Must be a dense index.c)Cannot be created on the primary key of a relation.d)All of the above.e)None of the above.11.Consider th

7、e table: rented(cust_no, vid_no, start_date, return_date).Suppose you have created an index with the command:create index indx1 on rented (start_date,returned_date)Strat_date is the main ordering criterion for the index entries; returned_date becomes only important if two entries have the same start

8、_date. Which of the following conditions can be evaluated using the index? (c)-ea.start_date between 15-10-99 and 20-10-99b.returned_date = c.start_date= and returned_date16-10-99d.start_date= or returned_datee.a and c12.When searching a B+-tree for a range of key values (d)a)the search always start

9、s at the root nodeb)the search always ends at a leaf nodec)multiple leaf nodes may be accessede)a and b only13.The insertion of a record in a B+-tree will always cause the height of the tree to increase by one when (c)a)the tree consists of only a root nodeb)the record is to be inserted into a full

10、leaf nodec)all the nodes in the path from the root to the desired leaf node are full before insertiond)all the nodes in the B+-tree are half full二、简答题1.设有下列嵌套关系模式: Emp = (ename, ChildernSet setof(Childern), SkillsSet setof(Skills) Childern = (name, birthday) Birthday = (day, month, year) Skills = (s

11、type, ExamsSet setoff(Exams) Exams = (year,city)假定数据库中包含表emp(Emp)。试用SQL:1999写出下列查询:1)列出所有有一个孩子的生日在三月的员工的姓名;2)列出所有在城市”Xian”参加过技能种类为”typing”的考试的员工的姓名;3)列出关系emp中的所有技能种类;解:a select ename from Emp as e, e.ChildrenSet as c where March in ( select birthday.month from c)b select e.name from Emp as e, e.Skil

12、lsSet as s, s.ExamsSet as x where s.stype=typing and x.city=Xianc select distinct s.stype from Emp as e , e.SkillsSet as s2.试给出第2题中的嵌套关系模式的XML DTD表示,并用Xquery重写第2题中的所有查询。!DOCTYPE Emp ELEMENT Childern (name,birthday)ELEMENT birthday (day,month,year)ELEMENT Skills (stype,Exams+) ELEMENT Exams (year,cit

13、y)ELEMENT ename (#PCDATA) ELEMENT name (#PCDATA)ELEMENT day (#PCDATA)ELEMENT month (#PCDATA)ELEMENT year (#PCDATA)ELEMENT stype (#PCDATA)ELEMENT city (#PCDATA(1)for $a in /db/empchildren/birthday/month=3 return $a/ename(2) for $b in /db/empskills/stype=typing and skills/exams/city=Xi'an return

14、$b/ename(3) for $c in distinct-values(/skills/stype) return $c 3.给定如图3所示的银行数据库中部分基表的SQL数据定义,试写一个SQL触发器执行下列动作:在对帐户(account)进行delete操作时,对帐户的每一个拥有者(customer),检查其是否还拥有其他帐户,如果没有,则将该拥有者从customer中删除。图3 银行数据库中部分基表的SQL数据定义 Create trigger check-delete-trigger after delete on account Referencing old row as oro

15、w For each row Delete from customer Where customer.customer-name not in (select customer-name from depositor where account-number orow.account-number) end4.设有如下所示的Bank DTD: ELEMENT account (acct-no, branch-name, balance)ELEMENT customer(cust-no,cust-name,cust-street, cust-city) ELEMENT depositor (ac

16、ct-no, cust-no) ELEMENT account-number (#PCDATA) similar #PCDATA declaration for branch-name, balance, cust-name, cust-street ,cust-city 试将上述Bank DTD改写为具有ID和IDREF属性类型的DTD。DOCTYPE bankELEMENT bank (account | customer|depositor)+)ELEMENT account(branch-name, balance)ATTLIST account acct-no ID #REQUIRD

17、 ELEMENT customer(cust-name , cust-street, cust-city )ATTLIST customer cust-no ID #REQUIRED ELEMENT depositor ATTLIST depositoracct-no IDREF #REQUIREDcust-no IDREF #REQUIREDELEMENT branch-name(#PCDATA) similar #PCDATA declaration for balance , cust-name , cust-street , cust-city5.a) Is the following

18、 XML file well-formed? If yes, why, and if no, show the wrong parts and modify the XML file so that it becomes well-formed.b) Is the XML file valid? If yes, why, and if no, show the wrong parts and modify the XML file so that it is valid.car.dtd:ELEMENT CAR (OwnerName+, Year, Make, OwnerAddress+)ATT

19、LIST CAR Category (Sport | SUV | Sedan) #REQUIERDELEMENT OwnerName(#PCDATA)ELEMENT Year (#PCDATA)ELEMENT Make (#PCDATA)ELEMENT OwnerAddress (StreetNo, StreetName, City, State,Zip)+ELEMENT StreetNo (#PCDATA)ELEMENT StreetName (#PCDATA)ELEMENT City (#PCDATA)ELEMENT State (#PCDATA)ELEMENT Zip (#PCDATA)

20、car.xml:CAROwnerNameGhost Year1998JunMakeToyotaOwnerAddressStreetNo2113HooverCityLos AngelesStateCAZipCode90089/CAR 解:well-formed XML的定义:所有元素都要正确关闭(空元素:元素/)标记之间不能交叉所有属性指都要加引号,属性要以名值对方式出现其它规定;Start the document with a declaration, surrounded by ? ? ,? XML VERSION = “1.0” STANDALONE = “yes” ?。 Valid X

21、ML的定义是:如果一个文档类型声明(DTD)与一个XML文档相关联,如果该文档符合该DTD,那么该文档被认为是有效的。 a)不是wellformed。没有以.?开头元素 b)次xml文档不是合法的。XML中有以下几个地方与dtd中的定义不符:元素Car的属性Category是必需的,但XML文档中未出现该属性; dtd中未出现标记Zip/Zip6.Consider the following XML files.Parts.xml:xml version=1.0PartsPartNameBarbieSerialNumber1234SellingPrice Unit=Dollar250SupplierNameToy CompanyToysRUS/PartsSuppliers.xml:SuppliersSupplierScore100FreeShippingYes/Supplier/Suppliersa) Display the Supplier names for Parts with SellingPrice higher than 200 Dollars.Notice that if a Supplier s, supplies more than one part with price higher than 200,

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1