欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    数据库模拟试题及答案(英文)(共7页).doc

    • 资源ID:14245738       资源大小:114KB        全文页数:7页
    • 资源格式: DOC        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    数据库模拟试题及答案(英文)(共7页).doc

    精选优质文档-倾情为你奉上Exam of Database Technology & Applications 1. Describe the three levels and data independence.2. What are key constraints and foreign constraints?3. Explain LEFT JOIN, OUTER JOIN and INNER JOIN.4. For the following relation schema and sets of FDs: R is (A, B, C, D, E, F,G) with FDs A-> B, B-> C, A-> E, CD->G.1) Identify the candidate key(s) for R.2) Identify the best normal form that R satisfies3) Decompose it in 3NF if necessary.5. Explain the ACID properties.6. Notown Records has decided to store information about musicians who perform on its albums (as well as other company data) in a database. The company has chosen to hire you as a database designer.l Each musician that records at Notown has an SSN, a name, an address, and a phone number. l Each instrument used in songs recorded at Notown has a name (e.g., guitar, synthesizer,flute) and a musical key (e.g., C, B-flat, E-flat).l Each album recorded on the Notown label has a title, a copyright date, a format (e.g.,CD or MC), and an album identifier.l Each song recorded at Notown has a title and an author.l Each musician may play several instruments, and a given instrument may be played by several musicians.l Each album has a number of songs on it, but no song may appear on more than one album.l Each song is performed by one or more musicians, and a musician may perform a number of songs.l Each album has exactly one musician who acts as its producer. A musician may produce several albums, of course.1) Defining the completed E-R diagram.2) Defining information for each relation.7. Consider the following relational schema and give T-SQL expressions for the following queries.Sailors(sid, sname, age) Boats(bid, bname, color)Reservers(sid, bid , day)1)Create the table Sailors (sid, sname , age). It includes the domain of values associated with each attribute and integrity constraints. sidINTNOT NULLPRIMARY KEYsnameVARCHAR(10)NOT NULLageINTNULL0<age<1002) Change the attribute sname VARCHAR(12).3) Delete all tuples in the Sailors relation for sailors whose age is less than 18. 4) Find the names of sailors who have reserved a boat on 2010-1-1.5) Find the names of sailors who have reserved a red boat.6) Find the names of sailors who have reserved at least one boat.7) Find the sid of sailors who have reserved a red boat and a green boat.8) Find the names of sailors who have reserved all boats.8. Consider the Buys_computer Relation shown in Figure 1. The first four columns show the age and salary of a potential customer and the Buys_computer column shows whether the person buys a computer. We want to use this data to construct a decision tree that helps predict whether a person will buy a computer.AgeSalarySubscriptionyouthhighnoyouthhighnomiddle_agedhighyesseniormediumyesseniorlowyesseniorlownomiddle_agedlowyesyouthmediumnoyouthlowyesseniormediumyesyouthmediumyesmiddle_agedmediumyesmiddle_agedhighyesseniormediumnoFigure 1 The Buys_computer RelationANSWER1. The three levels are physical level, logical level and view level. Physical level describes all relations that are stored in the database. Logical level summarizes how the relations are actually stored on secondary storage devices. Each view level consists of a collection of one or more views and relations from the conceptual level.There are actually two mappings: the conceptual/internal mapping and the external/conceptual mapping. The conceptual/internal mapping lies between the conceptual and internal levels. If the structure of the stored database is changed, then the conceptual/ internal mapping must also be changed accordingly so that the view from the conceptual level remains constant. It is this mapping that provides physical data independence for the database.The external/conceptual view lies between the external and conceptual levels. If the structure of the database at the conceptual level is changed, then the external/conceptual mapping must change accordingly so the view from the external level remains constant. It is this mapping that provides logical data independence for the database.2. Primary key constraints assure that the keys of any two records are not same in a table. The primary key constraints enforce the entity integrity of the table.Foreign key constraints control the data that can be stored in the foreign key table, it also controls changes to data in the primary key table. This constraint enforces referential integrity by ensuring that changes cannot be made to data in the primary key table if those changes invalidate the link to data in the foreign key table. 3. The LEFT OUTER JOIN includes all rows in the left table in the results, whether or not there is a match on the join column in the right table. FULL OUTER JOIN includes all rows from both tables, regardless of whether or not the other table has a matching value.This INNER JOIN is known as an equi-join. It returns all the columns in both tables, and returns only the rows for which there is an equal value in the join column.4.1)(A,D) is the primary key for R2) R1NF3) R1(A,B,E) ,R2(B,C,F),R3(C,D,G)5. Atomicity: This property guarantees that a set of records that are part of a transaction is indivisible. Thus either all operations of the transaction are properly reflected in the database or none are.Consistency: Database consistency is the property that every transaction sees a consistent database instance. Database consistency follows from transaction atomicity, isolation, and transaction consistency.Isolation: Although multiple transactions may execute concurrently, each transaction must be unaware of other concurrently executing transactions. Intermediate transaction results must be hidden from other concurrently executed transactions. Durability: After a transaction completes successfully, the changes it has made to the database persist, even if there are system failures.6.1)pruducenmm1mm1musicianinstrumentalbumsongperformplaycontainn2)musician (SSN, m_name, address, phone number.)instrument ( i_name, musical key)album (a_title, copyright date, format , album identifier, SSN)song ( s_title, author, a_title)play(SSN,i_name)produce(SSN, s_title)7. 1)CREATE TABLE Sailors(sid INT PRIMARY KEY,sname VARCHAR(10) NOT NULL,age INT CHECK( age BETWWEN 0 AND 100)2) ALTER TABLE Sailors ALTER COLUMN sname VARCHAR(12)3) DELETE FROM Sailors WHERE age<184) SELECT sname FROM Sailors S JOIN Reserves R ON S.sid=R.sidWHERE rday='2010-1-1'5) SELECT sname FROM Sailors S JOIN Reserves R ON S.sid=R.sid JOIN Boats B ON B.bid=R.bid WHERE color='red'6) SELECT sname FROM Sailors S JOIN Reserves R ON S.sid=R.sid 7) SELECT sname FROM Sailors S1 JOIN Reserves R1 ON S1.sid=R1.sid JOIN Boats B1 ON B1.bid=R1.bid WHERE B1.color='red' AND sid IN (SELECT sid FROM Sailors S2 JOIN Reserves R2 ON S2.sid=R2.sid JOIN Boats B2 ON B2.bid=R2.bid WHERE B2.color='green' )8) SELECT sname FROM Sailors SWHERE NOT EXISTS (SELECT * FROM Boats B WHERE NOT EXISTS(SELECT * FROM Reserves R WHERE R.bid=B.bid AND R.sid=S.sid)8.Info(D)= log2()log2()=0.940Infoage(D)= ×(log2()log2() + ×(log2()log2())+×(log2()log2()=0.694Gain(age)= Info(D)Infoage(D)=0.246Infosalary(D)= ×(log2()log2() ) + × (log2()log2() +×(log2()log2()=0.911Gain(salary)= Info(D)Infosalary(D)=0.029seniormiddle_agedyouthagesalarysalaryclassclasshighhighmediummediumlownononoyesnomediummediummediumlowlowyesyesnoyesnosalaryclasshighhighmediumlowyesyesyesyes专心-专注-专业

    注意事项

    本文(数据库模拟试题及答案(英文)(共7页).doc)为本站会员(飞****2)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开