数据库2014试卷及答案
三级数据库技术真题2014年03月
三级数据库技术真题2014年03月(总分:100.00,做题时间:90分钟)一、选择题(总题数:30,分数:40.00)1.按照数据库应用系统生命周期模型,在开发某数据库应用系统时,对系统采用的软硬件及技术方案等作出合理的评估并提出选择建议的工作属于______。
(分数:1.00)A.规划与分析阶段的系统规划与定义B.规划与分析阶段的可行性分析√C.需求分析阶段的业务规则需求分析D.系统设计阶段的总体设计解析:[解析] 技术可行性是根据用户提出的系统功能、性能及实现系统的各项约束条件,对系统软件、系统硬件、技术方案做出评估和选择建议,它属于规划与分析阶段的可行性分析。
2.关于数据库应用系统的需求分析工作,下列说法正确的是______。
(分数:1.00)A.通过需求分析过程,需要确定出整个应用系统的目标、任务和系统的范围说明B.在需求分析阶段,系统需求分析员要与用户充分沟通,并做出各类用户视图C.数据需求分析的主要工作是要辩识出数据处理中的数据处理流程D.数据操作响应时间、系统吞吐量、最大并发用户数都是性能需求分析的重要指标√解析:[解析] 数据库应用系统的需求包括:数据需求分析、数据处理需求分析,业务需求分析以及其在性能、存储、安全、备份和恢复等方面的要求。
数据操作响应时间、系统吞吐量、最大并发用户数都是性能需求分析的重要指标。
3.下列用于数据库慨念设计的方法是______。
(分数:1.00)A.DFD方法和IDEFIX方法B.E-R方法和IDEF0方法C.E-R方法和IDEFIX方法√D.DFD方法和IDEF0方法解析:[解析] 用户数据库概念设计的方法包括E-R方法和IDEFlX方法等。
4.关于数据库概念设计阶段的工作目标,下列说法错误的是______。
(分数:1.00)A.定义和描述应用系统设计的信息结构和范围B.定义和描述应用系统中数据的属性特征和数据之间的联系C.描述应用系统的数据需求D.描述需要存储的记录及其数量√解析:[解析] 数据库概念设计阶段的工作目标包括定义和描述应用领域涉及的数据范围;获取应用领域或问题域的信息模型;描述清楚数据的属性特征;描述清楚数据之间的关系;定义和描述数据的约束;说明数据的安全性要求;支持用户的各种数据处理需求;保证信息模型方便地转换成数据库的逻辑结构(数据库模式),同时也便于用户理解。
2014.4互联网数据库试题及答案(可编辑修改word版)
⊆ 绝密★考试结束前全国 2014 年 4 月高等教育自学考试互联网数据库试题课程代码:00911请考生按规定用笔将所有试题的答案涂、写在答题纸上。
选择题部分注意事项:1. 答题前,考生务必将自己的考试课程名称、姓名、准考证号用黑色字迹的签字笔或钢笔填写在答题纸规定的位置上。
2. 每小题选出答案后,用 2B 铅笔把答题纸上对应题目的答案标号涂黑。
如需改动,用橡皮擦干净后,再选涂其他答案标号。
不能答在试题卷上。
一、单项选择题(本大题共 15 小题,每小题 2 分,共 30 分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将其选出并将“答题纸”的相应代码涂黑。
错涂、多涂或未涂均无分。
1.在数据模型的三个要素中,用于描述系统静态特性的是A .数据操作B .数据结构C .数据完整性约束D .数据参照2.SQL 语言中的 REVOKE 语句的主要作用是A .结束程序B .返回系统C .收回权限D .提交事务3. JDBC 包含多个类,其中 Java .sql .Time 类属于A .Java JDBC 类B .Java JDBC 接口 C .Java JDBC 异常D .Java JDBC 控制4. 在 CGI 程序中,如果采用 GET 方法传递参数,用来传递查询条件参数的环境变量是A .ENV-STRINGB .CONDITION-STRINGC .CONTENT-STRINGD .QUERY-STRING5. 在 SQL 语句中,与 X BETWEEN 60 AND 90 等价的表达式是A .X>60 AND X<90B .X>=60 AND X< =90C .X>60 AND X< =90D .X>=60 AND X<90 6. 如果关系模式 R(U ,F)中不存在候选码 X 、属性组 Y 以及非属性 Z(Z Y),使得X → Y ,Y → X 和Y →Z 成立,则 R 属于A.3 NF B.4 NFC.5 NF D.BCNF7.在目前的并行数据库体系结构中,实现技术最容易的是A.SN B.SDC.SM D.SK8.在ASP 的内置对象中,从客户端用户提取信息的是A.Session 对象B.System 对象C.Request 对象D.Application 对象9.实体完整性规则规定基本关系中的A.元组不能取空值B.属性不能取空值C.外码不能取空值D.所有主属性都不能取空值10.保护数据以防止未经授权或不合法的使用造成的数据泄露、更改或破坏,是指数据库的A.完整性控制B.安全性控制C.并发控制D.故障恢复11.在数据库设计中,设计用户子模式是在A.需求分析阶段B.概念结构设计阶段C.逻辑结构设计阶段D.物理设计阶段12.在Sybase 开发工具中,基于图形界面的客户/服务器前端应用的工具是A.Power J B.Power+ +C.Power Designer D.PowerBuilder13.在分布式数据库系统中,用户不必关心数据分布的细节,这种性质称为A.分片透明性B.分布透明性C.定位透明性D.位置透明性14.下列不属于数据仓库特征的是A.面向主题的B.集成的C.时变的D.实时更新的15.一个事务的执行不被其他事务干扰,这一特性是指事务的A.隔离性B.一致性C.原子性D.持久性非选择题部分注意事项:用黑色字迹的签字笔或钢笔将答案写在答题纸上,不能答在试题卷上。
2014级《数据库基础及应用》期中综合练习
《数据库基础及应用》期中复习题第1 题: (单选题)数据库技术的根本目标是要解决数据的_____。
[A]存储问题 [B]共享问题[C]安全问题 [D]保护问题答案: B第2 题: (单选题)下面关于关系叙述中,错误的是_____。
[A]一个关系是一张二维表 [B]二维表一定是关系[C]有的二维表不是关系 [D]同一列只能出自同一个域答案: B第3 题: (单选题)一个教师可讲授多门课程,一门课程可由多个教师讲授,则教师实体和课程实体间的联系是_____。
[A]一对一的联系 [B]一对多的联系[C]多对一的联系 [D]多对多的联系答案: D P13 实体集间的联系第4 题: (单选题)层次模型、网状模型和关系模型是根据_____划分。
[A]记录长度 [B]文件的大小[C]联系的复杂程度 [D]数据之间的联系方式答案: D P14第5 题: (单选题)下述不满足第二范式的关系是_____。
[A]院系(院系代码、院系名称、院系简介、负责人)[B]专业(专业代码、专业名称、院系代码、专业简介)[C]修课成绩(学号、课程代码、成绩、成绩性质)[D]学生及课程(学号、姓名、性别、课程代码、课程名称、学分、周学时、上课周数)答案: D P19第二范式简单判断就是不可再分第6 题: (单选题)在E-R图中,用来表示实体之间"联系"的图形是_______。
[A]椭圆形 [B]矩形[C]三角形 [D]菱形答案: D P31实体之间的联系形状第7 题: (单选题)DBMS 提供了_____语言,用于实现数据的插入、更新、删除、检索等任务。
[A]DML [B]DDL [C]DMCL [D]APL答案:A P6 6个方面的功能第8 题: (单选题)假定有关系模式:部门(部门号,部门名称),职工(职工号,姓名,性别,职称,部门号),工资(职工号,基本工资,奖金),级别(职称,对应行政级别),要查找在“财务部”工作的职工的姓名及奖金,将涉及的关系是_____。
2014级《数据库理论与技术》课程期中试卷
宁波工程学院2015–2016 学年第 2 学期《数据库理论与技术》课程期中考试卷一、 单项选择题(每小题1分,共20分)1. ( B )是长期存储在计算机内、有组织的、可共享的数据集合。
A .数据库系统B .数据库C .关系数据库D .数据库管理系统 2. 下面哪个不是数据库系统必须提供的数据控制功能(B )。
A .安全性 B .可移植性 C .完整性 D .并发控制3. 通过修改( C )可以保证数据库的逻辑独立性。
A .模式 B .外模式C .外模式/模式映射D .模式/内模式映射4. 学生社团可以接纳多名学生参加,但每个学生只能参加一个社团,从社团到学生之间的联系种类是( D )。
A.多对多B.一对一C.多对一D.一对多 5. 结构数据模型的三个组成部分中,不包括( C )。
A .完整性规则B .数据结构C .恢复D .数据操作 6. SQL 中,下列涉及空值的操作,不正确的是( C )。
A .AGE IS NULLB .AGE IS NOT NULLC .AGE=NULLD .NOT (AGE IS NULL )7. 设有关系模式R (A ,B ,C ),其关系r 如右表所示: 下面叙述正确的是( B )。
A .函数依赖 A →B 在上述关系中成立 B .函数依赖 BC → A 在上述关系中成立 C .函数依赖 B → A 在上述关系中成立D .函数依赖 A → BC 在上述关系中成立8. 关系数据库规范化是为了解决关系数据库中( A )。
A .插入、删除和数据冗余问题而引入的 B .提高查询速度问题而引入的 C .减少数据操作的复杂性问题而引入的 D .保证数据的安全性和完整性问题而引入的 9. 实现关系代数选择运算的SQL 子句是( D )。
A .SELECTB .ORDER BYC .FROMD .WHERE 10.设关系R 和S 的属性个数分别为2和3,则与关系代数表示式12R S> 等价的是( B )。
数据库2014试卷及答案
华南农业大学期末考试试卷(A卷)2014-2015学年第一学期考试科目:数据库系统考试类型:闭卷考试时间:120 分钟学号姓名年级专业Question 1: true-false question (15 points) For each of the following statements, indicate whether it is TRUE or FALSE (Using √for TRUE and ×for FALSE).1. A primary key is a field (or group of fields) that uniquely describes each record inthe database.2.Data redundancy improves the integrity of a database.3.SQL is the language used by relational databases to create objects and tomanipulate and retrieve data.4. A relational database management system does not include tools for backing up &restoring databases.5.An attribute is also known as a row in most databases.6.An association between entities is known as a relationship.7.Integrity constraints limit the number of entities that can be placed in a table ordatabase.8.The Entity-Relationship data model is often used in the physical design phase.9.The concept “relation” in relation model is exactly the same as the concept“relationship” in ER model.10.Most relationship sets in a database system involves two entity sets.11.The closure of an attribute set contains that attribute set.12.Lossless decomposition is necessary in a decomposition algorithm.13.If A →B and C →D hold, then AC →BD also holds.14.It is not necessary that a legal schedule preserves the order in which theinstructions appear in each individual transaction.15.Update operations in database must be written into log before updating database.Question 2 single-choice question (2 points for each problem, 30 points in total)1. is the only one incorrect description from the followings:A. R=(R-S)∪(R∩S)B. R-S=R-(R∩S)C. R∩S=S-(R-S)D. R∩S=S-(S-R)2. Choose the only one correct expression from the followings: _ ______.A. (≠ some) ≡ inB. (= all) ≡ not inC. exists r ⇔ r ≠ ØD. X-Y ≠Ø ⇔ X ⊆ Y3. of the following four expressions of relational algebra is not equivalent to the other three? They are all based on the relations R(A,B) and S(B,C).A.()S R B A ,∏B. ()S R B ∏C.()S R B R A ⨯∏., D.()()()S R R B A ∏⨯∏⋂4. In the following, assume a is an attribute of some character-string type, e.g. CHAR(10), and that it may be NULL.Q1: SELECT * FROM R WHERE a IS NULL;Q2: SELECT * FROM R WHERE a NOT LIKE '%'; 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.5. The Entity-Relationship data model isA. DBMS dependentB. DBMS independentC. both A and BD. neither A nor B 6. In SQL, an UPDATE statement without a WHERE clause: A. Updates every row in a table. B. Updates no rows in a table. C. Updates every column in a table. D. Results in a Cartesian product.7. If a course can be taught by many teachers, and a teacher can teach only one course, then the mapping cardinality from course to teacher isA. one-to-oneB. one-to-manyC. many-to-oneD. many-to-many8. If there is a many-to-one relationship between entity A and B, then A. there exists a functional dependency from the primary key in B to the primary key in A, i.e., PK(B) → PK(A).B. there exists a functional dependency from the primary key in A to the primary key in B, i.e., PK(A) → PK(B).C. both A and B.D. neither A nor B9. If a functional dependency AB →R holds on relation R(A, B, C), then (A, B) is definitely a ______ of R.A. super keyB. primary keyC. candidate keyD. foreign key10. A relational schema R is in _____ if the domains of all attributes of R are atomicA. 1NFB. 3NFC. BCNFD. 4NF 11. Which one of the following statement is true?A. 3NF is more strict than BCNFB. 4NF is more strict than BCNFC. 1NF is more strict than BCNFD. BCNF is the most strict normal form 12. If a transaction T i has obtain an exclusive lock on data item Q, then transition T j can ______.A. obtain an exclusive lock on data item QB. obtain a shared lock on data item QC. wait for lock granting on data item QD. read or write Q without a lock13. If both <Ti start> and <Ti commit> appear in the log after the nearest checkpoint to system crash, then transaction Ti must be ______ A. undone B. redone C. deleted D. Neither A or B 14. ______ is the final state in a life cycle of a transaction. A. committed B. aborted C. failed D. A or B15. in 2PL protocol, at stage, A transaction may obtain locks, but may not release locks.A. Shrinking phaseB. Growing phaseC. CommittedD. AbortedQuestion 3 (12 points) Consider the following database requirement:A hospital has properties like ID, name, location, rank, capacity. A doctor can be described by ID, name, age, skill. A patient has properties like ID, name, age, sex, address. The above three entities must satisfy some constraints: Each doctor can be unemployed or employed by one hospital. If a doctor is employed, his salary needs to be recorded in the database. A patient can go to many hospitals.1. Draw ER diagram to illustrate the above database requirement [8 points].2. Translate your ER diagram into relational database schemas, and point out the primary keys and foreign keys. You can write your answers in the following format: “R(a1, a2, a3, a4), primary key: a1, foreign key: a4”[4 points].Question 4. (24 points) The following five tables are for a company management system:EMPLOYEE (ID, Name, Birthday, Address, Sex, Salary, Dnumber) DEPARTMENT (Dnumber, Dname, MgrID )PROJECT (Pnumber, Pname, Pcity)WORKS_ON (Pnumber, E-ID, Wdate, Hours)CHILD (E-ID, CHD-ID, CHD_name, Sex, Birthday)1. Based on the giving relations, Specify the following queries using relational algebra (3 points for each).1) List the names of all employees with birthday earlier than …1970-1-1‟ and salary less than $5000.2) List the names of all employees who have a child.3) List the cities and the total number of projects which are located on same city.2. Specify the following operations in SQL(3 points for each).1) Define the table WORKS_ON, declare Pnumber, E-ID, Wdate as the primary key, Pnumber as the foreign key referencing the primary key of project, E-ID as the foreign key referencing the primary key of employee, and ensure that the values of Hours are non-negative with default value 8.2) For each employee working on the …Network‟ project(Pname), increase his/her salary by 5%.3) List the names of all department managers who have no child.4) Find the names of all employees in department 5 (Dnumber) who have worked on both 'X' project and 'Y' project (Pname).5) For each project, find the project number, project name and the total hours (by all employees) spent on that project in Oct. 2009.Question 5 (10 points) Consider a relation R(A, B, C, D, E, F) with the set ofFunctional DependenciesF = { A →BCD, BC →DE, B →D, D →A }pute the Closures of attribute sets A+, C+, E+[3 points].2.Give one candidate key of R [2 points].3.Is F equivalent to { A →BC, BC →E, B →D, D →A } ? [2 points]4.What is the highest normal form of R? Explain your reasons [3 points]. Question 6 (9 points) There are 3 transactions:Consider the following schedule S on transitions set {T1, T2, T3, T4}, with R and W denotes read and write operation respectively.S= R1(A) R2(B)R3(A)R2(C)R4(D)W2(B)R1(B)W1(D)R3(B)W3(B)W2(C)1.List all conflict operation pairs in S [3 points].2.Swapping no-conflict operations to see whether it is a serializable schedule [3points].3.Write all its equivalent serial schedules if S is conflict serializable? Or showwhy if it is not conflict serializable [3 points].华南农业大学期末考试试卷(A 卷-Answer Sheets )2014-2015学年第1 学期 考试科目: Database system 考试类型:(闭卷) 考试时间: 120 分钟 学号 姓名 年级专业Instructions to candidates:1. Write your name, student number and class on both the question papers and the answer papers.2. DO NOT write your answers on the question papers. Write them ALL ON THE ANSWER PAPERS.3. Write your answers in either Chinese or English.4. Hand in all papers (both the question papers and the answer papers).Question 3 (12points)hospital(ID, name, location, rank, capacity), primary key: ID,doctor(ID, name, age, skill, hospitalID, salary), primary key: ID, foreign key: hospitalID refer to hospital(ID)patient (ID, name, age, sex, address), primary key: ID,livein(patientID, hospitalID) primary key: (hospitalID, PatientID), foreign key hospitalID refer to hospital(ID), foreign key patientID refer to patient (ID)Question 4 [24 points]1:1)()()'1970-1-1'5000Name ANDSalary Employee πσ<<Birthday 2)()Name ID E IDEmployee Child π=-∞3) (Pnumber)(Project)citycount G2:1) CREATE TALBE Works_On( Pnumber int,E-ID char(15), Wdate date,Hours int default 8 CHECK (Hours >= 0), PRIMARY KEY (Pnumber, E-ID, Wdate),FOREIGN KEY (E-ID) REFERENCES Employee(ID),FOREIGN KEY (Pnumber) REFERENCES Project(Pnumber), ); 2)UPDA TE Employee SET Salary=Salary *1.05 WHERE ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=‟Network‟);3)SELECT Name FROM Employee, Department WHERE ID=MrgID AND ID NOT IN(SELECT E-ID FROM Child);4)SELECT Name FROM EmployeeWHERE Dnumber=5 AND ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=‟X‟) AND ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=‟Y‟); 5)SELECT Pnumber, Pname, SUM(Hours) FROM Project NATURAL JOIN Works_OnWHERE Wdate BETWEEN …2009-10-1‟ AND …2009-10-31‟ GROUP BY Pnumber, Pname;Question 5 [10 points]1 A +=ABCDE, C + =C, E +=E 2. AF is a candidate key of R3. Yes F equivalent to { A → BC, BC → E, B → D, D → A }4. the highest normal form of R is 1NF. The reason lies in that (1) it is not in BCNF, for A is not a super key but A → BCD. (2) It is not in 3NF for all candidate keys are: DF, AF, BF, so that primary attributes are ABDF. To A → BC, A is not a super key and c is not included in any candidate key therefore it violate rules of 3NF. (3) all attribute are atomic.Question 6 [9 points]1. conflict operation pairs (1)W 2(B)R 1(B) (2) W 2(B)R 3(B) (3)W 2(B)W 3(B) (4) R 1(B)W 3(B) (5) R 2(B) W 3(B) (6) R 4(D) W 1(D)2. S= R 1(A) R 2(B)R 3(A)R 2(C)R 4(D)W 2(B)R 1(B)W 1(D)R 3(B)W 3(B)W 2(C)=> R 2(B)R 1(A) R 2(C) R 3(A) W 2(B) R 4(D) R 1(B)W 1(D)R 3(B) W 2(C)W 3(B) => R 2(B) R 2(C)R 1(A) W 2(B) R 3(A) R 4(D) R 1(B)W 1(D) W 2(C)R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 1(A) R 4(D) R 3(A) R 1(B) W 2(C)W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D)R 1(A) R 1(B) R 3(A) W 2(C) W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) R 1(A) R 1(B) W 2(C) R 3(A) W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) R 1(A) W 2(C)R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) W 2(C)R 1(A) R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) W 2(C)R 4(D) R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) 3. it is a conflict serializable schedule. The equivalent serial schedules are: T 2, T 4, T 1, T 3 or T 4, T 2, T 1, T 3。
2014年10月全国自考数据库及其应用考前密卷和答案02120(含答案)
2014年10月全国自考数据库及其应用考前密卷和答案02120(含答案)一、单项选择题(本大题共20小题,每小题2分,共40分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。
错选、多选或未选均无分。
第1题若关系R属于1NF,且不存在非主属性部分函数依赖于主键,则R属于()A. 1NFB. 2NFC. 3NFD. BCNF【正确答案】 B【你的答案】本题分数2分第2题关系中属性的取值范围称为()A. 域B. 元数C. 元组D. 基数【正确答案】 A【你的答案】本题分数2分第3题由局部E-R图向全局E-R图转换时,需要消除冲突,其中不包括消除()A. 属性冲突B. 结构冲突C. 命名冲突D. 语法冲突【正确答案】 D【你的答案】本题分数2分第4题用来表达用户需求观点的数据库全局逻辑结构的模型称为()A. 逻辑模型B. 外部模型C. 内部模型D. 概念模型【正确答案】 D【你的答案】本题分数2分第5题 Access提供了自定义工作环境命令,若要改变在数据库窗口中鼠标的动作方式(单击或双击),则改变的途径是利用"工具"菜单"选项"命令对话框中的 ()A. "常规"选项卡B. "视图"选项卡C. "键盘"选项卡D. "编辑/查找"选项卡【正确答案】 B【你的答案】本题分数2分第6题设置数据库密码时,应该选择打开数据库的方式是以 ()A. 读写方式打开B. 只读方式打开C. 独占方式打开D. 独占只读方式打开【正确答案】 C【你的答案】本题分数2分第7题下列选项中,用于保证数据库可靠性的措施是 ()A. 复制与粘贴数据库对象B. 备份与还原数据库C. 使用用户级安全机制D. 设置访问数据库的权限【正确答案】 B【你的答案】本题分数2分第8题创建一个人事档案表,其中用于存储照片字段的数据类型应该设置为()A. 超链接B. OLE对象C. 查阅向导D. 备注【正确答案】 B【你的答案】本题分数2分第9题在Access中,若要定义两个字段的组合为主键,则下列说法中正确的是 ()A. 其中一个字段必须为自动编号类型B. 两个字段组合值可以重复C. 两个字段中都不能有空值D. 两个字段都不能有重复值【正确答案】 C【你的答案】本题分数2分第10题假设规定某个日期型字段的取值范围是2008年1月1日到2009年1月1日,则可设置该字段的有效性规则为()A. Between #1/1/2008#And#1/1/2009#B. Between "1/1/2008"And"1/1/2009"C. Between*1/1/2008*And*1/1/2009*D. Between [2008年1月1日] And[2009年1月1日]【正确答案】 A【你的答案】本题分数2分第11题若设置查询准则表达式为:LIKE"P[ABF]###",则满足查询条件的值是 ()A. PAB. P124C. PF123D. PABF【正确答案】 C【你的答案】本题分数2分第12题如果需要反复执行同一查询,但每次查询条件的取值不同,则应该创建一个()A. 参数查询B. 选择查询C. 操作查询D. 更新查询【正确答案】 A【你的答案】本题分数2分第13题有商品表R(商品编码,品名,规格,生产厂家,单价,数量),若要创建一个显示商品信息的窗体,则需指定R为该窗体的()A. 控件来源B. 数据环境C. 属性来源D. 记录源【正确答案】 D【你的答案】本题分数2分第14题假设在窗体中创建了一个标签控件,且需要设置标签中的字体、边框和前/背景颜色等,则应打开标签的"属性"窗口,选择()A. "数据"选项卡B. "格式"选项卡C. "事件"选项卡D. "其他"选项卡【正确答案】 B【你的答案】本题分数2分第15题下列选项中,不属于报表视图的是 ()A. 版面预览视图B. 打印预览视图C. 数据表视图D. 设计视图【正确答案】 C【你的答案】本题分数2分第16题有成绩表S(学号,课程号,分数),如果要在报表中输出每个学生的平均分,则应在报表设计中使用函数()A. =Avg([成绩])B. =Count([成绩])C. =Sum([成绩])D. =Total([成绩])【正确答案】 A【你的答案】本题分数2分第17题下列关于设置数据访问页主题的说法中,错误的是()A. 在Access中主题图形是静态的B. 可以使用主题确定数据访问页的整体风格C. 主题相当于设计数据访问页的模板D. 可以根据主题自动定义数据访问页的数据源【正确答案】 D【你的答案】本题分数2分第18题下列关于数据访问页的说法中,错误的是 ()A. 在"资源管理器"中不能直接打开数据访问页B. 在Access数据库中只保存数据访问页的快捷方式C. 数据访问页是一种直接与数据库连接的网页D. 在IE中使用数据访问页添加和修改的记录将保存在数据库中【正确答案】 A【你的答案】本题分数2分第19题在面向对象程序设计的概念中,类可以分为"容器类"和"控件类",下列选项中属于"控件类"的是()A. 窗体B. 报表C. 选项卡D. 文本框【正确答案】 D【你的答案】本题分数2分第20题下列关于面向对象程序设计概念的说法中,不正确的是()A. 对象特征的描述称为对象的属性B. 事件过程是对事件的一种响应和处理C. 执行对象的方法需要外部事件驱动D. 按钮、文本框、对话框等都视为对象【正确答案】 C二、填空题(本大题共15小题,每小题1分,共15分)请在每小题的空格中填上正确答案。
02120数据库及其应用2014年10月真题及答案
2014年10月高等教育自学考试全国统一命题考试数据库及其应用试卷(课程代码02120)本试卷共6页,满分l00分,考试时间150分钟。
考生答题注意南项:1.本卷所有试题必须在答题卡上作答。
答在试卷上无效,试卷空白处和背面均可作草稿纸。
2.第一部分为选择题。
必须对应试卷上的题号使用2B铅笔将“答题卡”的相应代码涂黑。
3.第二部分为非选择题。
必须注明大、小题号,使用0.5毫米黑色字迹签字笔作答。
4.合理安排答题空间,超出答题区域无效。
第一部分选择题一、单项选择题(本大题共20小题。
每小题2分,共40分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将其选出并将“答题卡”的相应代码涂黑。
未涂、锚涂或多涂均无分。
1.在数据库系统中,数据的正确性和一致性称为数据的A.完整性 B.并发控制 C.安全性 D.恢复2.用来表达用户使用观点的数据库局部逻辑结构称为A.概念模型 B.逻辑模型 C.外部模型 D.内部模型3.有学生(学号,姓名,性别,班级号)和班级(班级号,班级名称,专业)两个关系,下列说法中正确的是A.班级关系的外键是“班级号” B.学生关系的主键是“班级号”C.学生关系的外键是“班级号” D.学生关系的主键是“姓名”A. lNF B.2NF C.3NF D.BCNF5.在Access中,可以创建的数据库对象有A.5种 B.6种 C.7种 D.8种6.数据库设计的正确流程是7.在学生(学号,姓名,性别,班级,所属系)表中,可作为主键的字段是A.学号 B.姓名C.班级D.所属系8.长整型字段占用的空间是A.2个字节 B.4个字节C.8个字节 D.16个字节9.如果要限定学生成绩字段的取值范围,则应设定该字段的A.输入掩码 B.默认值C.有效性规则 D.有效性文本A.一对一 B.一对多C.多对一 D.多对多11.有学生表:S(学号,姓名,性别),其中“学号”字段是由文本氆的9位数字组成。
如果要在S中检索学号第5位是3的学生信息,则查询条件表达式是12.有职工表:R(职工号,姓名,性别,出生年月,职务),基于R创建一个检索职工信息的查询,当输入任意一个职工的姓名,可以显示该职工的信息,则该查询的类型是A.更新查询 B.选择查询C.参数查询 D.追加查询A.单页窗体 B.连续窗体C.控制窗体 D.子窗体14.假设有Access数据库A和SQL Server数据库B,在数据库A中直接访问数据库B中表的方法是A.操作查询B.参数查询C.联合查询 D.传递查询15.下列关于报襄数据源的说法中,正确的是A.报表的数据源只能是表B.报表的数据源可以是表或查询C.报表的数据源可以是表或窗体 D.报表的数据源可以是表、查询和窗体16.有职工考勤表:考勤(职工号,日期,工时),如果要在报表中输出每个职工的总工时,则在计算总工时的文本框中输入表达式17.下列选项中,属于数据访问页的视图是A.页面视图 B.访问视图C.预览视图 D.数据表视图18.下列选项中,专门用于数据访问页的控件是19.用于打开指定窗体的宏操作为A.Open B.OpenFormC.OpenWin D.OpenApp20.判断“图书检索”窗体中“分类”字段值为“自然科学”的宏条件表达式为第二部分非选择题二、填空题(本大题共l5小题,每小题l分,共15分) 请在答题卡上作答。
试卷_数据库试卷kui1
C: SELECT,GROUP
D: 仅 SELECT
序号:156 难度:1 考查点:数据查询
11. (分值:1.0 分)下列说法(
)不正确。
A: 每个数据库可以包含若干个主数据文件
B: 主数据文件的扩展名是:mdf
C: 主数据文件中存放的是数据库的系统信息和用户数据库的数据
D: 每个数据库都只包含一个主数据文件
D: CREATE TRIGGER tgz ON 职工工资表 FOR INSERT AS UPDATE 职工工资表 SET 工资合计=a.基本工资+a.奖金 FROM 职工工资表 a JOIN INSERTED b ON a.职工号=b.职工号 AND a.日期=b.日期 序号:81 难度:3 考查点:SQL Server 数据表
2014年10月全国自考(数据库及其应用)真题试卷(题后含答案及解析)
2014年10月全国自考(数据库及其应用)真题试卷(题后含答案及解析)题型有:1. 单项选择题 2. 填空题 3. 简答题 4. 综合题单项选择题1.在数据库系统中,数据的正确性和一致性称为数据的( )A.完整性B.并发控制C.安全性D.恢复正确答案:A解析:数据的完整性是指数据的正确性和一致性。
2.用来表达用户使用观点的数据库局部逻辑结构,称为( )A.概念模型B.逻辑模型C.外部模型D.内部模型正确答案:C解析:用来表达用户使用观点的数据库局部逻辑结构的模型称为外部模型。
3.有学生(学号,姓名,性别,班级号)和班级(班级号,班级名称,专业)两个关系,下列说法中正确的是( )A.班级关系的外键是“班级号”B.学生关系的主键是“班级号”C.学生关系的外键是“班级号”D.学生关系的主键是“姓名”正确答案:C解析:在关系中凡能唯一标识元组的属性,称为关系模式的候选键。
用户从候选键中选做标识元组的属性称为主键。
如果关系模式R中属性K是其他关系模式的主键,那么K在R中称为外键。
本题中,学生关系的主键是学号,外键是班级号;班级关系的主键是班级号,没有外键。
4.在关系模式R(A,B,C,D)中,有函数依赖A→B,A→D,B→C,则R的规范化程度能达到( )A.1NFB.2NFC.3NFD.BCNF正确答案:B解析:所谓函数依赖是指关系中属性之间取值的依赖情况。
如果关系模式R 的每个关系r的属性值都是不可分的原子值,那么称R为第一范式(1NF)。
显然,本题的关系模式R满足1NF。
对于满足1NF的关系,通过消除非主属性对主键的部分函数依赖,使之达到2NF。
所谓部分依赖指属性C只依赖于主键中的B,而与A无关。
可知本题的关系模式R满足2NF。
对于满足2NF关系,如果不存在非主属性对主键的传递函数依赖,则称属于3NF关系。
本题的关系模式R中的A→B,B→C,存在非主属性对主键的传递函数依赖。
故本题的关系模式R 满不满足3NF。
2014年10月全国自考数据库系统原理考前密卷04735(含答案)
2014年10月全国自考数据库系统原理考前密卷04735(含答案)一、单项选择题(本大题共15小题,每小题2分,共30分)在每小题列出的四个备选项中只有一个是符合题目要求的,请将其代码填写在题后的括号内。
错选、多选或未选均无分。
第1题存储在计算机内、有组织的、统一管理的相关数据的集合,其英文名称是【】A. Data Dictionary(DD)B. Database(DB)C. Database System(DBS)D. Database Management System(DBMS)【正确答案】 B【你的答案】本题分数2分第2题数据库的三层模式结构之间存在着两级映像,使得数据库系统具有较高的【】A. 事务并发性B. 数据可靠性C. 数据独立性D. 数据重用性【正确答案】 C【你的答案】本题分数2分第3题 ER图是数据库设计工具之一,它适用于建立数据库的【】A. 概念模型B. 逻辑模型C. 结构模型D. 物理模型【正确答案】 A【你的答案】本题分数2分第4题下列属于需求分析阶段工作的是【】A. 确定系统范围B. 设计局部概念模型C. 进行数据抽象D. 可行性分析【正确答案】 A【你的答案】本题分数2分第5题在关系中,能唯一标识元组的属性集称为关系模式的【】A. 候选键B. 主键C. 外键D. 超键【正确答案】 D【你的答案】本题分数2分第6题 SQL语言是关系型数据库系统典型的数据库语言,它是【】A. 过程化语言B. 结构化查询语言C. 格式化语言D. 导航式语言【正确答案】 B【你的答案】本题分数2分第7题 ODBC的含义是【】A. 对象关系数据库系统B. 数据库管理系统C. 开放数据库互连D. 对象关系数据库【正确答案】 C【你的答案】本题分数2分第8题提供数据库数据描述的集中管理的是【】A. 数据库模式B. 数据库C. 数据库管理系统D. 数据字典【正确答案】 D【你的答案】本题分数2分第9题 .【正确答案】 C【你的答案】本题分数2分第10题下列说法中正确的是【】A. 封锁的粒度越大,并发度就越小,同时系统的开销也越小B. 封锁的粒度越大,并发度就越大,同时系统的开销也越小C. 封锁的粒度越大,并发度就越小,同时系统的开销也越大D. 封锁的粒度越大,并发度就越大,同时系统的开销也越大【正确答案】 A【你的答案】本题分数2分第11题数据库概念设计的主要任务是【】A. 建立ER图B. 创建数据库说明C. 建立数据流图D. 把数据送入数据库【正确答案】 A【你的答案】本题分数2分第12题在事务依赖图中,若两个事务的依赖关系构成了循环,那么【】A. 系统出现活锁B. 系统出现死锁C. 事务执行成功D. 事务执行失败【正确答案】 B【你的答案】本题分数2分第13题 .【正确答案】 C【你的答案】本题分数2分第14题面向对象数据技术中,枚举型属于【】数据类型。
2014年4月全国自考(数据库及其应用)真题试卷(题后含答案及解析)
2014年4月全国自考(数据库及其应用)真题试卷(题后含答案及解析)题型有:1. 单项选择题 2. 填空题 3. 简答题 4. 综合题单项选择题1.下列选项中,不属于全局E-R模型优化范围的是( )A.消除冲突B.消除冗余属性C.消除冗余联系D.合并相关实体类型正确答案:A解析:全局E-R模型的优化原则有合并相关实体类型、消除冗余属性、消除冗余联系。
2.设关系R有10个元组,关系S有6个元组,则R×S含有的元组个数为( )A.10B.6C.16D.60正确答案:D解析:关系中的行称为元组,元组个数称为基数。
关系中的列称为属性,属性的个数称为元数。
R与S的笛卡尔积等于两者的元组个数之积,即10*6=60。
3.用来表示数据库物理结构的数据模型是( )A.外部模型B.内部模型C.概念模型D.逻辑模型正确答案:B解析:用来表达数据库物理结构的模型称为内部模型。
4.Access的数据库窗口标题栏用来显示( )A.当前打开的数据库文件名B.当前打开的数据库中第一个表名C.数据库中全部表名D.只显示“数据库”三个文字正确答案:A解析:“数据库”窗口标题栏用于显示当前打开的数据库文件名。
5.在Access中,用于定义或修改表结构的界面称为( )A.数据库窗口B.设计视图C.数据表视图D.视图窗口正确答案:B解析:表有两种视图,即数据表视图和设计视图。
数据表视图是供用户输入、查看或编辑数据的窗口;设计视图是用于定义或修改表结构的窗口。
6.Access中关于复制数据库对象的错误描述是( )A.可以在同一数据库内进行复制B.不可以复制到Word文档中C.可以复制到Excel 工作薄中D.在不同数据库之问可以进行复制正确答案:B解析:可以在Access数据库之间复制数据库对象,当然也可以在同一数据库内进行复制,还可以在Access与其他Office文档之间复制数据库对象,因此可以复制到Word文档中,故B项错误。
2014四川省数据库考试含答案基础
1、(1)p->rchild (2)p->lchild (3)p->lchild (4)ADDQ(Q,p->lchild) (5)ADDQ(Q,p->rchild)25. (1)t->rchild!=null (2)t->rchild!=null (3)N0++ (4)count(t->lchild) (5)count(t->rchild)26. .(1)top++ (2) stack[top]=p->rchild (3)top++ (4)stack[top]=p->lchild27. (1)*ppos // 根结点(2)rpos=ipos (3)rpos–ipos (4)ipos (5)ppos+12、两棵空二叉树或仅有根结点的二叉树相似;对非空二叉树,可判左右子树是否相似,采用递归算法。
int Similar(BiTree p,q) //判断二叉树p和q是否相似{if(p==null && q==null) return (1);else if(!p && q || p && !q) return (0);else return(Similar(p->lchild,q->lchild) && Similar(p->rchild,q->rchild))}//结束Similar3、4、void LinkList_reverse(Linklist &L)//链表的就地逆置;为简化算法,假设表长大于2{p=L->next;q=p->next;s=q->next;p->next=NULL;while(s->next){q->next=p;p=q;q=s;s=s->next; //把L的元素逐个插入新表表头}q->next=p;s->next=q;L->next=s;}//LinkList_reverse4、设t是给定的一棵二叉树,下面的递归程序count(t)用于求得:二叉树t中具有非空的左,右两个儿子的结点个数N2;只有非空左儿子的个数NL;只有非空右儿子的结点个数NR和叶子结点个数N0。
2014数据库系统期末试题及答案
华南农业大学期末考试试卷(A卷)2014-2015学年第一学期考试科目:数据库系统考试类型:闭卷考试时间:120 分钟学号姓名年级专业Question 1: true-false question (15 points) For each of the following statements, indicate whether it is TRUE or FALSE (Using √for TRUE and ×for FALSE). You will get 1 point for each correct answer, -0.5 point for each incorrect answer, and 0 point for each answer left blank. Be sure to write your answer in the answer sheet.1. A primary key is a field (or group of fields) that uniquely describes each record inthe database.2.Data redundancy improves the integrity of a database.3.SQL is the language used by relational databases to create objects and tomanipulate and retrieve data.4. A relational database management system does not include tools for backing up &restoring databases.5.An attribute is also known as a row in most databases.6.An association between entities is known as a relationship.7.Integrity constraints limit the number of entities that can be placed in a table ordatabase.8.The Entity-Relationship data model is often used in the physical design phase.9.The concept “relation” in relation model is exactly the same as the concept“relationship” in ER model.10.Most relationship sets in a database system involves two entity sets.11.The closure of an attribute set contains that attribute set.12.Lossless decomposition is necessary in a decomposition algorithm.13.If A →B and C →D hold, then AC →BD also holds.14.It is not necessary that a legal schedule preserves the order in which theinstructions appear in each individual transaction.15.Update operations in database must be written into log before updating database.Question 2 single-choice question (2 points for each problem, 30 points in total)1. is the only one incorrect description from the followings:A. R=(R-S)∪(R∩S)B. R-S=R-(R∩S)C. R∩S=S-(R-S)D. R∩S=S-(S-R)2. Choose the only one correct expression from the followings: _ ______.A. (≠ some) ≡ inB. (= all) ≡ not inC. exists r ⇔ r ≠ ØD. X-Y ≠Ø ⇔ X ⊆ Y 3. of the following four expressions of relational algebra is not equivalent to the other three? They are all based on the relations R(A,B) and S(B,C).A.()S R B A ,∏B. ()S R B ∏C.()S R B R A ⨯∏., D.()()()S R R B A ∏⨯∏⋂4. In the following, assume a is an attribute of some character-string type, e.g. CHAR(10), and that it may be NULL.Q1: SELECT * FROM R WHERE a IS NULL;Q2: SELECT * FROM R WHERE a NOT LIKE '%'; 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.5. The Entity-Relationship data model isA. DBMS dependentB. DBMS independentC. both A and BD. neither A nor B 6. In SQL, an UPDATE statement without a WHERE clause: A. Updates every row in a table. B. Updates no rows in a table. C. Updates every column in a table. D. Results in a Cartesian product.7. If a course can be taught by many teachers, and a teacher can teach only one course, then the mapping cardinality from course to teacher isA. one-to-oneB. one-to-manyC. many-to-oneD. many-to-many8. If there is a many-to-one relationship between entity A and B, then A. there exists a functional dependency from the primary key in B to the primary key in A, i.e., PK(B) → PK(A).B. there exists a functional dependency from the primary key in A to the primary key in B, i.e., PK(A) → PK(B).C. both A and B.D. neither A nor B9. If a functional dependency AB →R holds on relation R(A, B, C), then (A, B) is definitely a ______ of R.A. super keyB. primary keyC. candidate keyD. foreign key10. A relational schema R is in _____ if the domains of all attributes of R are atomicA. 1NFB. 3NFC. BCNFD. 4NF 11. Which one of the following statement is true?A. 3NF is more strict than BCNFB. 4NF is more strict than BCNFC. 1NF is more strict than BCNFD. BCNF is the most strict normal form 12. If a transaction T i has obtain an exclusive lock on data item Q, then transition T j can ______.A. obtain an exclusive lock on data item QB. obtain a shared lock on data item QC. wait for lock granting on data item QD. read or write Q without a lock13. If both <Ti start> and <Ti commit> appear in the log after the nearest checkpoint to system crash, then transaction Ti must be ______ A. undone B. redone C. deleted D. Neither A or B14. ______ is the final state in a life cycle of a transaction.A. committedB. abortedC. failedD. A or B15. in 2PL protocol, at stage, A transaction may obtain locks, but may not release locks.A. Shrinking phaseB. Growing phaseC. CommittedD. AbortedQuestion 3 (12 points) Consider the following database requirement:A hospital has properties like ID, name, location, rank, capacity. A doctor can be described by ID, name, age, skill. A patient has properties like ID, name, age, sex, address. The above three entities must satisfy some constraints: Each doctor can be unemployed or employed by one hospital. If a doctor is employed, his salary needs to be recorded in the database. A patient can go to many hospitals.1. Draw ER diagram to illustrate the above database requirement [8 points].2. Translate your ER diagram into relational database schemas, and point out the primary keys and foreign keys. You can write your answers in the following format: “R(a1, a2, a3, a4), primary key: a1, foreign key: a4”[4 points].Question 4. (24 points) The following five tables are for a company management system:EMPLOYEE (ID, Name, Birthday, Address, Sex, Salary, Dnumber) DEPARTMENT (Dnumber, Dname, MgrID )PROJECT (Pnumber, Pname, Pcity)WORKS_ON (Pnumber, E-ID, Wdate, Hours)CHILD (E-ID, CHD-ID, CHD_name, Sex, Birthday)1. Based on the giving relations, Specify the following queries using relational algebra (3 points for each).1) List the names of all employees with birthday earlier than ‘1970-1-1’ and salary less than $5000.2) List the names of all employees who have a child.3) List the cities and the total number of projects which are located on same city.2. Specify the following operations in SQL(3 points for each).1) Define the table WORKS_ON, declare Pnumber, E-ID, Wdate as the primary key, Pnumber as the foreign key referencing the primary key of project, E-ID as the foreign key referencing the primary key of employee, and ensure that the values of Hours are non-negative with default value 8.2) For each employee working on the ‘Network’ project(Pname), increase his/her salary by 5%.3) List the names of all department managers who have no child.4) Find the names of all employees in department 5 (Dnumber) who have worked on both 'X' project and 'Y' project (Pname).5) For each project, find the project number, project name and the total hours (byall employees) spent on that project in Oct. 2009.Question 5 (10 points) Consider a relation R(A, B, C, D, E, F) with the set of Functional DependenciesF = { A →BCD, BC →DE, B →D, D →A }pute the Closures of attribute sets A+, C+, E+[3 points].2.Give one candidate key of R [2 points].3.Is F equivalent to { A →BC, BC →E, B →D, D →A } ? [2 points]4.What is the highest normal form of R? Explain your reasons [3 points]. Question 6 (9 points) There are 3 transactions:Consider the following schedule S on transitions set {T1, T2, T3, T4}, with R and W denotes read and write operation respectively.S= R1(A) R2(B)R3(A)R2(C)R4(D)W2(B)R1(B)W1(D)R3(B)W3(B)W2(C)1.List all conflict operation pairs in S [3 points].2.Swapping no-conflict operations to see whether it is a serializable schedule [3points].3.Write all its equivalent serial schedules if S is conflict serializable? Or showwhy if it is not conflict serializable [3 points].华南农业大学期末考试试卷(A 卷-Answer Sheets )2014-2015学年第1 学期 考试科目: Database system 考试类型:(闭卷) 考试时间: 120 分钟 学号 姓名 年级专业Instructions to candidates:1. Write your name, student number and class on both the question papers and the answer papers.2. DO NOT write your answers on the question papers. Write them ALL ON THE ANSWER PAPERS.3. Write your answers in either Chinese or English.4. Hand in all papers (both the question papers and the answer papers).Question 3 (12points)hospital(ID, name, location, rank, capacity), primary key: ID,doctor(ID, name, age, skill, hospitalID, salary), primary key: ID, foreign key: hospitalID refer to hospital(ID)patient (ID, name, age, sex, address), primary key: ID,livein(patientID, hospitalID) primary key: (hospitalID, PatientID), foreign key hospitalID refer to hospital(ID), foreign key patientID refer to patient (ID)Question 4 [24 points]1:1)()()'1970-1-1'5000Name ANDSalary Employee πσ<<Birthday 2)()Name ID E IDEmployee Child π=-∞3) (Pnumber)(Project)citycount G2:1) CREATE TALBE Works_On( Pnumber int,E-ID char(15), Wdate date,Hours int default 8 CHECK (Hours >= 0), PRIMARY KEY (Pnumber, E-ID, Wdate),FOREIGN KEY (E-ID) REFERENCES Employee(ID),FOREIGN KEY (Pnumber) REFERENCES Project(Pnumber), ); 2)UPDA TE Employee SET Salary=Salary *1.05 WHERE ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=’Network’);3)SELECT Name FROM Employee, Department WHERE ID=MrgID AND ID NOT IN(SELECT E-ID FROM Child);4)SELECT Name FROM EmployeeWHERE Dnumber=5 AND ID IN(SELECT E-ID FROM Project natural join Works_on WHERE P name=’X’) AND ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=’Y’); 5)SELECT Pnumber, Pname, SUM(Hours) FROM Project NATURAL JOIN Works_OnWHERE Wdate BETWEEN ‘2009-10-1’ AND ‘2009-10-31’ GROUP BY Pnumber, Pname;Question 5 [10 points]1 A +=ABCDE, C + =C, E +=E 2. AF is a candidate key of R3. Yes F equivalent to { A → BC, BC → E, B → D, D → A }4. the highest normal form of R is 1NF. The reason lies in that (1) it is not in BCNF, for A is not a super key but A → BCD. (2) It is not in 3NF for all candidate keys are: DF, AF, BF, so that primary attributes are ABDF. To A → BC, A is not a super key and c is not included in any candidate key therefore it violate rules of 3NF. (3) all attribute are atomic.Question 6 [9 points]1. conflict operation pairs (1)W 2(B)R 1(B) (2) W 2(B)R 3(B) (3)W 2(B)W 3(B) (4) R 1(B)W 3(B) (5) R 2(B) W 3(B) (6) R 4(D) W 1(D)2. S= R 1(A) R 2(B)R 3(A)R 2(C)R 4(D)W 2(B)R 1(B)W 1(D)R 3(B)W 3(B)W 2(C)=> R 2(B)R 1(A) R 2(C) R 3(A) W 2(B) R 4(D) R 1(B)W 1(D)R 3(B) W 2(C)W 3(B) => R 2(B) R 2(C)R 1(A) W 2(B) R 3(A) R 4(D) R 1(B)W 1(D) W 2(C)R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 1(A) R 4(D) R 3(A) R 1(B) W 2(C)W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D)R 1(A) R 1(B) R 3(A) W 2(C) W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) R 1(A) R 1(B) W 2(C) R 3(A) W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) R 1(A) W 2(C)R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) W 2(C)R 1(A) R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) W 2(C)R 4(D) R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) 3. it is a conflict serializable schedule. The equivalent serial schedules are: T 2, T 4, T 1, T 3 or T 4, T 2, T 1, T 3。
2014级《数据库理论与技术》课程期中试卷
宁波工程学院2015–2016 学年第 2 学期《数据库理论与技术》课程期中考试卷一、 单项选择题(每小题1分,共20分)1. ( B )是长期存储在计算机内、有组织的、可共享的数据集合。
A .数据库系统B .数据库C .关系数据库D .数据库管理系统 2. 下面哪个不是数据库系统必须提供的数据控制功能(B )。
A .安全性 B .可移植性 C .完整性 D .并发控制3. 通过修改( C )可以保证数据库的逻辑独立性。
A .模式 B .外模式C .外模式/模式映射D .模式/内模式映射4. 学生社团可以接纳多名学生参加,但每个学生只能参加一个社团,从社团到学生之间的联系种类是( D )。
A.多对多B.一对一C.多对一D.一对多 5. 结构数据模型的三个组成部分中,不包括( C )。
A .完整性规则B .数据结构C .恢复D .数据操作 6. SQL 中,下列涉及空值的操作,不正确的是( C )。
A .AGE IS NULLB .AGE IS NOT NULLC .AGE=NULLD .NOT (AGE IS NULL )7. 设有关系模式R (A ,B ,C ),其关系r 如右表所示: 下面叙述正确的是( B )。
A .函数依赖 A →B 在上述关系中成立 B .函数依赖 BC → A 在上述关系中成立 C .函数依赖 B → A 在上述关系中成立D .函数依赖 A → BC 在上述关系中成立8. 关系数据库规范化是为了解决关系数据库中( A )。
A .插入、删除和数据冗余问题而引入的 B .提高查询速度问题而引入的 C .减少数据操作的复杂性问题而引入的 D .保证数据的安全性和完整性问题而引入的 9. 实现关系代数选择运算的SQL 子句是( D )。
A .SELECTB .ORDER BYC .FROMD .WHERE 10.设关系R 和S 的属性个数分别为2和3,则与关系代数表示式12R S> 等价的是( B )。
2014贵州省数据库考试含答案入门
1、已知有向图G=(V,E),其中V={V1,V2,V3,V4,V5,V6,V7},E={<V1,V2>,<V1,V3>,<V1,V4>,<V2,V5>,<V3,V5>,<V3,V6>,<V4,V6>,<V5,V7>,<V6,V7>}写出G的拓扑排序的结果。
G拓扑排序的结果是:V1、V2、V4、V3、V5、V6、V72、(1)p->rchild (2)p->lchild (3)p->lchild (4)ADDQ(Q,p->lchild) (5)ADDQ(Q,p->rchild)25. (1)t->rchild!=null (2)t->rchild!=null (3)N0++ (4)count(t->lchild) (5)count(t->rchild)26. .(1)top++ (2) stack[top]=p->rchild (3)top++ (4)stack[top]=p->lchild27. (1)*ppos // 根结点(2)rpos=ipos (3)rpos–ipos (4)ipos (5)ppos+13、#define maxsize 栈空间容量void InOutS(int s[maxsize])//s是元素为整数的栈,本算法进行入栈和退栈操作。
{int top=0; //top为栈顶指针,定义top=0时为栈空。
for(i=1; i<=n; i++) //n个整数序列作处理。
{scanf(“%d”,&x); //从键盘读入整数序列。
if(x!=-1) // 读入的整数不等于-1时入栈。
if(top==maxsize-1){printf(“栈满\n”);exit(0);}else s[++top]=x; //x入栈。
数据库系统工程师14年真题(标准答案)
2014年上半年数据库系统工程师考试上午真题(标准参考答案)在CPU中,常用来为ALU执行算术逻辑运算提供数据并暂存运算结果的寄存器是(D)。
A. 程序计数器 B. 状态寄存器 C. 通用寄存器 D. 累加寄存器某机器字长为n,最高位是符号位,其定点整数的最大值为(B)。
A.2n-1B.2n-1-1C.2nD.2n-1海明码利用奇偶性检错和纠错,通过在n个数据位之间插入k个检验位,扩大数据编码的码距。
若n=48,则k应为(C)。
A. 4B. 5C. 6D. 7通常可以将计算机系统中执行一条指令的过程分为取指令,分析和执行指令3步。
若取指令时间为4t,分析时间为2t。
执行时间为3t,按顺序方式从头到尾执行完600条指令所需时间为(D)t;若按照执行第i条,分析第i+1条,读取第i+2条重叠的流水线方式执行指令,则从头到尾执行完600条指令所需时间为(B)t。
A. 2400B. 3000C. 3600D. 5400A. 2400B. 2405C. 3000D. 3009若用256K X 8bit的存储器芯片,构成地址40000000H到400FFFFFH且按字节编址的存区域,则需(A)片芯片。
A. 4B. 8C. 16D. 32以下关于木马程序的叙述中,正确的是(B)。
A.木马程序主要通过移动磁盘传播B.木马程序的客户端运行在攻击者的机器上C.木马程序的目的是使计算机或网络无法提供正常的服务D.Sniffer是典型的木马程序防火墙的工作层次是决定防火墙效率与安全的主要因素,以下叙述中,正确的是(D )。
A.防火墙工作层次越低,工作效率越高,安全性越高B.防火墙工作层次越低,工作效率越低,安全性越低C.防火墙工作层次越高,工作效率越高,安全性越低D.防火墙工作层次越高,工作效率越低,安全性越高以下关于包过滤防火墙和代理服务防火墙的叙述中,正确的是(B)。
A.包过滤成本技术实现成本较高,所以安全性能高B.包过滤技术对应用和用户是透明的C.代理服务技术安全性较高,可以提高网络整体性能D.道理服务技术只能配置成用户认证后才建立连接王某买了一幅美术作品原件,则他享有该美术作品的(D)。
(2014版)数据库概论及实例作业题参考答案
数据库概论及实例网络作业题参考答案第一章参考答案一、单项选择题1.C2.A3.D4.C5.B6.A7.C8.A9.C10.D11.D 12.B 13.B 14.A 15.C 16.A 17.D 18.A 19.C 20.A 21. A二、判断题1.对2.对3.错4.对5.错6.错三、填空题1 .永久存储有组织可共享2.数据定义功能数据操纵功能数据库的运行管理数据库的建立和维护功能3.数据库数据库管理系统(及其开发工具)应用系统数据库管理员4.人工管理文件系统数据库系统5.冗余度数据独立性6.数据的安全性数据的完整性并发控制数据库恢复7.逻辑结构特征型8.逻辑独立性物理独立性四、简答题1.试述数据、数据库、数据库系统、数据库管理系统的概念。
数据:描述事物的符号记录称为数据。
数据的种类有文字、图形、图象、声音、正文等等。
数据与其语义是不可分的。
数据库:数据库是长期储存在计算机内、有组织的、可共享的数据集合。
数据库中的数据按一定的数据模型组织、描述和储存,具有较小的冗余度、较高的数据独立性和易扩展性,并可为各种用户共享。
数据库系统:数据库系统(DBS)是指在计算机系统中引入数据库后的系统构成。
数据库系统由数据库、数据库管理系统(及其开发工具)、应用系统、数据库管理员构成。
数据库管理系统:数据库管理系统(DBMS)是位于用户与操作系统之间的一层数据管理软件。
用于科学地组织和存储数据、高效地获取和维护数据。
2 .使用数据库系统有什么好处?使用数据库系统的好处是由数据库管理系统的特点或优点决定的。
使用数据库系统的好处很多。
使用数据库系统可以大大提高应用开发的效率。
因为在数据库系统中应用程序不必考虑数据的定义、存储和数据存取的具体路径,这些工作都由DBMS来完成。
用一个通俗的比喻,使用了DBMS就如有了一个好参谋好助手,许多具体的技术工作都由这个助手来完成。
开发人员就可以专注于应用逻辑的设计而不必为管理数据的许许多多复杂的细节操心。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
华南农业大学期末考试试卷(A卷)2014-2015学年第一学期考试科目:数据库系统考试类型:闭卷考试时间:120 分钟学号姓名年级专业Question 1: true-false question (15 points) For each of the following statements, indicate whether it is TRUE or FALSE (Using √for TRUE and ×for FALSE).1. A primary key is a field (or group of fields) that uniquely describes each record inthe database.2.Data redundancy improves the integrity of a database.3.SQL is the language used by relational databases to create objects and tomanipulate and retrieve data.4. A relational database management system does not include tools for backing up &restoring databases.5.An attribute is also known as a row in most databases.6.An association between entities is known as a relationship.7.Integrity constraints limit the number of entities that can be placed in a table ordatabase.8.The Entity-Relationship data model is often used in the physical design phase.9.The concept “relation” in relation model is exactly the same as the concept“relationship” in ER model.10.Most relationship sets in a database system involves two entity sets.11.The closure of an attribute set contains that attribute set.12.Lossless decomposition is necessary in a decomposition algorithm.13.If A →B and C →D hold, then AC →BD also holds.14.It is not necessary that a legal schedule preserves the order in which theinstructions appear in each individual transaction.15.Update operations in database must be written into log before updating database.Question 2 single-choice question (2 points for each problem, 30 points in total)1. is the only one incorrect description from the followings:A. R=(R-S)∪(R∩S)B. R-S=R-(R∩S)C. R∩S=S-(R-S)D. R∩S=S-(S-R)2. Choose the only one correct expression from the followings: _ ______.A. (≠ some) ≡ inB. (= all) ≡ not inC. exists r ⇔ r ≠ ØD. X-Y ≠Ø ⇔ X ⊆ Y3. of the following four expressions of relational algebra is not equivalent to the other three? They are all based on the relations R(A,B) and S(B,C).A.()S R B A ,∏B. ()S R B ∏C.()S R B R A ⨯∏., D.()()()S R R B A ∏⨯∏⋂4. In the following, assume a is an attribute of some character-string type, e.g. CHAR(10), and that it may be NULL.Q1: SELECT * FROM R WHERE a IS NULL;Q2: SELECT * FROM R WHERE a NOT LIKE '%'; 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.5. The Entity-Relationship data model isA. DBMS dependentB. DBMS independentC. both A and BD. neither A nor B 6. In SQL, an UPDATE statement without a WHERE clause: A. Updates every row in a table. B. Updates no rows in a table. C. Updates every column in a table. D. Results in a Cartesian product.7. If a course can be taught by many teachers, and a teacher can teach only one course, then the mapping cardinality from course to teacher isA. one-to-oneB. one-to-manyC. many-to-oneD. many-to-many8. If there is a many-to-one relationship between entity A and B, then A. there exists a functional dependency from the primary key in B to the primary key in A, i.e., PK(B) → PK(A).B. there exists a functional dependency from the primary key in A to the primary key in B, i.e., PK(A) → PK(B).C. both A and B.D. neither A nor B9. If a functional dependency AB →R holds on relation R(A, B, C), then (A, B) is definitely a ______ of R.A. super keyB. primary keyC. candidate keyD. foreign key10. A relational schema R is in _____ if the domains of all attributes of R are atomicA. 1NFB. 3NFC. BCNFD. 4NF 11. Which one of the following statement is true?A. 3NF is more strict than BCNFB. 4NF is more strict than BCNFC. 1NF is more strict than BCNFD. BCNF is the most strict normal form 12. If a transaction T i has obtain an exclusive lock on data item Q, then transition T j can ______.A. obtain an exclusive lock on data item QB. obtain a shared lock on data item QC. wait for lock granting on data item QD. read or write Q without a lock13. If both <Ti start> and <Ti commit> appear in the log after the nearest checkpoint to system crash, then transaction Ti must be ______ A. undone B. redone C. deleted D. Neither A or B 14. ______ is the final state in a life cycle of a transaction. A. committed B. aborted C. failed D. A or B15. in 2PL protocol, at stage, A transaction may obtain locks, but may not release locks.A. Shrinking phaseB. Growing phaseC. CommittedD. AbortedQuestion 3 (12 points) Consider the following database requirement:A hospital has properties like ID, name, location, rank, capacity. A doctor can be described by ID, name, age, skill. A patient has properties like ID, name, age, sex, address. The above three entities must satisfy some constraints: Each doctor can be unemployed or employed by one hospital. If a doctor is employed, his salary needs to be recorded in the database. A patient can go to many hospitals.1. Draw ER diagram to illustrate the above database requirement [8 points].2. Translate your ER diagram into relational database schemas, and point out the primary keys and foreign keys. You can write your answers in the following format: “R(a1, a2, a3, a4), primary key: a1, foreign key: a4”[4 points].Question 4. (24 points) The following five tables are for a company management system:EMPLOYEE (ID, Name, Birthday, Address, Sex, Salary, Dnumber) DEPARTMENT (Dnumber, Dname, MgrID )PROJECT (Pnumber, Pname, Pcity)WORKS_ON (Pnumber, E-ID, Wdate, Hours)CHILD (E-ID, CHD-ID, CHD_name, Sex, Birthday)1. Based on the giving relations, Specify the following queries using relational algebra (3 points for each).1) List the names of all employees with birthday earlier than …1970-1-1‟ and salary less than $5000.2) List the names of all employees who have a child.3) List the cities and the total number of projects which are located on same city.2. Specify the following operations in SQL(3 points for each).1) Define the table WORKS_ON, declare Pnumber, E-ID, Wdate as the primary key, Pnumber as the foreign key referencing the primary key of project, E-ID as the foreign key referencing the primary key of employee, and ensure that the values of Hours are non-negative with default value 8.2) For each employee working on the …Network‟ project(Pname), increase his/her salary by 5%.3) List the names of all department managers who have no child.4) Find the names of all employees in department 5 (Dnumber) who have worked on both 'X' project and 'Y' project (Pname).5) For each project, find the project number, project name and the total hours (by all employees) spent on that project in Oct. 2009.Question 5 (10 points) Consider a relation R(A, B, C, D, E, F) with the set ofFunctional DependenciesF = { A →BCD, BC →DE, B →D, D →A }pute the Closures of attribute sets A+, C+, E+[3 points].2.Give one candidate key of R [2 points].3.Is F equivalent to { A →BC, BC →E, B →D, D →A } ? [2 points]4.What is the highest normal form of R? Explain your reasons [3 points]. Question 6 (9 points) There are 3 transactions:Consider the following schedule S on transitions set {T1, T2, T3, T4}, with R and W denotes read and write operation respectively.S= R1(A) R2(B)R3(A)R2(C)R4(D)W2(B)R1(B)W1(D)R3(B)W3(B)W2(C)1.List all conflict operation pairs in S [3 points].2.Swapping no-conflict operations to see whether it is a serializable schedule [3points].3.Write all its equivalent serial schedules if S is conflict serializable? Or showwhy if it is not conflict serializable [3 points].华南农业大学期末考试试卷(A 卷-Answer Sheets )2014-2015学年第1 学期 考试科目: Database system 考试类型:(闭卷) 考试时间: 120 分钟 学号 姓名 年级专业Instructions to candidates:1. Write your name, student number and class on both the question papers and the answer papers.2. DO NOT write your answers on the question papers. Write them ALL ON THE ANSWER PAPERS.3. Write your answers in either Chinese or English.4. Hand in all papers (both the question papers and the answer papers).Question 3 (12points)hospital(ID, name, location, rank, capacity), primary key: ID,doctor(ID, name, age, skill, hospitalID, salary), primary key: ID, foreign key: hospitalID refer to hospital(ID)patient (ID, name, age, sex, address), primary key: ID,livein(patientID, hospitalID) primary key: (hospitalID, PatientID), foreign key hospitalID refer to hospital(ID), foreign key patientID refer to patient (ID)Question 4 [24 points]1:1)()()'1970-1-1'5000Name ANDSalary Employee πσ<<Birthday 2)()Name ID E IDEmployee Child π=-∞3) (Pnumber)(Project)citycount G2:1) CREATE TALBE Works_On( Pnumber int,E-ID char(15), Wdate date,Hours int default 8 CHECK (Hours >= 0), PRIMARY KEY (Pnumber, E-ID, Wdate),FOREIGN KEY (E-ID) REFERENCES Employee(ID),FOREIGN KEY (Pnumber) REFERENCES Project(Pnumber), ); 2)UPDA TE Employee SET Salary=Salary *1.05 WHERE ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=‟Network‟);3)SELECT Name FROM Employee, Department WHERE ID=MrgID AND ID NOT IN(SELECT E-ID FROM Child);4)SELECT Name FROM EmployeeWHERE Dnumber=5 AND ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=‟X‟) AND ID IN(SELECT E-ID FROM Project natural join Works_on WHERE Pname=‟Y‟); 5)SELECT Pnumber, Pname, SUM(Hours) FROM Project NATURAL JOIN Works_OnWHERE Wdate BETWEEN …2009-10-1‟ AND …2009-10-31‟ GROUP BY Pnumber, Pname;Question 5 [10 points]1 A +=ABCDE, C + =C, E +=E 2. AF is a candidate key of R3. Yes F equivalent to { A → BC, BC → E, B → D, D → A }4. the highest normal form of R is 1NF. The reason lies in that (1) it is not in BCNF, for A is not a super key but A → BCD. (2) It is not in 3NF for all candidate keys are: DF, AF, BF, so that primary attributes are ABDF. To A → BC, A is not a super key and c is not included in any candidate key therefore it violate rules of 3NF. (3) all attribute are atomic.Question 6 [9 points]1. conflict operation pairs (1)W 2(B)R 1(B) (2) W 2(B)R 3(B) (3)W 2(B)W 3(B) (4) R 1(B)W 3(B) (5) R 2(B) W 3(B) (6) R 4(D) W 1(D)2. S= R 1(A) R 2(B)R 3(A)R 2(C)R 4(D)W 2(B)R 1(B)W 1(D)R 3(B)W 3(B)W 2(C)=> R 2(B)R 1(A) R 2(C) R 3(A) W 2(B) R 4(D) R 1(B)W 1(D)R 3(B) W 2(C)W 3(B) => R 2(B) R 2(C)R 1(A) W 2(B) R 3(A) R 4(D) R 1(B)W 1(D) W 2(C)R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 1(A) R 4(D) R 3(A) R 1(B) W 2(C)W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D)R 1(A) R 1(B) R 3(A) W 2(C) W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) R 1(A) R 1(B) W 2(C) R 3(A) W 1(D) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) R 1(A) W 2(C)R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) R 4(D) W 2(C)R 1(A) R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) => R 2(B) R 2(C) W 2(B) W 2(C)R 4(D) R 1(B) W 1(D) R 3(A) R 3(B) W 3(B) 3. it is a conflict serializable schedule. The equivalent serial schedules are: T 2, T 4, T 1, T 3 or T 4, T 2, T 1, T 3。