中科大高级数据库系统作业答案2015
(完整word版)2015年数据库期末考试试题和答案
![(完整word版)2015年数据库期末考试试题和答案](https://img.taocdn.com/s3/m/a23f0dcdbcd126fff6050b9a.png)
试题一一、单项选择题(本大题共20小题,每小题2分,共40分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。
错选、多选或未选均无分.1. 数据库系统的核心是( B )A.数据库B.数据库管理系统C.数据模型D.软件工具2。
下列四项中,不属于数据库系统的特点的是(C )A.数据结构化B.数据由DBMS统一管理和控制C.数据冗余度大D.数据独立性高3.概念模型是现实世界的第一层抽象,这一类模型中最著名的模型是( D )A.层次模型B.关系模型C.网状模型D.实体—联系模型4。
数据的物理独立性是指( C )A.数据库与数据库管理系统相互独立B.用户程序与数据库管理系统相互独立C.用户的应用程序与存储在磁盘上数据库中的数据是相互独立的D.应用程序与数据库中数据的逻辑结构是相互独立的5.要保证数据库的逻辑数据独立性,需要修改的是( A )A.模式与外模式之间的映象B.模式与内模式之间的映象C.模式D.三级模式6.关系数据模型的基本数据结构是(D )A.树B.图C.索引D.关系7.有一名为“列车运营"实体,含有:车次、日期、实际发车时间、实际抵达时间、情况摘要等属性,该实体主码是( C )A.车次B.日期C.车次+日期D.车次+情况摘要8.己知关系R和S,R∩S等价于( B )A。
(R—S)-S B. S-(S—R)C。
(S-R)-R D。
S—(R—S)9.学校数据库中有学生和宿舍两个关系:学生(学号,姓名)和宿舍(楼名,房间号,床位号,学号)假设有的学生不住宿,床位也可能空闲。
如果要列出所有学生住宿和宿舍分配的情况,包括没有住宿的学生和空闲的床位,则应执行( A )A。
全外联接B. 左外联接C. 右外联接D。
自然联接10.用下面的T-SQL语句建立一个基本表:CREATE TABLE Student(Sno CHAR(4)PRIMARY KEY,Sname CHAR(8) NOT NULL,Sex CHAR(2),Age INT)可以插入到表中的元组是( D )A。
2015上半年数据库系统工程师考试真题及答案-下午卷
![2015上半年数据库系统工程师考试真题及答案-下午卷](https://img.taocdn.com/s3/m/675ac39c58f5f61fb636660e.png)
2015上半年数据库系统工程师考试真题及答案-下午卷试题一【说明】某大学为进一步推进无纸化考试,欲开发一考试系统。
系统管理员能够创建包括专业方向、课程编号、任课教师等相关考试基础信息,教师和学生进行考试相关的工作。
系统与考试有关的主要功能如下。
(1)考试设置。
教师制定试题(题目和答案),制定考试说明、考试时间和提醒时间等考试信息,录入参加考试的学生信息,并分别进行存储。
(2)显示并接收解答。
根据教师设定的考试信息,在考试有效时间内向学生显示考试说明和题目,根据设定的考试提醒时间进行提醒,并接收学生的解答。
(3)处理解答。
根据答案对接收到的解答数据进行处理,然后将解答结果进行存储。
(4)生成成绩报告。
根据解答结果生成学生个人成绩报告,供学生查看。
(5)生成成绩单。
对解答结果进行核算后生成课程成绩单供教师查看。
(6)发送通知。
根据成绩报告数据,创建通知数据并将通知发送给学生;根据成绩单数据,创建通知数据并将通知发送给教师。
现采用结构化方法对考试系统进行分析与设计,获得如图1-1所示的上下文数据流图和图1-2所示的0层数据流图。
【问题1】使用说明中的词语.给出图1-1中的实体E1—E2的名称。
E1:教师E2:学生本题考查采用结构化方法进行系统分析与设计,主要考查数据流图(DFD)的应用,是比较传统的题目,与往年相比考点类似,要求考生细心分析题目中所描述的内容。
DFD是一种便于用户理解、分析系统数据流程的图形化建模工具。
是系统逻辑模型的重要组成部分。
上下文DFD(顶层DFD)通常用来确定系统边界,将待开发系统本身看作一个大的加工(处理),然后根据谁为系统提供数据流,谁使用系统提供的数据流,确定外部实体。
建模出的上下文DFD中只有唯一的一个加工和一些外部实体,以及这两者之间的输入输出数据流。
在上下文确定的系统外部实体以及与外部实体的输入输出数据流的基础上,建模0层DFD,将上下文DFD中的加工进一步分解,成多个加工,识别这些加工的输入输出数据流,使得所有上下文DFD中的输入数据流,经过这些加工之后变换成上下文DFD的输出数据流。
中科院操作系统高级教程_思考题_2015最新版
![中科院操作系统高级教程_思考题_2015最新版](https://img.taocdn.com/s3/m/7036df9483d049649b66583d.png)
1为什么计算机启动最开始的时候执行的是BIOS代码而不是操作系统自身的代码?计算机启动的时候,内存未初始化,CPU不能直接从外设运行操作系统,所以必须将操作系统加载至内存中。
而这个工作最开始的部分,BIOS需要完成一些检测工作,和设置实模式下的中断向量表和服务程序,并将操作系统的引导扇区加载值0x7C00 处,然后将跳转至0x7C00。
这些就是由bios程序来实现的。
所以计算机启动最开始执行的是bios代码。
2.为什么BIOS只加载了一个扇区,后续扇区却是由bootsect代码加载?为什么BIOS没有把所有需要加载的扇区都加载?对BIOS而言,“约定”在接到启动操作系统的命令后,“定位识别”只从启动扇区把代码加载到0x7c00这个位置。
后续扇区则由bootsect代码加载,这些代码由编写系统的用户负责,与BIOS无关。
这样构建的好处是站在整个体系的高度,统一设计和统一安排,简单而有效。
BIOS和操作系统的开发都可以遵循这一约定,灵活地进行各自的设计。
操作系统的开发也可以按照自己的意愿,内存的规划,等等都更为灵活3.为什么BIOS把bootsect加载到0x07c00,而不是0x00000?加载后又马上挪到0x90000处,是何道理?为什么不一次加载到位?1)因为BIOS将从0x00000开始的1KB字节构建了了中断向量表,接着的256KB字节内存空间构建了BIOS数据区,所以不能把bootsect加载到0x00000. 0X07c00是BIOS设置的内存地址,不是bootsect能够决定的。
2)首先,在启动扇区中有一些数据,将会被内核利用到。
其次,依据系统对内存的规划,内核终会占用0x0000其实的空间,因此0x7c00可能会被覆盖。
将该扇区挪到0x90000,在setup.s中,获取一些硬件数据保存在0x90000~0x901ff处,可以对一些后面内核将要利用的数据,集中保存和管理。
4.bootsect、setup、head程序之间是怎么衔接的?给出代码证据。
高级数据库系统选择题(附答案)
![高级数据库系统选择题(附答案)](https://img.taocdn.com/s3/m/90c80336fd4ffe4733687e21af45b307e871f99c.png)
高级数据库系统选择题(附答案)目录Ordered Indexing and Hashing (1)Buffer Management (3)Bitmap Indices (5)Ordered Indices (7)B+ trees (8)Organization of Records in Files (10)Ordered Indexing and HashingThis set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Ordered Indexing and Hashing”.1. A(n) ___c_____ can be used to preserve the integrity of a document or a message.a) Message digestb) Message summaryc) Encrypted messaged) None of the mentioned2. A hash function must meet ___b____ criteria.a) Twob) Threec) Fourd) None of the mentioned3. What is the main limitation of Hierarchical Databases? ba) Limited capacity (unable to hold much data)b) Limited flexibility in accessing datac) Overhead associated with maintaining indexesd) The performance of the database is poor4. The property (or set of properties) that uniquely defines each row in a table is called the:a) Identifierb) Indexc) Primary keyd) Symmetric key5. The separation of the data definition from the program is known as: ba) Data dictionaryb) Data independencec) Data integrityd) Referential integrity6. In the client / server model, the database: da) Is downloaded to the client upon requestb) Is shared by both the client and serverc) Resides on the client sided) Resides on the server side7. The traditional storage of data that is organized by customer, stored in separate folders in filing cabinets is an example of what type of ‘database’ system? aa) Hierarchicalb) Networkc) Object orientedd) Relational8. The database design that consists of multiple tables that are linked together through matching datastored in each table is called da) Hierarchical databaseb) Network databasec) Object oriented databased) Relational database9. The association role defines: aa) How tables are related in the databaseb) The relationship between the class diagram and the tables in the databasec) The tables that each attribute is containedd) Which attri bute is the table’s primary key10. The purpose of an N-Ary association is: ca) To capture a parent-child relationshipb) To deal with one to many relationshipsc) To deal with relationships that involve more than two tablesd) To represent an inheritance relationshipBuffer Management1. In order to reduce the overhead in retrieving the records from the storage space weuse ba) Logsb) Log bufferc) Medieval spaced) Lower records2. The order of log records in the stable storage ______ a ______ as the order in whichthey were written to the log buffer.a) Must be exactly the sameb) Can be differentc) Is opposited) Can be partially same3.Before a block of data in main memory can be output to the database, all log recordspertaining to data in that block must have been output to stable storage. This is (c)a)Read-write loggingb) Read-ahead loggingc) Write-ahead loggingd) None of the mentioned4. Writing the buffered log to ____d______ is sometimes referred to as a log force.a) Memoryb) Backupc) Redo memoryd) Disk5. The ______b________ policy, allows a transaction to commit even if it has modifiedsome blocks that have not yet been written back to disk.a) Forceb) No-forcec) Steald) No-steal6. ______b________ policy allows multiple updates to accumulate on a block before itis output to stable storage, which can reduce the number of output operations greatly for frequently updated blocks.a) Forceb) No-forcec) Steald) No-steal7.The ______c_____ policy, allows the system to write modified blocks to disk even ifthe transactions that made those modifications have not all committed.a) Forceb) No-forcec) Steald) No-steal8.Locks on buffer blocks are unrelated to locks used for concurrency-control oftransactions, and releasing them in a non-two-phase manner does not have any implications on transaction serializability. This is (a)a) Latchesb) Swap Spacec) Dirty Blockd) None of the mentioned9.The _________c_________ contains a list of blocks that have been updated in thedatabase buffer.a) Latchesb) Swap Spacec) Dirty Blockd) None of the mentioned10.The operating system reserves space on disk for storing virtual-memory pages thatare not currently in main memory; this space is called (b)a) Latchesb) Swap Spacec) Dirty Blockd) None of the mentionedBitmap Indices1. Bitmap indices are a specialized type of index designed for easy querying on_____c______b) Binary digitsc) Multiple keysd) Single keys2. A ___a____ on the attribute A of relation r consists of one bitmap for each value that Acan take.a) Bitmap indexb) Bitmapc) Indexd) Array3.SELECT *FROM rWHERE gender = ’f’ AND income level = ’L2’;In this selection, we fetch the bitmaps for gender value f and the bitmap for income level value L2, and perform an ___d___ of the two bitmaps.a) Unionb) Additionc) Combinationd) Intersection4.To identify the deleted records we use the _____a________a) Existence bitmapb) Current bitmapc) Final bitmapd) Deleted bitmap5.Bitmaps can be used as a compressed storage mechanism at the leaf nodes of____b____ for those values that occur very frequently.a) B-treesc) Bit treesd) Both B-trees and B+-trees6.Bitmaps can be combined with regular B+-tree indices for relations where a fewattribute values are extremely common, and other values also occur, but much less frequently. ba) Bitmap, B-treeb) Bitmap, B+treec) B-tree, Bitmapd) B+tree, Bitmap7.In a B+-tree index ___a___ for each value, we would normally maintain a list of allrecords with that value for the indexed attribute.a) Leafb) Nodec) Rootd) Link8. A tablespace is further broken down into ____b____a) Tablespaceb) Segmentsc) Extentsd) Blocks9.In ordered indices the file containing the records is sequentially ordered, a______a_____ is an index whose search key also defines the sequential order of the file.a) Clustered indexb) Structured indexc) Unstructured indexd) Nonclustered index10.Indices whose search key specifies an order different from the sequential order of thefile are called _____c______ indices.a) Nonclusteredb) Secondaryc) All of the mentionedd) None of the mentionedOrdered Indices1. In ordered indices the file containing the records is sequentially ordered, a_____a______ is an index whose search key also defines the sequential order of the file.a) Clustered indexb) Structured indexc) Unstructured indexd) Nonclustered index2.Indices whose search key specifies an order different from the sequential order ofthe file are called _____c______ indices.a) Nonclusteredb) Secondaryc) All of the mentionedd) None of the mentioned3.An _______a_____ consists of a search-key value and pointers to one or morerecords with that value as their search-key value.a) Index entryb) Index hashc) Index clusterd) Index map4.In a ___a____ clustering index, the index record contains the search-key valueand a pointer to the first data record with that search-key value and the rest of the records will be in the sequential pointers.a) Denseb) Sparsec) Straightd) Continuous5.In a ______a____ index, an index entry appears for only some of the search-keyvalues.a) Denseb) Sparsec) Straightd) Continuous6.Incase the indices values are larger, index is created for these values of the index.This is called (c)a) Pointed indexb) Sequential indexc) Multilevel indexd) Multiple index7. A search key containing more than one attribute is referred to as a ___b______search key.a) Simpleb) Compositec) Compoundd) Secondary8.In B+ tree the node which points to another node is called(d)a) Leaf nodeb) External nodec) Final noded) Internal node9.Insertion of a large number of entries at a time into an index is referred to as_______c___ of the index.a) Loadingb) Bulk insertionc) Bulk loadingd) Increase insertion10.While inserting the record into the index, if the search-key value does not appearin the index. (c)a) The system adds a pointer to the new record in the index entryb) The system places the record being inserted after the other records with thesame search-key valuesc) The system inserts an index entry with the search-key value in the index at theappropriate positiond) None of the mentionedB+ trees1. State true or false: B+ trees are not always balanced trees. ba) Trueb) False2.What are the leaf nodes in a B+ tree? ba) The topmost nodesb) The bottommost nodesc) The nodes in between the top and bottom nodesd) None of the mentioned3.Non-leaf nodes are also called as _____a_____a) Internal nodesb) External nodesc) Middle nodesd) Primary nodes4.The queries used to find all records with search key values in a particular range areknown as ___c_____a) Gap queriesb) Graph queriesc) Range queriesd) None of the mentioned5.Statement 1: Insertion of record might require the change in position of the initialnodes.Statement 2: Deletion of records might require the change in position of the initial nodes. (a)a) Both the statements are trueb) Statement 1 is true but statement 2 is falsec) Statement 2 is true but statement 1 is falsed) Both the statements are false6.If a relation can have more than one record containing the same search key value, thesearch key is said to be a ____b______a) Unique search keyb) Non unique search keyc) Multiple search keyd) Identical search key7.State true or false: The fanout of nodes can be increased by using a technique called____a_____a)Prefix compressionb) Postfix compressionc) Prefix expansiond) Postfix expansion8. Insertion of a large number of entries at a time into an index is referred to as ___a____ of the index.a) Bulk loadingb) Mass insertionc) Quick insertiond) Quick loading9._____b______ are the indices that store the values of some attributes along with the pointers to the recor.a) Binary indicesb) Covering indicesc) Key indicesd) Static indicesOrganization of Records in Files1. If a piece of data is stored in two places in the database, thena) Storage space is wastedb) Changing the data in one spot will cause data inconsistencyc) In can be more easily accessedd) Storage space is wasted & Changing the data in one spotwill cause data inconsistencyAnswer: dExplanation: The database is always consistent and so there is no duplication.2.An audit trail ___________a) Is used to make backup copiesb) Is the recorded history of operations performed on a filec) Can be used to restore lost informationd) None of the mentionedAnswer: bExplanation: This is more useful for all recovery actions.3. Large collection of files are called ____________a) Fieldsb) Recordsc) Databased) SectorsAnswer: cExplanation: The operator tree has a tree like format where the evaluation starts from root of the tree .4. Which of the following hardware component is the most important to the operation of a database management system?a) High resolution video displayb) Printerc) High speed, large capacity diskd) MouseAnswer: cExplanation: All the data are stored in form of memory in the disk.5. Which of the following is not true of the traditional approach to information processinga) There is common sharing of data among the various applicationsb) It is file orientedc) Programs are dependent on the filed) It is inflexibleAnswer: aExplanation: All the data are stored in form of memory in the disk.6. Which of these is not a feature of Hierarchical model?a) Organizes the data in tree-like structureb) Parent node can have any number of child nodesc) Root node does not have any parentd) Child node can have any number of parent nodesAnswer: dExplanation: The data are traversed using several algorithms.7. Which of these data models is an extension of the relational data model?a) Object-oriented data modelb) Object-relational data modelc) Semi structured data modeld) None of the mentionedAnswer: bExplanation: All the data are stored in form of memory in the disk.8. The information about data in a database is called _______a) Metadatab) Hyper datac) Tera datad) None of the mentionedAnswer: aExplanation: Metadata is information about a data.9. A data dictionary is a special file that contains?a) The names of all fields in all filesb) The data types of all fields in all filesc) The widths of all fields in all filesd) All of the mentionedAnswer: dExplanation: The data dictionary is structured in tables and views, just like other database data.10. The DBMS acts as an interface between what two components of an enterprise-class database system?a) Database application and the databaseb) Data and the databasec) The user and the database applicationd) Database application and SQLAnswer: aExplanation: Database application is the interface with the user to access the database.。
数据库高级试题及答案
![数据库高级试题及答案](https://img.taocdn.com/s3/m/1f2b08b5988fcc22bcd126fff705cc1755275f39.png)
数据库高级试题及答案一、单项选择题(每题2分,共10分)1. 在关系数据库中,关系是指()。
A. 属性B. 实体C. 表格D. 域答案:C2. SQL语言中,用于创建新表的命令是()。
A. SELECTB. INSERTC. CREATE TABLED. DROP TABLE答案:C3. 数据库管理系统(DBMS)的主要功能不包括()。
A. 数据定义B. 数据操纵C. 数据备份D. 数据加密答案:D4. 在关系数据库中,表与表之间的联系称为()。
A. 索引B. 视图C. 关系D. 约束答案:C5. 如果一个表中的某个字段只能包含一个值,那么这个字段具有()。
A. 唯一性B. 主键C. 外键D. 索引答案:A二、多项选择题(每题3分,共15分)1. 以下哪些是关系数据库的组成部分?()A. 数据B. 表C. 视图D. 索引答案:ABC2. SQL语言中,以下哪些命令用于数据操纵?()A. SELECTB. INSERTC. UPDATED. DELETE答案:ABCD3. 在数据库设计中,以下哪些是规范化的原则?()A. 第一范式(1NF)B. 第二范式(2NF)C. 第三范式(3NF)D. 反规范化答案:ABC4. 数据库的安全性包括哪些方面?()A. 数据加密B. 用户认证C. 访问控制D. 数据备份答案:ABC5. 以下哪些是数据库的完整性约束?()A. 主键约束B. 外键约束C. 唯一性约束D. 检查约束答案:ABCD三、填空题(每题2分,共10分)1. 在数据库中,用于唯一标识每个记录的字段称为________。
答案:主键2. 用于在两个表之间建立联系的字段称为________。
答案:外键3. 数据库中的________用于限制字段值的类型。
答案:数据类型4. 用于在数据库中存储和检索数据的SQL语句是________。
答案:SELECT5. 用于删除数据库表的SQL语句是________。
中科大高级数据库系统作业答案2015
![中科大高级数据库系统作业答案2015](https://img.taocdn.com/s3/m/2f458a35bcd126fff7050be4.png)
如果系统故障时, 磁盘上记录的Log记录下, 请描述数据库恢复管理器的动作.
a) <U,Start> b) <U,Commit> c) <T,E,50> d) <T,Commit>
1.(a)undo U, undo T (不能是undo T,undo U ) 1. Undo是逆向完成 (b)undo T, redo U 2. Redo是顺序完成 3. 必须先Undo 后Redo (c)undo T, redo U (d)redo T, redo U
3
第二次作业
解:首先完善模型如下: 假定:本地读写的代价可忽略不计; 异地读写操作的代价均相等,记为1
A方案 A1 A2 B方案 5 (r R2) 0 5 (r R2) 0 10(r R2) 10 (r R2) 10 (w R2) 10 (w R2)
A> R1在Site1, R2在Site2, R3在 Site3. B> R1和R2在Site1, R2和R3在 Site3. A1: 在Site1上发出, 读5个 R1 记录, 5个 R2记录 A2: 在Site3上发出, 读5个R3记 录 , 5个R2记录 A3: 在Site2上发出, 读10个R2 记录.
(1) 所有表存放于站点A: 部门1要经常访问所有雇员和项目信息 (2) 因为站点B和C分别属于部门2和3,所以先对DEPARTMENT按DNO水平分片, 取DNO=2、3 分别得到部门2和3的数据存放于站点B和C (3)将EMPLOYEE、PROJECT以及DEPT_LOCATION分别和部门2和3的DEPARTMENT 数据在DNO属性上半连接,得到部门2和3上的EMPLOYEE、PROJECT以及 DEPT_LOCATION数据 5
高级数据库系统及其应用课后习题参考答案
![高级数据库系统及其应用课后习题参考答案](https://img.taocdn.com/s3/m/44d97e375b8102d276a20029bd64783e09127d92.png)
第4章数据存储与组织管理4.1 简要答复以下问题。
(1)描述磁盘空间管理器的主要作用,并说明它与OS文件系统的关系。
(2)解释关系数据库系统中关系表与文件的关系。
(3)如果有一个大文件需要频繁执行顺序扫描,那么,为该文件选择哪种页存储方式最适宜?(4)分别描述持久化指针解引用(dereference)和指针混写的这两个根本过程,它们之间有何联系?(5)说明排序文件中的记录及页的根本存储组织方式。
(6)解释缓冲区管理器处理一个读页请求的过程。
如果被请求页位于缓冲池但未被闩住(pinned),那么情况会怎样?缓冲区管理器何时写一个磁盘页?(7)一个缓存页被闩住〔be pinned〕意味着什么?一般由谁负责给缓存页上闩,由谁负责给缓存页解闩?(8)当一个页请求发生时,如果缓冲池中所有页都是脏页,将会发生什么?(9)与OS缓存管理相比,DBMS缓冲区管理器具有那些独特的重要能力?(10)什么是预取?解释为什么这种策略很重要。
(11)描述两种可能的记录格式,并指明它们的优缺点。
(12)描述两种可能的页格式,说明它们优缺点和适用场合。
【解答】〔1〕磁盘空间管理器支持以页(page)为单位的数据管理,隐藏了下层硬件〔甚至包括OS文件管理〕的细节,且允许高层软件认为DB 数据是一系列以页为单位的磁盘数据集合,是DBMS 体系结构中最低层的软件模块。
DB系统的磁盘空间管理器通常按三种方式来应用OS的文件管理功能:⏹将整个DB存储在一个或几个磁盘文件中,调用OS功能实现流式文件的磁盘R/W。
⏹让OS分配给DB系统一个或几个大的OS文件,然后自己管理〔读/写〕这个文件。
⏹完全自己来管理磁盘。
〔2〕通过磁盘空间管理器,可将DB中的“关系〞映射到“关系数据文件〞,这种“文件〞既可能是实际的OS文件,也可能只是一个虚拟的OS文件。
一些小规模的DB系统实现甚至可能将关系直接存储在单独的OS文件中。
但更多的现代大型DB系统,那么是把所有关系都集中存储在一个或几个大文件中的复杂结构。
中国科学院大学数据库新技术期末复习(提纲+答案整理)
![中国科学院大学数据库新技术期末复习(提纲+答案整理)](https://img.taocdn.com/s3/m/2c35d612443610661ed9ad51f01dc281e53a5602.png)
第1章关系数据库模型和关系运算要求掌握的基本概念和理论1.与网状和层次数据库相比,关系数据库有哪些优点?(1)数据结构单一,不管实体还是实体之间的联系都用关系来表示;(2)建立在严格的数学概念基础上,具有坚实的理论基础;(3)将数据定义和数据操纵统一在一种语言中,使用方便,易学易用。
2.试述关系模型的完整性规则答:关系模型的完整性规则包括:实体完整性、参照完整性、用户定义的完整性。
实体完整性规则是指若属性A是基本关系R的主属性,则属性A不能取空值。
参照完整性:若属性(或属性组)F是基本关系R的外键,它与基本关系S的主码Ks相对应(基本关系R和S不一定是不同的关系),则对于R中每个元组在F上的值必须为:或者取空值(F的每个属性值均为空值);或者等于S中某个元组的主码值。
用户定义的完整性指数据间应满足的语义约束关系,由用户定义,由系统检查。
3.试述等值连接与自然连接的区别和联系答:连接运算符是“=”的连接运算称为等值连接。
它是从关系R与S的广义笛卡尔积中选取A,B属性值相等的那些元组自然连接是一种特殊的等值连接,它要求两个关系中进行比较的分量必须是相同的属性组,并且在结果中把重复的属性列去掉。
4.函数依赖、部分依赖、完全依赖、传递依赖、平凡依赖函数依赖:对X中的任一值x,ΠY (σX=x(r))的值仅有一个元组,则有X→Y。
设FD X→Y,如果对任意的X⊂'X,X'→Y都不成立,则称X→Y是完全函数依赖;若对X的真子集X'有X⊂'X,而X'→Y成立,则称FD X→Y是部分函数依赖。
设关系模式R,X、Y、Z是R的属性子集,若FD X→Y,Y!→X,Y→Z,则有FD X→Z,称FD X→Z为传递函数依赖。
设FD X→Y,如果Y⊄X,则称FD X→Y为非平凡的函数依赖;否则,若Y⊆X,称FD X→Y为平凡的函数依赖。
5.函数依赖公理和推论Armstrong公理:设r是R(U)上的一个关系,X、Y、Z、W⊆U。
数据库作业及参考答案(最新版)
![数据库作业及参考答案(最新版)](https://img.taocdn.com/s3/m/28b76c5a8e9951e79b8927f5.png)
数据库一、单选题:1.数据库系统的核心是()。
A 编译系统B 数据库C 操作系统D 数据库管理系统2.数据库是在计算机系统中按照一定的数据模型组织、存储和应用的()。
A 文件的集合B 数据的集合C 命令的集合D 程序的集合3.数据库DB、数据库系统DBS、数据库管理系统DBMS这三者之间的关系是():A DBS包括DB和DBMSB DBMS包括DB和DBSC DB包括DBS和DBMSD DBS就是DB,也就是DBMS4.数据库管理系统能实现对数据库中数据的查询、插入、修改和删除,这类功能称为()。
A 数据定义功能B 数据管理功能C 数据操纵功能D 数据控制功能5.在数据库的三级模式结构中,描述数据库中全体数据的全局逻辑结构和特性的是()。
A 外模式B 内模式C 存储模式D (概念)模式6.在数据库系统中,当总体逻辑结构改变时,通过改变(),使局部逻辑结构不变,从而使建立在局部逻辑结构之上的应用程序也保持不变,称之为数据和程序的逻辑独立性。
A 应用程序B 模式到内模式的映像C 存储结构D 外模式到概念模式的映像7.按照数据模型分类,数据库系统可以分为三种类型,正确的是():A 大型、中型和小型B 西文、中文和兼容C 层次、网状和关系D 数据、图形和多媒体8.数据模型指的是数据库的组织形式,数据模型的三要素是()。
A 数据库文件、二维表、记录B 字段、类型、宽度C 数据结构、数据操作、完整性约束D 数据定义、数据存储、数据通信9.所谓概念模型,指的是()。
A 客观存在的事物及其相互联系B 将信息世界中的信息进行数据化C 实体模型在计算机中的数据化表示D 现实世界到机器世界的一个中间层次,即信息世界10.在数据库设计中用关系模型来表示实体和实体之间的联系。
关系模型的结构是()。
A 层次结构B 二维表结构 C网络结构D封装结构11.ER图是数据库设计的工具之一,它一般适用于建立数据库的()。
A 概念模型B 结构模型C 物理模型D 逻辑模型12.ER方法的三要素是()。
高级数据库技术复习题及答案(完整)
![高级数据库技术复习题及答案(完整)](https://img.taocdn.com/s3/m/137690f619e8b8f67d1cb908.png)
高级数据库技术复习题一、单项选择题1、DBMS是什么?(B)A、操作系统B、数据库管理系统C、数据库D、数据库管理员2、在数据管理技术的发展过程中,经历了人工管理阶段、文件系统阶段和数据库系统阶段。
在这几个阶段中,数据库独立性最高的是(A)阶段A、数据库系统B、文件系统C、人工管理D、数据项管理3、DBMS主要由下列那两大部分组成(D )A、文件管理器和查询处理器B、存储管理器和数据库语言编辑器B、事务处理器和存储管理器D、查询处理器和存储管理器4、数据库系统的构成为:硬件、数据库集合、数据库管理系统及相关软件以及( A )A、数据库管理员B、数据集合C、操作系统D、文件系统5、关于关系数据库系统描述不正确的是( D )A、可以实现数据共享B、可以减少数据余C、可以表示事物和事物之间的联系D、不支持抽象的数据模型7、关于主键描述正确的是( C )A、包含一列B、包含两列C、包含一列或多列D、包含一行8、数据库的概念模型独立于(A )A、具体的机器和DBMSB、E-R图C、信息世界D、现实世界9、数据库的基本特点是(B )A、数据库可以共享(或数据结构化);数据独立性;数据余大,易移植;统一管理和控制B、数据库可以共享(或数据结构化);数据独立性;数据余小,易扩充;统一管理和控制C、数据库可以共享(或数据结构化);数据互换性;数据余小,易扩充;统一管理和控制D、数据库非结构化;数据独立性;数据余小,易扩充;统一管理和控制10、在数据库中,下列说法( A )不正确A、数据库避免了一切数据的重复B、若系统是完全可以控制的,则系统可确保更新时的一致性C、数据库中数据可以共享D、数据库减少了数据余11、在数据库中存储的是( C )A、数据B、数据模型C、数据以及数据之间的关系D、信息12、数据库中数据共享是指(D )A、同一个应用中的多个程序共享一个数据集合B、多个用户、同一种语言共享数据C、多个用户共享一个数据文件D、多种应用、多种语言、多个用户互相覆盖的使用数据集合13、从关系中挑选除指定的属性组成新关系的运算称为(B)A. “选择”运算B.“投影”运算C.“连接”运算D.“交”运算14、表达计算机实现观点的数据库全局逻辑结构称为( B )A.概念模型B.逻辑模型C.外部模型D.内部模型15、有选修数据结构的学生关系R,选修数据库的学生关系S。
(完整版)数据库练习题及答案解析
![(完整版)数据库练习题及答案解析](https://img.taocdn.com/s3/m/7916d9f9cfc789eb172dc8ef.png)
第一章习题一、单项选择题1 •数据库(DB),数据库系统(DBS)和数据库管理系统(DBMS )之间的关系是(A )。
A. DBS 包括DB 和DBMSB. DBMS 包括DB 和DBSC. DB包括DBS和DBMSD. DBS就是DB,也就是DBMS2. 下面列出的数据库管理技术发展的三个阶段中,没有专门的软件对数据进行管理的是(D )。
I •人工管理阶段II.文件系统阶段III •数据库阶段A. I 和IIB. 只有IIC. II 和IIID. 只有I3. 下列四项中,不属于数据库系统特点的是(C )。
A. 数据共享B. 数据完整性C. 数据冗余度高D. 数据独立性高4. 数据库系统的数据独立性体现在(B )。
A .不会因为数据的变化而影响到应用程序B. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序C. 不会因为存储策略的变化而影响存储结构D. 不会因为某些存储结构的变化而影响其他的存储结构5. 要保证数据库的数据独立性,需要修改的是(C )。
A. 模式与外模式B. 模式与内模式C. 三层之间的两种映射D. 三层模式6. 要保证数据库的逻辑数据独立性,需要修改的是(A )。
A. 模式与外模式的映射B. 模式与内模式之间的映射C. 模式D. 三层模式7. 用户或应用程序看到的那部分局部逻辑结构和特征的描述是(C ),它是模式的逻辑子集。
A.模式B.物理模式C. 子模式D. 内模式8. 下述(B )不是DBA 数据库管理员的职责。
A.完整性约束说明B.定义数据库模式C.数据库安全D.数据库管理系统设计9. 常见的数据模型有三种,它们是(B )A 网状、关系和语义B 层次、关系和网状C 环状、层次和关系D 字段名、字段类型和记录10. 在E-R 图中,用来表示属性的图形是(B )A 矩形B 椭圆形C 菱形D 平行四边形二、填空题1. 描述数据库全体数据的全局逻辑结构和特性的是___________ 模式 ______ 。
2015年软考数据库系统工程师考试真题加答案解析(上午+下午)直接打印
![2015年软考数据库系统工程师考试真题加答案解析(上午+下午)直接打印](https://img.taocdn.com/s3/m/31cc81b31ed9ad51f11df2d5.png)
2015年上半年数据库系统工程师考试上午真题(标准参考答案)单项选择题每题的四个选项中只有一个答案是正确的,请将正确的选项选择出来。
1机器字长为n位的二进制数可以用补码来表示()个不同的有符号定点小数。
A.2nB.2n-1C.2n-1D.2n-1+12计算机中CPU对其访问速度最快的是()。
A.内存B.CacheC.通用寄存器D.硬盘3Cache的地址映像方式中,发生块冲突次数最小的是()。
A.全相联映像B.组相联映像C.直接映像D.无法确定的4计算机中CPU的中断响应时间指的是()的时间。
A.从发出中断请求到中断处理结束B.从中断处理开始到中断处理结束C.CPU分析判断中断请求D.从发出中断请求到开始进入中断处理程序5总线宽度为32bit,时钟频率为200MHz,若总线上每5个时钟周期传送一个32bit的字,则该总线的带宽为()MB/S。
A.40B.80C.160D.2006以下关于指令流水线性能度量的描述中,错误的是()。
A.最大吞吐率取决于流水线中最慢一段所需的时间B.如果流水线出现断流,加速比会明显下降C.要使加速比和效率最大化应该对流水线各级采用相同的运行时间D.流水线采用异步控制会明显提高其性能7()协议在终端设备与远程站点之间建立安全连接。
A.ARPB.TelnetC.SSHD.WEP8安全需求可划分为物理线路安全、网络安全、系统安全和应用安全。
下面的安全需求中属于系统安全的是(),属于应用安全的是()。
A.机房安全B.入侵检测C.漏洞补丁管理D.数据库安全A.机房安全B.入侵检测C.漏洞补丁管理D.数据库安全9王某是某公司的软件设计师,每当软件开发完成后均按公司规定编写软件文档,并提交公司存档。
那么该软件文档的著作权()享有。
A.应由公司B.应由公司和王某共同C.应由王某D.除署名权以外,著作权的其他权利由王某10甲、乙两公司的软件设计师分别完成了相同的计算机程序发明,甲公司先于乙公司完成,乙公司先于甲公司使用。
2015数据库平时作业题
![2015数据库平时作业题](https://img.taocdn.com/s3/m/e7ab721f52ea551810a687c3.png)
数据库平时作业第一章数据库系统引论1.不属于逻辑数据模型的是(A )A E-R模型B 关系模型C 网状模型D 层次模型2、用户看到的现实系统的、描述实际领域的情况的模型是( A )A E-R模型B 关系模型C 逻辑模型D 物理模型3、 MS SQL Server是( D )。
A. 数据库B. 数据库系统C. 数据处理系统D. 数据库管理系统4、下面没有反映数据库优点的是(A )。
A. 数据面向应用程序B. 数据冗余度低C. 数据独立性高D.数据共享性高5、表示数据库的概念模型一般使用(C)。
A. 用户活动图B. 数据流图C. E-R图D. 流程图6、数据库(DB)、数据库系统(DBS)和数据库管理系统(DBMS)三者之间的关系是( A)。
A. DBS包括DB和DBMSB. DBMS包括DB和DBSC. DB包括DBMS和DBSD. DBS就是DB,也就是DBMS7、数据库系统包括数据库、数据库管理系统(DNMS )、数据库管理员(DBA )和各种应用四个部分。
8、用逻辑数据模型描述的模式有:外模式、概念模式或逻辑模式。
9、数据管理技术经历了人工管理、文件系统和数据库三个发展阶段。
10、概念模式是用逻辑数据模型对一个单位的数据的描述。
第二章数据模型1.不属于关系数据模型中的概念是( B )A .主键B 系C 关系D 属性2.有关系:R(A,B,C)PK=A S(D,A) PK=D,FK=A,参照于R的属性A。
关系R和S的元组如图1所示。
指出图1关系S中违反关系完整性规则的元组是(C)A (1,2)B (2,null)C (3,3)D (4,1)3.有一个关系:学生(学号,姓名,系别),规定学号的值域是8个数字组成的字符串,这一规则属于(C)A 实体完整性约束B 引用完整性约束C 一般性完整性约束D 关键字完整性约束4. 在关系运算中,化费时间可能最长的运算是(C)。
A. 投影B. 选择C. 笛卡尔乘积D. 加5. 从关系中挑选满足条件的记录的运算称为( A )。
(完整版)数据库课后部分习题答案2015
![(完整版)数据库课后部分习题答案2015](https://img.taocdn.com/s3/m/e562afb14b35eefdc9d33342.png)
习题15.实体之间联系有哪几种?分别举例说明?答:1:1联系:如果实体集El中每个实体至多和实体集E2中的一个实体有联习,反之亦然,那么El和E2的联系称为“l:1联系”。
例如:电影院的座位和观众实体之间的联系。
1:N联系:如果实体集El中每个实体可以与实体集E2中任意个(零个或多个)实体有联系,而E2中每个实体至多和El中一个实体有联系,那么El和E2的联系是“1:N联系”。
例如:部门和职工两个实体集之间的联系。
M:N联系:如果实体集El中每个实体可以与实体集E2中任意个(零个或多个)实体有联系,反之亦然,那么El和E2的联系称为“M:N联系”。
例如:工程项目和职工两个实体集之间的联系。
7.简述数据库系统的两级映像和数据独立性之间的关系。
答:为了能够在系统内部实现外部级、概念级和内部级3个抽象层次的联系和转换,数据库管理系统在这三级模式之间提供了两层映像:外模式/模式映像定义通常包含在各自外模式的描述中,保证了数据与程序的逻辑独立性,简称数据的逻辑独立性,应用程序是依据外模式编写的;模式/内模式映像包含在模式描述中,此映像是唯一的,它定义了数据全局逻辑结构与存储结构之间的对应关系,它保证了数据与程序的物理独立性,所以称为数据的物理独立性。
习题21.名词解释:超键:能惟一标识元组的属性或属性集,称为关系的超键。
候选键:不含有多余属性的超键,称为候选键。
实体完整性规则:实体的主键值不允许是空值。
参照完整性规则:依赖关系中的外键值或者为空值,或者是相应参照关系中某个主键值。
函数依赖:设有关系模式R(U),X和Y是属性集U的子集,若对于R(U)的任意一个可能的关系r,r中不可能存在两个元组在X上的属性值相等,而在Y上的属性值不等,则称X函数确定Y或Y函数依赖(Functional Dependency,简记为FD)于X,记作X→Y。
无损分解:当对关系模式R进行分解时,R的元组将分别在相应属性集进行投影而产生新的关系。
数据库题作业带答案
![数据库题作业带答案](https://img.taocdn.com/s3/m/a87b2218647d27284a735127.png)
数据库练习题第一章一、单项选择题1. 在数据管理技术的发展过程中,经历了人工管理阶段、文件系统阶段和数据库系统阶段。
在这几个阶段中,数据独立性最高的是()阶段。
A. 数据库系统B. 文件系统C. 人工管理D.数据项管理2. 数据库系统与文件系统的主要区别是()。
A. 数据库系统复杂,而文件系统简单B. 文件系统不能解决数据冗余和数据独立性问题,而数据库系统可以解决C. 文件系统只能管理程序文件,而数据库系统能够管理各种类型的文件D. 文件系统管理的数据量较少,而数据库系统可以管理庞大的数据量3. 在数据库中存储的是()。
A. 数据B. 数据模型C. 数据及数据之间的联系D. 信息4. 数据库的特点之一是数据的共享,严格地讲,这里的数据共享是指()。
A. 同一个应用中的多个程序共享一个数据集合B. 多个用户、同一种语言共享数据C. 多个用户共享一个数据文件D. 多种应用、多种语言、多个用户相互覆盖地使用数据集合5. 数据库(DB)、数据库系统(DBS)和数据库管理系统(DBMS)三者之间的关系是()。
A. DBS包括DB和DBMSB. DBMS包括DB和DBSC. DB包括DBS和DBMSD. DBS就是DB,也就是DBMS6. 数据库管理系统(DBMS)是()。
A. 一个完整的数据库应用系统B. 一组硬件C. 一组系统软件D. 既有硬件,也有软件7. 数据库是在计算机系统中按照一定的数据模型组织、存储和应用的()。
A. 文件的集合B. 数据的集合C. 命令的集合D. 程序的集合8. 支持数据库各种操作的软件系统是()。
A. 命令系统B. 数据库管理系统C. 数据库系统D. 操作系统9. 由计算机硬件、DBMS、数据库、应用程序及用户等组成的一个整体叫()。
A. 文件系统B. 数据库系统C. 软件系统D. 数据库管理系统10. 数据库系统中应用程序与数据库的接口是()。
A. 数据库集合B. 数据库管理系统DBMSC. 操作系统OSD. 计算机中的存储介质11. 在DBS中,DBMS和OS之间关系是()。
2015数据库系统期末试题及答案
![2015数据库系统期末试题及答案](https://img.taocdn.com/s3/m/d7e9f231cd1755270722192e453610661ed95a1b.png)
华南农业大学期末考试试卷(A 卷)2015-2016学年第一学期考试科目: 数据库系统 考试类型:闭卷 考试时间:120 分钟学号 姓名 年级专业Question 1: true-false question (30 points) For each of the followingstatements, indicate whether it is TRUE or FALSE (Using T for TRUE and F for FALSE). You will get 1 point for each correct answer, and 0 point for each wrong or blankanswer. BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!1. Database systems are designed for both defining storage structures and providing mechanisms formanipulation of information.2. Comparing with database system, file-processing system has many disadvantages such like dataredundancy and consistency, concurrent-access anomalies.3. Physical data independence in database means that the user working on the logical level need knownothing about complexity of the physical level of database.4. The overall design of database is the database schema, while collection of data stored in the databaseat a particular moment is an instance of the database.5. The Entity-Relationship data model is often used in logical design phase.6. SQL is a relational language that used as both DDL and DML.7. Metadata is data about data that are stored in data dictionary.8. A tuple is also known as a column in database table.9. A relationship in an ER model can has its own attributes. 10. Composite attributes are not allowed in ER model.11. The closure of a functional dependency set includes all functional dependencies in the set. 12. Dependency preservation is necessary to a practical decomposition algorithm.13. The most common type of relationship encountered in data modeling is ternary relationship. 14. A relational schema R is in BCNF if domains of all attributes of R are atomic.15. A tuple variable is a variable that stands for a tuple, in other words, it is a variable whose domain isthe set of all tuples.16. A foreign key of a relation is a set of attributes (one or more) that allow us to identify a tuple in thatrelation uniquely.17. The set intersection operation can be replacing by a pair of set-difference operations.18. Any relation that is not part of the logical model, but is made visible to a user as a virtual relation, iscalled a view.19. In SQL, the outer join operation defines how tuples in each relation that do not match any tuple in theother relation are treated.20.The main database design phase includes requirement analysis, logical-design and coding phase.21.The concept “relation” in relation model is exactly the same as the concept “entity” in ERmodel.22. A weak entity set cannot participate in relationships like usual entity sets.23. A functional dependency a—0 is trivial if pea.24.Armstrong's axioms are used to calculate the closures of attribute sets.25.Once a transaction is defined, it must be at active, partially committed, failed, aborted or committedstate.26.Serial executions of transaction can improve throughput and resource utilization while add waitingtime.27. A schedule is correct if it is conflict equivalent to a serial schedule, that means it is a serializableschedule.28.2-Phase Locking Protocol ensures serializability and can avoid dead lock.29.In recovery technology, Log must be written before updating is written into database.30.Checkpoint is defined to simplify recovery when a system corruption is occurred.Question 2 single-choice question (2 points for each, and 30 points in total) BE SURE TO WRITE1.Assume R(a, b) and S(b, c) are two relations.Q1: = D,(R S), and Q2: = n ac(R x S)Which of the followings is correct?A.Q1 and Q2 produce the same answer.B.The answer to Q1 is always contained in the answer to Q2.C.The answer to Q2 is always contained in the answer to Q1.D.Q1 and Q2 produce completely different answers.2.Choose the only one correct expression from the followings: ________A. (<> some)三inB. (= all)三not inC. (<> all)三not inD. (= some)三not in3.Let R(x) be the schema of relation R.Q1: SELECT DISTINCT(x) FROM R rrWHERE NOT EXISTS(SELECT * FROM R WHERE x>rr.x);Q2: SELECT MAX(x) FROM R;Then _______ is correct.A.Q1 and Q2 produce the same answer.B.The answer to Q1 is always contained in the answer to Q2.C.The answer to Q2 is always contained in the answer to Q1.D.Q1 and Q2 produce different answers.4.In SQL, a DELETE statement without a WHERE clause:A. delete all data in the table.B. drop the table.C. delete one column in a table.D. Results in a Cartesian product.5.Mapping an E-R diagram into relation schemas can happen in the phase of _______ .A. requirement analysisB. logical designC. conceptual designD. physical design6.If the mapping cardinality from entity set S to entity set T is m-n, then an entity of T isassociated with ____ entity(entities) of S.A. oneB. at most oneC. at least oneD. none of A,B,C is correct7. Let R(A,B,C,D) be a relation schema, and A ^B, C f D, then is wrong. A. AC -BDB. AC -RC. AD -BD. AD f BC8. Let R(A,B,C,D,E) be a relation schema, from the functional dependency set F={A f B, BC -D, C -E}, we can infer that _____________ . A. AC is a candidate key of R B. BC is a candidate key of R C. CD is a super key of RD. none of the above9. Relation among Normal Form is ___________ A. 1NFu 3NF uBCNF B. 3NFu 1NF uBCNF C. BCNFu 3NF u1NF D. 1NFu BCNF u3NF10. Choose the proper choice to make the following query to realize: Find the names of all customers whose street includes the substring “Main”.select customer_namefrom customer where customer_streetA. like 'Main '%'B. like …_Main_'C. like …\Main_'D. like …%Main%'11. Suppose the relation R(A,B,C) has the following four tuples:Which of the following functional dependencies does not hold in R?A. A->BB. BC->AC. C->BD. AB->A12. The main purpose of transaction management is to deal with _________ p roblem(s). A. Concurrency B. Failure C. Memory crash D. both A and B13. If <T i start> and <T i commit> has appeared in the log after the nearest checkpoint to system crash, then transaction T i must be _____________ when system recovery. A. undone B. redone C. deleted D. Neither A or B14. If a transaction T i has obtain an shared lock on data item A, then transition T j cannotA. obtain an exclusive lock on data item AB. obtain a shared lock on data item BC. obtain an exclusive lock on data item BD. obtain an shared lock on data item A15. in 2PL protocol, at ________ stage, A transaction may not obtain locks, but can release locks.A. Growing phaseB. Shrinking phaseC. CommittedD. Aborted Question 3 (13 points) Consider the following database requirement: A laboratory has properties like ID, name, location, rank. A researcher has properties like ID, name, age, skill. A research project has properties like ID,name, budget, and year. The above three entities must satisfy some constraints: Each researcher can be unemployed or employed by one laboratory. One laboratory can employ many researchers. And a researcher can only work at a laboratory at a time. If a researcher is employed, his salaryneeds to be recorded in the database. A laboratory can participate many projects and a project can be shared by many laboratories.(1) Draw ER diagram to illustrate the requirements. And you can make and state necessary assumptions if any. [6 points](2) Translate your ER diagram into relational database schemas, underline primary keys of each relation, and label foreign keys if it has. Be sure using different way to mark primary keys and foreign keys. [4 points](3) write an sql sentence to create table to store information about which project has been shared by which labs. [3 points]Question 4. (16 points) Consider the relational database of a banking enterprise with the following relation schemas, where the primary keys are underlined.branch (branch name, branch_city, assets)customer (customer name, customer_street, customer_city) loan (loan number, branch_name, amount) borrower (customer name, loan number) account (account number, branch_name, balance) depositor (customer name, account number)Give an expression in SQL or in relational algebra expression for each of the following queries. 1) To find all loan number for loans made at the Perryridge branch (that is the name of a certain branch) with loan amounts greater than $1000 in SQL and relational algebra . [4 points]2) Find all customers who have both a loan and an account using relational algebra expression . [3 points]3) Find name of all customers who have at least one loan that the values for amount is null. In SQL [3 points]4) Find the names of all branches where the average account balance is more than $1000 in SQL . [3 points]5) Find all customers that live in the same city with branches they open accounts in SQL. [3 points] Question 5 (11 points) Consider a relation R(A, B, C, D, E) with the set of Functional DependenciesF = { A f BD, BC f E, B f D, D f A }1) Give all candidate keys of R. [4 points] 2) Give a canonical cover of F. [3 points]3) Is R in 3NF? explain why if it is or decompose it into 3NF if not.[4 points]华南农业大学期末考试试卷(A 卷-Answer Sheets )得分and F for FALSE). You will get 1 point for each correct answer, and 0 point for each wrong or blank answer. BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!题号 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 得分 T F T T F T T F T F T F F F T 题号16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 得分FTTTFFFTFTFTFTTQuestion 3 (13 points) (ANSWER IN NOT UNIQUE )(1) Draw ER diagram to illustrate the requirements. And you can make and state necessary assumptions if any. [6 points] (next page)(2) Translate your ER diagram into relational database schemas, underline primary keys of each relation, and label foreign keys if it has. Be sure using different way to mark primary keys and foreign keys. [4 points]Laboratory (ID^Name, Location,rank)Researcher (ID, Name, birthday, skill, hiretime, salary, lab id) project ( ID, name, budget, year)participate (proj id, lab id, proj_lab_budget, proj_lab_year)Here primary key is underlined, and foreign key is underlined by wavy line.(3) write an sql sentence to create table to store information about which project has been shared by which labs. [3 points]Create table participate (proj_id int,得分题号 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 得分B C A A B D D A C D B D B A BQuestion 2 single-choice question (30 points, and 2 for each) BESURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!2015-2016学年第1学期考试科目:Database systemQuestion 1: true-false question (30 points) For each of the followingstatements, indicate whether it is TRUE or FALSE (Using T for TRUEloan_number branch_name=' Perryridge branch' and amount>1000 ( loan)lab_id int, proj_lab_budget real(10,2), proj_lab_year intprimary key (proj_id, lab_id),foreign key proj_id reference project(id), foreign key lab_id reference laboratory(id))Question 4. (16 points) Consider the relational database of a banking enterprise with the following relation schemas, where the primary keys are underlined.branch (branch name, branch_city, assets)customer (customer name, customer_street, customer_city)loan (loan number, branch_name, amount)borrower (customer name, loan number)account (account number, branch_name, balance)depositor (customer name, account number)Give an expression in SQL or in relational algebra expression for each of the following queries. (ANSWER IN NOT UNIQUE )1)To find all loan number for loans made at the Perryridge branch (that is the name of a certain branch) with loan amounts greater than $1000 in SQL and relational algebra. [4 points]Select loan_number from loan where branch_name=' Perryridge branch' andamount>10002)Find all customers who have both a loan and an account using relational algebra expression. [3 points](borrower IV| depositor) customer_name1. ER diagram as follows:3)Find name of all customers who have at least one loan that the values for amountis null. In SQL [3 points]Select distinct customer_name from loan where amount is null4)Find the names of all branches where the average account balance is more than $1000 in SQL. [3 points]Select branch_name from account group by branch_name having avg(balance)>10005)Find all customers that live in the same city with branches they open accounts in SQL.[3 points]Select customer_name, customer_city from ((customer natural join depositor) natural join account) natural join branch where customer_city= branch_cityQuestion 5 (11 points) Consider a relation R(A, B, C, D, E) with the set of Functional DependenciesF = { A - BD, BC - E, B - D, D - A }1)Give all candidate keys of R. [4 points]AC,BC, DC2)Give a canonical cover of F. [3 points] (ANSWER IN NOT UNIQUE )F c = { A - B, BC - E, B 一D, D - A }3)Is R in 3NF? explain why if it is or decompose it into 3NF if not. [4 points] (ANSWERIN NOT UNIQUE )No,decompose it into {R1(AB), R2(BCE),r3(BD),R4(DA)}。
高级数据库系统及其应用答案
![高级数据库系统及其应用答案](https://img.taocdn.com/s3/m/0d922144f7ec4afe04a1df5a.png)
第一章数据库系统导论1.1 简要回答以下问题。
(1)说明数据抽象表示通常需要从哪些方面进行描述?它与数据模型有何关系?(2)对比逻辑数据模型与物理数据模型,说明它们的区别与联系。
(3)简述DBMS 在现代计算机软件中的地位和作用。
(4)与直接采用一组操作系统文件来管理大量数据相比,采用DBMS 来管理大量数据有何优势?列出OS 文件处理系统与OS 的主要不同点。
(5)列举一些你所知道的、不适合用数据库作为数据管理主要解决方案的应用场合。
(6)解释外部模式、内部模式和概念模式之间的差异。
这些不同模式层是如何与逻辑数据独立性以及物理数据独立性的概念相关联的?为什么说逻辑数据的独立性很重要?(7)什么是DBMS 的5 大基本功能?对每类基本功能,如果未实现,将会引发什么问题?(8)在后面几个概念中,哪个在信息表示中起重要的作用?1)数据定义语言;2)数据操纵语言;3)缓冲区管理器;4)数据模型。
答:(1)数据抽象表示通常要从三方面进行描述:结构特征,行为特征和约束特征。
结构特征:通常需引入一组严格定义的概念或基本结构类型,并借助一定的表示法或模型语言来描述。
行为特征:反映系统的操纵部分,即系统与外界的相互作用,描述系统在外界作用下的状态改变方式。
约束特征:指为保证建模系统有意义,在系统各成份之间或状态量间必须保持的一些依存或者依赖规定。
一般通过引入一组约束规则来表达。
数据模型的定义:数据模型是一组可精确、抽象描述数据如何表示(包括描述数据类型结构、数据关系和数据约束等数据结构化部分)的概念集,并可选地包括一组描述数据如何操纵的操作方法集。
通过系统知识的抽象表示,我们可以建立数据模型,进而研究问题。
(2)逻辑数据模型介于概念和物理两种数据模型之间。
它是数据库系统的主要工作模型,故常被简称为数据模型。
逻辑数据模型的典型代表包括关系模型、面向对象模型和对象-关系数据模型。
早期数据库系统中使用的层次模型和网状模型也属于逻辑数据模型。
数据库技术作业和答案(包括习题答案)(精品).doc
![数据库技术作业和答案(包括习题答案)(精品).doc](https://img.taocdn.com/s3/m/eef2908e48d7c1c709a1457b.png)
第1章 绪论一、选择题1.关于数据库的说法不正确的是(A. 一个相互关联的数据集合B. 包含了关于某个企业或组织的信息C.是信息系统的核心和基础D.是一种数据管理的软件2.关于数据库系统的说法不正确的是()。
A. 数据库系统是指引入数据库技术后的计算机系统B.狭义地讲,数据库系统就是数据库管理系统C. 狭义地讲,数据库系统由数据库和数据库管理系统组成D. 广义地讲,数据库系统由数据库、数据库管理系统(及其开发工具)、应用系统、数据 库管理员和用户构成3. 下列不是数据库系统与文件系统的本质区别是()。
A. 数据库系统实现了整体数据结构化,而文件系统只考虑某个具体应用的数据结构B.数据具有较高的共享性,减少了冗余;文件之间基本不能共享,导致数据冗余度高C. 数据库系统中程序与数据的逻辑结构和物理存储相独立,而文件系统中数据逻辑结构 与文件结构紧密联系D.数据由数据库管理系统统一管理和控制4.事务(Transaction )是用户定义的一个数据库操作序列,下列()不是它的特性 A.原子性 B. 一致性C ・ 并发性D持续性 5.下列( )不是数据库中数据的主要结构。
A.数据文件B.数据字典C. 索引D. 散列6.数据库中存储的是()。
A.数据B. 数据间的联系C.数据及数据间的联系D. 数据模型7.下列()是存储在计算机内结构化的数据集合。
A.数据库系统C.数据库管理系统B.数据库 D.文件&下列( )是数据库的两级映像。
A.外模式/模式,模式/内模式B.模式/外模式,外模式/内模式C.模式/内模式,内模式/外模式D.外模式/内模式,内模式/安全模式9.数据的物理独立性是()实现的。
A.外模式/模式映像B.外模式/内模式映像C.模式/内模式映像D.内模式/外模式映像10.下列关于数据模型的说法不正确的是( ).A. 数据模型就是对现实世界数据特征的模拟和抽象B.数据模型是一个描述数据、数据联系、数据语义以及一致性约束的概念工具的集合C.仅反映数据本身D.数据模型是数据库系统的核心和基础,任何一个数据库管理系统均是基于某种数据模型的二、填空题1 .数据处理的核心问题是O2・数据库系统一般由组成。
数据库系统l试题库及答案第10章排序
![数据库系统l试题库及答案第10章排序](https://img.taocdn.com/s3/m/caf038f529ea81c758f5f61fb7360b4c2e3f2ac5.png)
数据库系统l试题库及答案第10章排序第10章排序10.1排序的相关知识一、填空题1.将一个数据元素(或记录)的任意序列,重新排列成一个按关键字有序的序列叫。
2.大多数排序算法都有两个基本的操作:和。
二、选择题1.()排序算法的稳定性是指()。
A.经过排序后,能使关键字相同的元素保持原顺序中的相对位置不变B.经过排序后,能使关键字相同的元素保持原顺序中的绝对位置不变C.排序算法的性能与被排序元素的个数关系不大D.排序算法的性能与被排序元素的个数关系密切2.()关于排序的以下叙述中,正确的是()。
A.稳定的排序方法优于不稳定的排序方法,因为稳定的排序方法效率高B.对同一个线性表使用不同的排序方法进行排序,得到的排序结果可能不同C.排序方法都是在顺序表上实现的,在链表上无法实现排序方法D.在顺序表上实现的排序方法都可以在链表上实现3.()以下不属于内部排序方法的是()。
A. 选择排序B. 插入排序C. 归并排序D. 拓扑排序10.2插入排序一、填空题1.在对一组记录(54,38,96,23,15,72,60,45,83)进行直接插入排序时,当把第7个记录60插入到有序表时,为寻找插入位置至少需比较次。
二、选择题:1.()排序方法中,从未排序序列中依次取出元素与已排序序列(初始时空)中的元素进行比较,将其放入已排序序列的正确位置上的方法,称为( )。
A. 希尔排序B. 冒泡排序C. 插入排序D. 选择排序2.()折半插入排序算法的平均情况下的时间复杂度为( )。
A. O(n)B. O(nlog2n)C. O(n2)D. O(n 3)3.()对含有n个元素的顺序表采用直接插入排序方法进行排序,在最坏情况下所需的比较次数是( )。
A.n-1B. n+1C. n/2D. n(n-1)/2三、简答题1.给出关键字序列{4,5,1,2,8,6,7,3,10,9}的直接插入排序过程。
2.给出关键字序列{4,5,1,2,8,6,7,3,10,9}的希尔排序过程(步长分别为5,2,1)。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2*2
c),选择P1进行优化
21
R’ = R∝S’
A
2
B
3
C
5
1 5
2
6 3
6
8 5
8
d) 选择p3继续进行优化
S’’ = S’ ∝ T’ B C D
最终得到的关系如下:
R(站点X) S(站点Y) T(站点Z)
3
6
5
8
6
3
22
所以选择各站点做连接的代价为: X站点代价=2*3+2*3=12 Y站点代价=3*4+2*3=18 Z站点代价=3*4+2*3=18 故选择X站点作为收集站点代价最低
8
第三次作业
3.6(续) R∝S
S∝R
S∝T
T∝ S
D 6 3 E 6 8 I 9 9
R∝ T 、T∝R 为空
9
第三次作业
10
第三次作业
3.8 解:
1)将Boce站点上的副本传至Toronto站点; 2)在New York站点上求平均工资,传至Toronto 站点; 3)Toronto, Edmonton, Vancouver, Montreal求最 高工资,传至Toronto汇总;
如果系统故障时, 磁盘上记录的Log记录如下, 请描述数据库恢复管理器的动作.
a) <U,Start> b) <U,Commit> c) <T,E,50> d) <T,Commit>
25
1.假设两个事务T 和 U 的 log 记录如下所示:
第五次作业
<T,Start>,<T,A,10>,<U,Start>,<U,B,20>,<T,C,30 >,<U,D,40>,<U,Commit>,<T,E,50>,<T,Commit>
第四次作业
17
第四次作业
方案 使用SJ在R站点 JN 使用SJ在S站点 JN 直接在R站点JN 直接在S站点JN
(1)R本地在A上投影后PJA(R)发送到S (2)S在本地与PJA(R)做SJ后发送回R (3)在R站点完成最后JN (1)S本地在B上投影后PJB(S)发送到R (2)R在本地与PJB(S)做SJ后发送回S (3)在S站点完成最后JN
PJ name JN D#=D#
PJ D#,name D1
PJ D# SL treat=’intensing’ P1
PJ D#,name D2
PJ D# SL treat=’intensing’ P3
PJ D#,name D3
P2 无符合条件的元组
D1 与P3 JN为空
16
D2 与P1 JN为空
D3 与P1 JN为空
Care
全局关系转化为 分段关系
Patient Care
13
第三次作业
(a)
PJ SL Drug=’Aspirin’ ^ Patient.DEPT=’Surgery’ UN JN P#=P# JN P#=P# JN P#=P#
上推UN 下推PJ 和 SL
Patient1 Care1 Patient2 Care2 Patient3 Care3
已知有如下两种段分配: A> R1在Site1, R2在Site2, R3在Site3. B> R1和R2在Site1, R2和R3在Site3. 另已知有如下应用(所有应用的频率相同) A1: 在Site1上发出, 读5个 R1记录, 5个 R2记录 A2: 在Site3上发出, 读5个R3记录 , 5个R2记录 A3: 在Site2上发出, 读10个R2记录. 问: 1. 如果以本地应用为主要设计目标, 那个分配较优? 2. 假定A3改为要修改10个R2记录, 并仍以本地应用为 其设计目标, 则那个分配方案较优?
15
第三次作业
(b)全局关系上的查询表达式 Doctor . Name Patient .Treat ' Intensing ' Doctor Doctor .D #Patient .D # Patient
UN
PJ name JN D#=D#
PJ name JN D#=D#
如果系统故障时, 磁盘上记录的Log记录下, 请描述数据库恢复管理器的动作.
a) <U,Start> b) <U,Commit> c) <T,E,50> d) <T,Commit>
1.(a)undo U, undo T (不能是undo T,undo U ) 1. Undo是逆向完成 (b)undo T, redo U 2. Redo是顺序完成 3. 必须先Undo 后Redo (c)undo T, redo U (d)redo T, redo U
传输代价
(1) C0+C1*Size(A)*Val(A[R]) (2) C0+C1*Size(S)*Card(S)*ρS SJ R
代价和 2C0+350C1 2C0+1150C1
(1) C0+C1*Size(B)*Val(B[S]) (2) C0+C1*Size(R)*Card(R)*ρR SJ S
(1) 所有表存放于站点A: 部门1要经常访问所有雇员和项目信息 (2) 因为站点B和C分别属于部门2和3,所以先对DEPARTMENT按DNO水平分片, 取DNO=2、3 分别得到部门2和3的数据存放于站点B和C (3)将EMPLOYEE、PROJECT以及DEPT_LOCATION分别和部门2和3的DEPARTMENT 数据在DNO属性上半连接,得到部门2和3上的EMPLOYEE、PROJECT以及 DEPT_LOCATION数据 5
即: (R∝(S∝R)) ∞ ((S∝R)∝(T∝(S∝R)) ∞ (T∝(S∝R))
R’
S’ S’’
24
T’
T’
第五次作业
1.假设两个事务T 和 U 的 log 记录如下所示:
<T,Start>,<T,A,10, 25>,<U,Start>,<U,B,20,15>,<T,C,30,20>, <U,D,40,30>,<U,Commit>,<T,E,50,70>,<T,Commit>
14
第三次作业
(a)
UN PJ JN P#=P# PJ JN P#=P#
PJ P#,name Patient1
PJ P# SL Drug=’Aspirin’ Care1
PJ P#,name Patient2
PJ P# SL Drug=’Aspirin’ Care2
12
第三次作业
(a) 全局关系上的查询表达式(列出在Care中使用‘Aspirin’的Patient 名字) Patient . Name Care. Drug ' Aspirin ' Patient . DEPT ' Surgery ' Patient
PJ SL Drug=’Aspirin’ ^ Patient.DEPT=’Surgery’ JN P#=P#
3
第二次作业
解:首先完善模型如下: 假定:本地读写的代价可忽略不计; 异地读写操作的代价均相等,记为1
A方案 A1 A2 B方案 5 (r R2) 0 5 (r R2) 0 10(r R2) 10 (r R2) 10 (w R2) 10 (w R2)
A> R1在Site1, R2在Site2, R3在 Site3. B> R1和R2在Site1, R2和R3在 Site3. A1: 在Site1上发出, 读5个 R1 记录, 5个 R2记录 A2: 在Site3上发出, 读5个R3记 录 , 5个R2记录 A3: 在Site2上发出, 读10个R2 记录.
6
第三次作业
7
第三次作业
3.6
A B C D 2 3 5 6
解:R JN S =
2 3 5 9
1 6 8 3 5 3 5 6 5 3 5 9
2 6 8 3
A B C D E I 2 3 5 6 6 9 1 6 8 3 8 9 5 3 5 6 6 9 2 6 8 3 8 9
R JN S JN T =
(1)S发送到R直接JN
(1)C0+C1*Size(S)*Card(S)
C0+250C1 C0+5000C1
(1)R发送到S直接JN
(1)C0+C1*Size(R)*Card(R)
18
第四次作业
3.7如果习题中的三个关系R,S,T分别位于三 个不同的站点X,Y,Z。若采用基于半连接的 算法计算R∞S∞T,请选择使得传输代价最小 的连接执行站点和确定半连接序列
高级数据库系统作业答疑
2016.1
1
第一次作业
1. 用自己语言定义下列分布式数据库系统中的术语。 全局/局部数据、全局/局部DBMS、 全局外/概念模式等 (第一章)
2. 分布式数据库系统分类?P6-8
3.分布式DBMS具有哪些集中式DBMS不具备的功能? (P15,34)
(见课本)
2
第二次作业
X
Y19
Z
第四次作业
假设每个属性域长度均为1B,考虑所有的半连接
在有益方 案中选择 得益最高 的或者费 用最少的 方案进行 优化