四川大学数据库系统(A闭)期末考题
数据库期末考试试题及答案
数据库期末考试试题及答案一、名词解释(每小题2分,共10分)1. 数据库(Database)2. 数据模型(Data Model)3. 表(Table)4. 字段(Field)5. 记录(Record)6. 主键(Primary Key)7. 外键(Foreign Key)8. 索引(Index)9. 视图(View)10. 存储过程(Stored Procedure)二、选择题(每小题2分,共20分)1. 下列哪个是关系型数据库管理系统?A. OracleB. MyBatisC. MongoDBD. Redis2. 在数据库中,哪个字段用于唯一标识一条记录?A. 字段名B. 数据类型C. 主键D. 索引3. 以下哪个不属于数据库的基本操作?A. 插入B. 删除C. 修改D. 格式化4. 下列哪个SQL语句用于创建表?A. SELECTB. INSERTC. CREATE TABLED. UPDATE5. 在SQL中,哪个关键字用于删除表?A. DROP TABLEB. DELETEC. ALTER TABLED. TRUNCATE TABLE6. 下列哪个SQL语句用于查询所有字段?A. SELECT FROM table_nameB. SELECT table_name FROMC. SELECT FROM table_nameD. SELECT table_name7. 以下哪个函数用于计算两个日期之间的差值?A. DATEDIFFB. TIMESTAMPDIFFC. DATE_ADDD. DATE_SUB8. 下列哪个SQL语句用于修改表的结构?A. MODIFY TABLEB. ALTER TABLEC. CHANGE TABLED. RENAME TABLE9. 下列哪个关键字用于创建外键约束?A. FOREIGN KEYB. CONSTRAINTC. PRIMARY KEYD. INDEX10. 以下哪个存储过程用于备份数据库?A. BACKUP DATABASEB. RESTORE DATABASEC. CREATE DATABASED. DROP DATABASE三、填空题(每小题2分,共20分)1. 在SQL中,用于插入数据的语句是______。
数据库期末试卷【A试卷+答案】
数媒试题1.(V )概念模型的表示方法很多,其中最著名最为常用的是实体-联系方法。
该方法用E-R图来描述现实世界的概念模型,E-R方法也称为E-R模型。
[P17]2.(X )概念模型(E-R图),也称信息模型,它是按用户的观点来对数据和信息建模,主要用于需求分析。
【P12主要用于数据库设计】3.(X )关系模型的操作主要包括查询、插入、删除和更新。
其中的查询操作可能违背关系的实体完整性约束条件。
【P30】【查询操作不改变表中的数据所以不可能违背实体完整性约束条件】4.(X )数据模型的组成要素是关系数据结构、关系操作集合、关系完整性约束条件。
【关系模型的组成要素】5.(V )在关系模型中,实体以及实体间的联系都是用二维表来表示的。
【P29】6.(X )学生(学号,姓名,性别,年龄,入校毕业年份)是规范化的关系。
【P29】【关系的每个分量必须是一个不可分割的数据项。
也就是说,不允许表中还有表。
】7.(X )E-R图向数据模型转换时,多对多联系既可以转换为一个独立的关系模式,也可以与某一端的关系模式合并。
【只能转换为一个独立的关系模式】8.(X )在学生选课表SC(sno,cno,grade)中,同时选修了a号与b号课程同学学号的查询语句为select sno from sc where cno=’a’ and cno=’b’。
【如此写法永远没有满足条件的元组】9.(V )关系数据库中,关系模式是型,关系是值。
关系是关系模式在某一时刻的状态或内容。
10.(V )关系数据库模式是对关系数据库的描述,是关系数据库的型。
关系数据库模式包括:若干域的定义;在这些域上定义的若干关系模式。
11.(V )实体完整性和参照完整性是关系模型必须满足的完整性约束条件,被称作关系的两个不变性,应该由关系系统自动支持。
12.( X ) 完整性检查和控制的对象是非法用户和非法操作,防止对数据库数据的非法存取。
【P151】【安全性控制的防范对象是非法用户和非法操作,防止对数据库数据的非法存取。
大学数据库管理系统期末考试题库及答案
大学数据库管理系统期末考试题库及答案选择题(每题2分)
1. 数据库的定义是:()
A. 文件管理系统
B. 存放数据的仓库
C. 存放数据的干草堆
D. 存放数据的操作系统
2. 下面不属于关系数据库特点的是:()
A. 实现了数据的共享性
B. 储存维护数据的程序和数据是分离的
C. 数据具有冗余性
D. 有数据结构和完整性约束的实现机制
3. 在定义关系模式时,应指明其下列哪几个方面?()
A. 元组的组成
B. 属性的含义与名称
C. 属性的可取值范围和类型
D. 约束条件
4. 下列哪种技术可用于备份数据库?()
A. 每日回滚
B. 磁盘阵列
C. 数据库快照
D. 服务器镜像
填空题(每空2分)
1. 数据库管理员的英文缩写是 ________。
2. 触发器的语法格式包括:CREATE TRIGGER 触发器名________ 操作类型 ON 表名 ________ 触发事件 AS ________。
3. 设计一个订单管理的关系模式,其中包含表格Order、Product、Customer等,要求Order表格中的外键是分别来自于Product和Customer的 ________ 。
4. 数据库中的ACID是指事务具有的原子性、 ________ 、隔离性和持久性四个特性。
简答题(每题10分)
1. 什么是数据库的粒度?请举例说明。
2. 请谈谈您是如何设计ER图的?
3. 什么是SQL注入?
论述题(40分)
1. 如何进行优化数据库性能?请从以下三个方面论述:调整数据库参数、优化表格和SQL语句优化。
数据库期末考试试题及答案
数据库期末考试试题及答案一、选择题(每题2分,共20分)1. 在关系数据库中,用来表示实体之间关系的是:A. 属性B. 关系C. 键D. 表答案:B2. SQL语言中的“SELECT”语句用于:A. 插入数据B. 更新数据C. 查询数据D. 删除数据答案:C3. 数据库管理系统(DBMS)的主要功能不包括:A. 数据存储B. 数据查询C. 数据备份D. 数据加密答案:D4. 以下哪个不是数据库设计中的范式:A. 第一范式(1NF)B. 第二范式(2NF)C. 第三范式(3NF)D. 第四范式(4NF)答案:D5. 在数据库中,主键的作用是:A. 唯一标识表中的记录B. 存储数据C. 建立表与表之间的关系D. 排序数据答案:A6. 事务的四大特性不包括:A. 原子性B. 一致性C. 隔离性D. 持久性答案:D7. 以下哪个是数据库的并发控制技术:A. 索引B. 视图C. 锁D. 触发器答案:C8. 数据库的完整性约束包括:A. 实体完整性B. 参照完整性C. 用户定义完整性D. 所有以上答案:D9. 数据库的恢复技术不包括:A. 事务日志B. 检查点C. 数据备份D. 索引答案:D10. 在数据库中,视图的作用是:A. 提高查询速度B. 简化用户操作C. 保护数据D. 存储数据答案:B二、简答题(每题10分,共30分)1. 解释什么是数据库的规范化,并说明其目的是什么?答:数据库的规范化是指按照一定的规则将数据库中的数据组织起来,以减少数据冗余和提高数据的一致性。
其目的是确保数据库的设计是合理的,避免数据的异常,如插入异常、删除异常和更新异常。
2. 描述数据库事务的ACID属性,并解释每个属性的含义。
答:事务的ACID属性包括:- 原子性(Atomicity):事务中的所有操作要么全部完成,要么全部不完成,不会结束在中间某个点。
- 一致性(Consistency):事务必须保证数据库从一个一致的状态转移到另一个一致的状态。
数据库期末考试题及答案2024
数据库期末考试题及答案2024**数据库期末考试题及答案2024**一、选择题(每题2分,共20分)1. 数据库管理系统(DBMS)的主要功能不包括以下哪一项?A. 数据定义B. 数据组织C. 数据存储D. 数据加密**答案:D**2. 关系数据库中,关系至少应该满足的完整性约束是:A. 实体完整性B. 参照完整性C. 用户定义的完整性D. 所有以上**答案:D**3. 在SQL中,用于创建新表的命令是:A. CREATE TABLEB. CREATE DATABASEC. CREATE VIEWD. CREATE INDEX**答案:A**4. 数据库的三级模式结构中,描述数据库中全体数据的逻辑结构和特征的是:A. 外模式B. 概念模式C. 内模式D. 存储模式**答案:B**5. 在关系数据库中,以下哪个操作用于删除表?A. DROP TABLEB. REMOVE TABLEC. DELETE TABLED. CLEAR TABLE**答案:A**6. 数据库设计中,规范化的主要目的是:A. 提高查询速度B. 减少数据冗余C. 增加数据安全性D. 降低存储成本**答案:B**7. 在SQL查询中,用于选择特定列的关键字是:A. SELECTB. WHEREC. FROMD. ORDER BY**答案:A**8. 数据库中的事务具有以下哪个特性,确保事务的可靠性?A. 原子性B. 一致性C. 隔离性D. 持久性**答案:D**9. 以下哪个不是数据库设计阶段?A. 需求分析B. 概念性设计C. 物理设计D. 数据维护**答案:D**10. 在关系数据库中,以下哪个操作用于更新表中的数据?A. UPDATEB. MODIFYC. CHANGED. ALTER**答案:A**二、填空题(每题2分,共20分)1. 数据库管理系统(DBMS)的核心是______。
**答案:数据库引擎**2. 在数据库中,主键用于______。
大学计算机基础 四川大学期末考试题.
四川大学期末考试试题(闭卷一、选择题(每题分,共4040分每题11分,共1.微型计算机中,运算器、控制器和内存储器的总称是【】。
(A主机(BMPU(CCPU(DALU2.微型计算机,ROM是【】。
(A顺序存储器(B只读存储器(C随机存储器(D高速缓冲存储器3.下列设备中,只能作输出设备的是【】。
(A磁盘存储器(B键盘(C鼠标器(D打印机4.微型计算机中存储数据的最小单位是【】。
(A字节(B字(C位(DKB5.微型计算机中,I/O设备的含义是【】。
(A输入设备(B输出设备(C输入输出设备(D控制设备6.数字字符“1”的ASCII码的十进制表示为49,那么数字字符“8”的ASCII码的十进制表示为【】。
(A56(B58(C60(D547.键盘当中用来输入上档字符的是【】。
ENTER (A回车键回车键ENTERBackSpace 退格键BackSpace(B退格键(C换档键Shift 换档键ShiftTab 制表键Tab(D制表键8.左手的中指应放在键盘上【】位置。
(AS(BF(CJ(DD9.512个汉字占用【】个字节。
(A512B(B512KB(C1024KB(D1KB10.MIPS来衡量的计算机性能指标是【】(A处理能力(B运算速度(C存储容量(D可靠性11.世界上第一台电子数字计算机取名为【】(AUNIVAC(BEDSAC(CENIAC(DEDVAC12.计算机的发展阶段通常是按计算机所采用的什么来划分的?【】(A内存容量(B电子器件(C程序设计语言(D操作系统13.现代计算机之所以能自动地连续进行数据处理,主要是因为【】(A采用了开关电路(B采用了半导体器件(C具有存储程序的功能(D采用了二进制14.在软件方面,第一代计算机主要使用【】(A机器语言(B高级程序设计语言(C数据库管理系统(DBASIC和FORTRAN15.个人计算机简称PC机。
这种计算机属于【】(A微型计算机(B小型计算机(C超级计算机(D巨型计算机16.微IBMPC/XT采用的微处理器是由【】公司生产的(AIBM(BInter(CHP(DDigital17.人们常说486微机、586微机,其中的数字指的是【】(A硬盘的型号(B软盘的型号(C显示器的型号(D微处理器的型号18.巨型计算机指的是【】(A重量大(B体积大(C功能强(D耗电量大19.二进制数01100100转换成十六进制数是【】(A64(B63(C100(D14420.下面不属于网络拓扑结构的是【】(A环形结构(B总线结构(C层次结构(D网状结构21.操作系统是一种【】。
数据库期末考试试题及答案
数据库期末考试试题及答案一、选择题(每题2分,共20分)1. 在关系数据库中,用于查询数据的SQL语句是:A. SELECTB. UPDATEC. INSERT INTOD. DELETE2. 下列哪个不是数据库的三大范式之一?A. 第一范式(1NF)B. 第二范式(2NF)C. 第三范式(3NF)D. 第四范式(4NF)3. 以下哪个选项不是数据库设计阶段的任务?A. 需求分析B. 概念设计C. 逻辑设计D. 物理设计4. 在数据库中,用于更新表中数据的SQL语句是:A. SELECTB. UPDATEC. DELETED. INSERT INTO5. 以下哪个是数据库事务的四大特性之一?A. 原子性(Atomicity)B. 一致性(Consistency)C. 隔离性(Isolation)D. 持久性(Durability)二、简答题(每题10分,共30分)1. 简述数据库管理系统(DBMS)的主要功能。
2. 解释什么是外键,并说明其在数据库中的作用。
3. 描述数据库备份和恢复的重要性及基本步骤。
三、应用题(每题25分,共50分)1. 假设你是一个数据库管理员,需要为一个在线书店设计数据库。
请列出至少五个实体,并为每个实体设计至少三个属性。
2. 给定以下SQL查询语句:```SELECT AuthorName, COUNT(*) AS BookCountFROM BooksJOIN Authors ON Books.AuthorID = Authors.AuthorIDGROUP BY AuthorNameORDER BY BookCount DESC;```请解释该查询语句的功能,并描述其可能的输出结果。
四、案例分析题(共30分)假设你负责维护一个大学的学生信息系统。
请根据以下场景回答问题:1. 描述如何使用SQL语句添加一个新学生记录。
2. 如果需要查询所有计算机科学系学生的姓名和学号,应使用什么SQL查询语句?3. 假设系统需要支持学生选课功能,描述如何设计相应的数据库表和关系。
数据库期末考试试题及答案
数据库期末考试试题及答案一、单项选择题(每题2分,共20分)1. 数据库管理系统(DBMS)是()。
A. 一组软件B. 一个数据库C. 一组硬件D. 一个操作系统答案:A2. 在关系数据库中,关系是指()。
A. 行的集合B. 列的集合C. 行和列的有序对集合D. 行和列的无序对集合答案:C3. SQL是()。
A. 数据定义语言B. 数据控制语言C. 数据操纵语言D. 结构化查询语言答案:D4. 数据库系统的核心是()。
A. 数据模型B. 数据库管理系统C. 数据库D. 应用程序答案:C5. 数据库设计中,视图设计属于()。
A. 概念性设计B. 逻辑设计C. 物理设计D. 实体-关系模型设计答案:B6. 在关系数据库中,一个关系至少有一个候选键,一个候选键可以有()个属性。
A. 一个B. 多个C. 零个D. 任意个答案:B7. 数据库管理系统能提供数据的()。
A. 物理独立性B. 逻辑独立性C. 数据独立性D. 以上都是答案:D8. 数据库中,存储数据的基本单位是()。
A. 记录B. 字段C. 表D. 文件答案:C9. 数据库系统与文件系统相比,数据库系统能够提供()。
A. 数据共享B. 数据独立性C. 数据完整性D. 以上都是答案:D10. 在数据库中,数据的完整性约束不包括()。
A. 实体完整性B. 参照完整性C. 用户定义的完整性D. 数据冗余答案:D二、填空题(每题2分,共20分)1. 数据库系统由数据库、数据库管理系统和_________组成。
答案:数据库应用程序2. 数据库系统的核心是_________。
答案:数据库3. 数据库管理系统的主要功能包括数据定义、数据操纵、数据控制和_________。
答案:事务管理4. 在关系数据库中,关系模式的每一个分量称为_________。
答案:属性5. 数据库设计分为概念性设计、_________设计和物理设计三个阶段。
答案:逻辑6. 在数据库中,_________是指关系中的列。
四川大学数据库系统原理期末考试试题
四川大学期末考试试题(闭卷)A课程名称:数据库系统原理一.选择题。
(每小题2分,共12分)1.以下不是事物性质的是()A.持久性 B.原子性 C.可串行性 D.一致性2.以下封解锁序列中,满足两段锁协议的是()A.Lock-X(U)…Lock-S(V)…Lock-S(W)…Unlock(U)…Unlock(W)…Unlock(V) B.Lock-X(U)…Unlock(U)…Lock-S(V)…Unlock(V)…Lock-S(W)…Unlock(W) C.Lock-X(U)…Lock-S(V)…Unlock(U)…Unlock(V)…Lock-S(W)…Unlock(W) D.Lock-X(U)…Unlock(U)…Lock-S(V)…Lock-S(V)…Unlock(W)…Unlock(W) 3.以下关于死锁的说法中正确的是()A.两段锁协议可避免死锁 B.DBMS一般采用超时法检查死锁C.死锁是由于持锁事务重启后造成的 D.系统中至少有两个并发事务才可能发生死锁4.当事务获得数据项Q的排他锁后,该事务()A.只能读Q B. 只能写Q C. 既能读Q,又能写QD.既不能读Q,也不能写Q5. 如果一个系统关系模式仅有两个属性,则该关系模式至少满足()A. INFB.2NFC.3NFD.BCNF6.在数据局设计中,画ER图是()的主要任务A.需求分析阶段 B.概念结构设计阶段C.逻辑结构设计阶段 D.物理结构设计阶段二.简答题。
(每小题6分,共12分)1.什么是数据库系统的三级模式结构?它是如何保证数据独立性的?2.1.以下1-2要求写出关系代数查询。
1.查询“t1003”号员工工作过的各部门部门编号和部门名;2.查询在“t1003”号员工工作过的所有部门都工作过的员工的编号及其姓名;以下3-6要求写出SQL查询:3.查询“t1003”号员工工作过的各部门部门编号和部门名;4.查询所有姓名为“王勇”的员工工作过的部门编号和部门名;5.查询在“t1003”号员工工作过的所有部门都工作过的员工的编号及其姓名;6.查询目前在职员工人数最多的部门编号。
四川大学数据库系统_双语期末考题
1.Multiple Choices (20 marks, 2 marks for each)1) In a database system, whose responsibility is it to provide data consistency?A. the database administrator'sB. the DBMS'sC. the user'sD. the application programmer's2) The term logical data independence refers to the ability to changeA. the conceptual schema without changing the external schemas, or the application programsB. the physical schema of the data without changing the external schemas, the conceptual schemas, or the application programsC. the application programs without changing the conceptual schemaD. the data without physically relocating the tables3) A database is needed for which of the following application scenarios?I. A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information.II. In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee.III. A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene.A. I and II onlyB. I onlyC. I and III onlyD. I, II, and III4) Which of the following are usually used to represents ENTITY TYPE in ER modeling.A. verbB. nounC. proposition.D. adjective5) What information is necessary when specifying the structure of a table in a relational schema?A. the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributesB. the name of the table and the names of the table's attributesC. the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can haveD. the name of the table and the amount of storage space to be allocated to the table6) Which of the following problems can be caused by data redundancy in a relational schema?I. Inefficient use of spaceII. Update anomalies and possible loss of dataIII. Inefficient use of processing timeA. I and II onlyB. II onlyC. I and III onlyD. I, II, and III7) Which of the following are properties of transactions in database systems?I. Atomicity and DurabilityII. Consistency and IsolationIII. Unique and IndependentA. I and II onlyB. I and III onlyC. II and III onlyD. I, II, and III8) Which of the following is true about transactions affecting the consistency of a database?A. A transaction always leaves the database in a consistent state.B. A transaction leaves the database in a consistent state if there is no system crash during the execution of the transaction.C. A transaction leaves the database in a consistent state if the user has not violated any integrity constraints.D. There are no guarantees that transactions will leave the database in a consistent state.9) In a two-phase locking protocol, what happens when a transaction requests a conflicting lock?A. The transaction is aborted immediately.B. The transaction immediately acquires the lock from the current lock-holder.C. The transaction proceeds without acquiring the lock.D. The transaction is blocked to acquire the lock.10) During recovery, which of the following transaction operations has both the before and after images?A. CommitB. InsertC. DeleteD. Update2. Write SQL statements (30 marks, 5 marks for each)Consider a database schema with the following relations:Student (SSN, name);Course (ID, instructorName, title, credits, classroom);Enroll (studentSSN, courseID, score);Write SQL statements in SQL2 to perform the following commands.1)Find SSNs and names of all students who are enrolled in a class taught by ‘Smith’;2)Find SSNs and names of all students who are NOT enrolled in a class taught by ‘Smith’;3)List alphabetically titles of all courses either are taught by teachers whose names begin with “Li”OR are taught in room number 4-456. Do NOT list duplicate titles;4)Find the name of the student who enrolled in the course titled “Database” and get the highest score;5)List all students’ name and their average score;6)Find SSNs and names of all students who are enrolled in at least all classes that the student ‘John’enrolled.3. Database Design (30 marks)Y ou are first required to create a conceptual data model of the data requirements for a company that specializes in IT training and then map the conceptual data model into a relational schema. The Company has 30 instructors and can handle up to 100 trainees per training session. The Company offers five advanced technology courses, each of which is taught by a teaching team of two or more instructors. Each instructor is assigned to a maximum of two teaching teams or may be assigned to do research. Each trainee undertakes one advanced technology course per training session.1) Identify the main entity types for the company.2) Identify the main relationship types and specify the multiplicity for each relationship. State any assumptions you make about the data.3) Using your answers for the previous two to draw a single ER model to represent the data requirements for the company.4) Convert the E-R model into a relational schema using the mapping algorithm specified in this course. Specify key and referential integrity constraints, using directed arcs. Make sure you also identify alternate keys. Label each step of the mapping algorithm.4. Normalization (20 marks)The following table lists dentist/patient appointment information. A patient is given an appointment at a specific date and time with a dentist located at a particular surgery. On each day of patient appointments, a dentist is allocated to a specific surgery for that day.Perform the following tasks:1) The table is susceptible to update anomalies. Provide examples of insertion, deletion, and update anomalies.2) Describe and illustrate the process of normalizing the table to BCNF. State any assumptions you make about the data shown in the table.。
数据库期末考试试题及答案
数据库期末考试试题及答案一、选择题(每题2分,共20分)1. 在关系数据库中,表与表之间的联系是通过什么实现的?A. 索引B. 主键C. 外键D. 视图答案:C2. SQL语言中,用于查询数据的命令是:A. UPDATEB. INSERTC. SELECTD. DELETE答案:C3. 数据库管理系统(DBMS)的主要功能不包括以下哪一项?A. 数据存储B. 数据查询C. 数据加密D. 数据维护答案:C4. 在数据库中,以下哪个不是数据完整性的类型?A. 实体完整性B. 参照完整性C. 用户完整性D. 域完整性答案:C5. 以下哪个不是数据库设计阶段?A. 需求分析B. 概念设计C. 逻辑设计D. 物理设计答案:A6. 以下哪个是数据库的并发控制技术?A. 锁定B. 索引C. 视图D. 触发器答案:A7. 在SQL中,用于删除表中数据的命令是:A. DROPB. DELETEC. REMOVED. ERASE答案:B8. 数据库的事务具有以下哪个特性?A. 持久性B. 可靠性C. 可用性D. 完整性答案:A9. 在关系数据库中,哪个操作用于添加新的列?A. ALTER TABLEB. CREATE TABLEC. UPDATE TABLED. INSERT INTO答案:A10. 数据库恢复的基础是:A. 日志文件B. 数据字典C. 备份文件D. 索引答案:A二、填空题(每空2分,共20分)11. 数据库管理系统(DBMS)的核心是________。
答案:关系数据库12. 在SQL中,用于插入数据的命令是________。
答案:INSERT INTO13. 数据库的三大范式分别是第一范式(1NF)、第二范式(2NF)和________。
答案:第三范式(3NF)14. 在数据库中,用于更新数据的命令是________。
答案:UPDATE15. 数据库的并发控制主要是为了解决________和________问题。
四川大学数据库技术复习题 一选择题
数据库技术试题一、选择题1. 单个用户使用的数据视图的描述称为A. 外模式B. 概念模式C. 内模式D. 存储模式2. 子模式DDL用来描述A. 数据库的总体逻辑结构B. 数据库的局部逻辑结构C. 数据库的物理存储结构D. 数据库的概念结构3. 在DBS中,DBMS和OS之间的关系是A. 相互调用B. DBMS调用OSC. OS调用DBMSD. 并发运行4. 当关系R和S自然联接时,能够把R和S原该舍弃的元组放到结果关系中的操作是A. 左外联接B. 右外联接C. 外部并D. 外联接5. 下列聚合函数中不忽略空值 (null) 的是A. SUM(列名)B. MAX(列名)C. COUNT( * )D. AVG(列名)6. 设关系模式R (A,B,C),F是R上成立的FD集,F = {B→C},则分解ρ = {AB,BC}相对于FA. 是无损联接,也是保持FD的分解B. 是无损联接,但不保持FD的分解C. 不是无损联接,但保持FD的分解D. 既不是无损联接,也不保持FD 的分解7. 在数据库设计中,将ER图转换成关系数据模型的过程属于A. 需求分析阶段B. 逻辑设计阶段C. 概念设计阶段D. 物理设计阶段8. SQL中,下列涉及空值的操作,不正确的是A. AGE IS NULLB. AGE IS NOT NULLC. AGE = NULLD. NOT (AGE IS NULL)9. 一个关系中的候选关键字。
A .至多一个B .可多个C .必须多个D .至少 3 个10. DBMS中实现事务持久性的子系统是A. 安全性管理子系统B. 完整性管理子系统C. 并发控制子系统D. 恢复管理子系统11. SQL的全局约束是指基于元组的检查子句和A. 非空值约束B. 域约束子句C. 断言D. 外键子句12. 分布式数据库系统中分片模式和分配模式均是A. 全局的B. 局部的C. 分布的D. 集中的13. 属性类型允许是基本数据类型、结构类型和集合类型的模型是A. 平面关系模型B. 嵌套关系模型C. 复合对象模型D. 分布式关系模型14. 用树型结构表示实体之间联系的数据模型称为A.关系模型B.运算模型C.网状模型D.层次模型15. 数据库系统的核心是A.数据库B.数据库管理系统C.数据模型D.软件工具16. 在SQL语言中,与X BETWEEN 10 AND 20等价的表达式是A.X>10 AND X<20B.X>=10 AND X<20C.X>10 AND X<=20D.X>=10 AND X<=2017. 某个E-R图中有5个实体型,2个1∶n联系和2个m∶n联系,则该E-R图转换的关系模式个数至少是A.5个B.7个C.8个D.9个18. 若关系模式R(V,F)中的每一个决定属性集都包含候选码,则R属于A.2NFB.3NFC.BCNFD.4NF19. 若事务T对数据R已加X锁,则其他事务对数据RA.可以加S锁不能加X锁B.不能加S锁可以加X锁C.可以加S锁也可以加X锁D.不能加任何锁20.在目前的并行数据库体系结构中,可扩充性最高的是A.SMB.SDC.SND.SK21.数据的正确性和相容性是指数据库的A.完整性B.安全性C.并发性D.一致性22.下列不属于事务的特性的是A.隔离性B.一致性C.完整性D.原子性23.系统在运行过程中,由于某种硬件故障,使存储在外存上的数据部分损失或全部损失,这种情况属于A.事务故障B.系统故障C.介质故障D.运行故障24.E-R图是数据库设计的常用工具之一,它适用于建立数据库的A.概念模型B.逻辑模型C.结构模型D.物理模型25.数据库逻辑结构设计的主要任务是A.建立E-R图B.把数据送入数据库C.建立数据流图和需求说明书D.将E-R图转换为某个DBMS所支持的数据模型26.下面不是SQL语言优点的是。
大学计算机基础 四川大学期末考试题
(C)数据共享性、数据独立性和冗余度小 (D)数据共享性和数据独立性 40. 关于信息和数据,下面正确的说法是【 】 (A)信息与数据,只有区别没有联系 (B)信息是数据的载体 (C)同一信息用同一数据表示形式 (D)数据处理本质上就是信息处理
信子网组成。 10. 数据库管理系统不属于系统软件。各位老师、同学共同切磋或发送邮件至 chenjiehua@。第14页共32页
四、简答题(每题 5 分,共 20 分)
1. 计算机是由哪五大部件组成的?请简要说明这些部件的具体功能。 2. 计算机系统是由哪两大系统组成的?请简要说明这两大系统的关系。 3. 什么是操作系统?简述操作系统一般应该具有哪五大管理功能? 4. 请简要说明数据庫系统组成的四个方面。
6. 数字字符“1”的 ASCII 码的十进制表示为 49,那么数字字符“8”的 ASCII 码的十进 制表示为【 】。 (A)56 (B)58 (C)60 (D)54
7. 键盘当中用来输入上档字符的是【 】。 (A)回车键 ENTER
本文档素材取自于各种资料,不是陈杰华原创,欢迎各位老师、同学共同切磋或发送邮件至 chenjiehua@。第2页共32页
二、填空题(每题 1 分,共 30 分)
1. 将各种数据转换成为计算机能处理的形式并输送到计算机中去的设备统称为【 】。 2. 一个非零的无符号二进制整数,若在其右边末尾加上两个“0”形成一个新的无符号二
进制整数,则新的数是原来数的【 】倍。 3. 以国标码为基础的汉字机内码是两字节编码,每个字节的最高位为【 】。 4. 磁盘驱动器属于【 】。 5. 总线分为地址总线、数据总线和【 】总线。 6. 为区分内存中不同存储单元可为每个存储单元分配一个编号,称为内存【 】。 7. 计算机硬件系统由【 】、存储器、输入设备和输出设备五大部件组成。 8. 微机可以配置不同的显示系统,在 CGA、EGA 和 VGA 标准中,显示性能最好的一种是
四川大学数据库系统期末试题2014-2015
四川大学期末考试试题(闭卷)(2014-2015学年第1学期)1. Multipl e Choices (20 marks, 2 marks for each)1)、The foll owing are functions of a DBMS except ( )A. c reating and processing formsB. creating d at abasesC. processing d at aD. a dministrating d at abases2)、In a one-to-many rel ationship, the entity that is on the one sid e of the rel ationship is call ed a ( )entity .A. p arentB. c hil dC. i nst anceD. s ubtype3)、When the values in one or more attributes being used as a foreign key must exist in another set of one or more attributes in another t abl e, we have created a ( ):A. transitive d epend ency .B. insertion anomaly.C. referential integrity constraint.D. normal form.4)) A tupl e is a ( ):A. column of a t abl e.B. two dimensional t abl e.C. row of a t abl e.D. key of a t abl e.5)、In which of the foll owing is a singl e-entity inst ance of one type rel ated to many entity inst ances of another type?()( )A. One-to-One Rel ationshipB. One-to-Many Rel ationshipC. Many-to-Many Rel ationshipD. Composite Rel ationship6)、Which of the foll owing is NOT a basic el ement of all versions of the E-R mod el?( )A. EntitiesB. AttributesC. Rel ationshipsD. Primary keys7)、The DROP T ABLE st atement:()A. d el etes the t abl e structure only.B. d el etes the t abl e structure al ong with the t abl e d at a.C. works whether or not referential integrity constraint s woul d be viol ated.D. is not an SQL st atement.8)、SQL views can be used to hid e:()A. columns and rows only.B. complicated SQL synt ax only.C. both of the above can be hid d en by an SQL view.D. None of the above is correct.9)、The first step in d at abase d evel opment is which of the foll owing?()A. Enterprise d at a mod elingB. Logical d at abase d esignC. Physical d at abase d esign and d efinitionD. Dat abase Impl ement ation10)、Which of the foll owing d at abase activities d etermines the entities, attributes, and rel ationships of d at a?()A. Conceptual d at a mod elingB. Logical d at abase d esignC. Physical d at abase d esign and d efinitionD. Dat abase impl ement ation2.Write SQL st atement s (30 marks, 6 marks for each)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_numbe r)account (account_number, branch_name, balance)depositor (customer_name, account_number)From the database schema above, give an expression in SQL for each of queries 2, 3, 4 and 5.1)、Define the relation “account” in SQL.Tip: Describe primary keys, foreign keys and check constrains if necessary.2)、To find all loan number for loans made at the Perryridge branch with loan amounts greater than $1200.3)、Find all customers who have both a loan and an account4)、Find the names of all branches where the average account balance is more than $1,200.5)、Find all loan number which appear in the loan relation with null values for amount1)、What is the purpose of the index mechanism in database system? And give the definitions of primary index and secondary index.2)、Please list the five duties of a database administrator3)、Please give the definition of “trigger” in database system.4)、Explain the distinctions among the terms superkey, candidate key and primary key.4、Dat abase Design (30 marks)You are first required to create a conceptual data model of the data requirements for a company that specializes in IT training and then map the conceptual data model into a relational schema. The Company has 30 instructors and can handle up to 100 trainees per training session. The Company offers five advanced technology courses, each of which is taught by a teaching team of two or more instructors. Each instructor is assigned to a maximum of two teaching teams or may be assigned to do research. Each trainee undertakes one advanced technology course per training session.1) 、Identify the main entity types for the company.2)、Identify the main relationship types and specify the multiplicity for each relationship. State any assumptions you make about the data.3)、Using your answers for the previous two to draw a single ER model to represent the data requirements for the company.4)、Convert the E-R model into a relational schema using the mapping algorithm specified in this course. Specify key and referential integrity constraints, using directed arcs. Make sure you also identify alternate keys. Label each step of the mapping algorithm.。
SSD7试题2006-1
四川大学期末考试试题(闭卷)(2005-2006学年第2学期)课程号:课序号:课程名称:数据库系统原理(A卷)任课教师:阮树骅、张天庆适用专业年级:软件工程2004级学生人数: 400印题份数: 430 学号:姓名:1.Multiple Choices. (2poits×10)(1)The cardinality of a table i s the number of _____ in the table.A. keysB. foreign keysC. rowsD. coloums(2)Consi der the followi ng functional dependency.{A, B} -> {C}Regarding thi s dependency, whi ch of the followi ng statements i s (are) true?I. The val ues of C are uniquely determined by the values of A.II. The values of A are uni quely determined by the values of C.A. None.B. I only.C. I and II.D. II only.(3)The FD X -> Y i s a full dependency in a relation R, i f there is _____ attribute A that can be _____ X and thedependency still holds.A. at least one, added toB. at l east one, removed fromC. no, added to C. removed from(4)An excl usive l ock on a data i tem represents permi ssi on to perform whi ch of the operations, read and wri te, on thedata item?A. Both read and write.B. Wri te onl y.C. Read only.D. Nei ther read nor wri te.(5)In a two-phase locking protocol, what happens during the shri nki ng phase?A.The transaction cannot acqui re locks, but can release its l ocks.B.The transaction can acqui re locks, but cannot release its l ocks.C.The transaction can acqui re locks, and can release its l ocks.D.The transaction can acqui re locks, and can release its l ocks as l ong as the number of released locks i s greater(6)The term p hysical d ata indep endence refers to the ability to changeA.the conceptual schem a without changing the application program sB.the physical layout of the data without changing the external schem as, the conceptual schem as, or theapplication program sC.the application program s without changing the conceptual schem aD.the data without physically relocating the tables(7)What attributes does a subclass have?A.Just the attributes from the superclassB.All the attributes of its superclass, and possibly m oreC. A subset of the attributes of its superclassD.None of the attributes of its superclass(8)Hashing exhibi ts the best performance forA.equality searches involvi ng the key, provided the key i s used for hashi ngB.range queriesC.sequential scan of the enti re tableD.orderi ng query resul ts based on the key used for hashing(9)Whi ch of the followi ng can be used to measure hard disk dri ve performance?I.Seek timeII.Rotational latencyIII.Block transfer timeA.I onlyB. II onl yC. II and IIID. I, II, and III(10)In a two-phase locking protocol, what happens wh en a transaction requests a conflicting lock?A.The transaction imm ediately acquires the lock from the current lock-holder.B.The transaction proceeds without acquiring the lock.C.The transaction is blocked to acquire the lock.D.The transaction is aborted imm ediately.2.Write SQL statem ents.(5poits×6)You will be working wi th the followi ng schema:Empl oyee (SSN, name, salary, DNo)Department (DNo, DeptName, MgrSSN)Project (PNo, l ocation, ProjName)HourLog (SSN, PNo, hours)The Empl oyee relation provi des a list of employees wi th thei r SSN, name, salary, and department number (DNo). The SSN is unique for each employee. Each employee bel ongs to onl y one department. The Department relation contai ns a li st of the departments for the company. Its schema i ncludes a unique department number called DNo. It al so incl udes the name of the department (DeptName) and the social security number of the department's manager (MgrSSN). Each department has a onl y one manager. The Project relation incl udes a uni que project number (PNo), l ocation and the project name (ProjName). Anthe HourLog relati on li sts for each project the number of hours of work for each employee who i s assi gned to that project. The key of thi s relati on i s SSN and PNo. Write SQL statements in SQL2 to perform the following commands.(1)List all managers’ SSN, name and salary.(2)Find the name and the SSN of everyone who works more than 100 hours on one parti cul ar project.(3)Find the name and the SSN of everyone who works on at least two projects.(4)Find the name and the SSN of everyone who i s not working on any projects.(5)List alphabeti cally the names and SSNs of employees whose total work hours on all project are more than the averagehours.(6)Assume the relation Empl oyee and Department has been created usi ng the following statements:CREA TE TABLE Employee( SSN char (4) pri mary key,Name varchar (30),Salary fl oat,Dno char (2));CREA TE TABLE Department( DNo char(2) primary key,Deptname varchar(30),MgrSSN char(4))Write AL TER statements to speci fy the referential integrity constraints on above two relations.3.In this problem, w e shall design a database involving cities, the countries they ar e in, and "consulates." (领事馆) (15points×2)The r elevant information:●Each ci ty i s in a unique country. Data about ci ties incl ude the name of the city and its populati on. Names of ci ties areunique within countries, but two ci ties in different countries may have the same name (and possibly even the same population).●Information about a country incl udes its name and i ts head of state. You may assume no two countries have thesame name.●Information about a consulate incl udes its name, whi ch i s unique (e.g., "consulate of the Uni ted States in Toronto")and its street address (whi ch i s unique wi thin a city, but might not be unique among all consulates i n di fferent ci ties).●Cities and the country they are i n are related by a relationship In.●Consulates and the city in whi ch each i s located are related by a relationship Location.●Countries and consulates are related by a representation Represents. Each country represented by a consulate has aconsul, who i s represented only by a name. A subtle poi nt i s that occasi onally, a consulate will represent more thatone country. For example, country A may not have diplomati c relati ons wi th country B, so A will ask country C to represent A's i nterests in country B at their own consulates. In that case, the consul for country A i s actually a citizen of country C, and that person will likel y not be the same as the consul for country C at the same consulate.●While you might assume that a country would have at most one consulate in a given ci ty, whi ch i s not al ways thecase. For example, the US retains two consulates i n Jerusalem.Draw an ER schema for the database. Do not forget your reasonable assumptions.specified in this course. Specify keys and r efer ential integrity constraints, using dir ected arcs. Make sur e you also identify alternate keys. Label each step of the mapping algorithm. (15p oits)5.The following table stor es information about which member s borrow books in library. Note thata book can be lent to many m ember s at differ ent tim e. (20points)Member_Borrow_Book:Perform the following tasks.(1)List the prim ary key.(2)List all the FDs.(3)What norm al form is the relation in? Explain.(4)Apply norm alization to it increm entally, carrying the norm alization process through each of the higher norm alform s possible up to 3NF.。
2022年四川大学计算机科学与技术专业《数据库原理》科目期末试卷A(有答案)
2022年四川大学计算机科学与技术专业《数据库原理》科目期末试卷A(有答案)一、填空题1、数据库系统是利用存储在外存上其他地方的______来重建被破坏的数据库。
方法主要有两种:______和______。
2、数据库管理系统的主要功能有______________、______________、数据库的运行管理以及数据库的建立和维护等4个方面。
3、主题在数据仓库中由一系列实现。
一个主题之下表的划分可按______、______数据所属时间段进行划分,主题在数据仓库中可用______方式进行存储,如果主题存储量大,为了提高处理效率可采用______方式进行存储。
4、在关系数据库的规范化理论中,在执行“分解”时,必须遵守规范化原则:保持原有的依赖关系和______。
5、数据库系统在运行过程中,可能会发生各种故障,其故障对数据库的影响总结起来有两类:______和______。
6、设某数据库中有作者表(作者号,城市)和出版商表(出版商号,城市),请补全如下查询语句,使该查询语句能查询作者和出版商所在的全部不重复的城市。
SELECT城市FROM作者表_____SELECT城市FROM出版商表;7、在RDBMS中,通过某种代价模型计算各种查询的执行代价。
在集中式数据库中,查询的执行开销主要包括______和______代价。
在多用户数据库中,还应考虑查询的内存代价开销。
8、在数据库系统封锁协议中,一级协议:“事务在修改数据A前必须先对其加X锁,直到事务结束才释放X锁”,该协议可以防止______;二级协议是在一级协议的基础上加上“事务T在读数据R之前必须先对其加S锁,读完后即可释放S锁”,该协议可以防止______;三级协议是在一级协议的基础上加上“事务T在读数据R之前必须先对其加S锁,直到事务结束后才释放S锁”,该协议可以防止______。
9、若事务T对数据对象A加了S锁,则其他事务只能对数据A再加______,不能加______,直到事务T释放A上的锁。
四川大学数据库2020年期末试卷和答案
(2020——2021学年第1学期)
课程号:304208040课序号:课程名称:数据库系统A原理任课教师:成绩:
适用专业年级:计算机应用2018级学生人数:印题份数:学号:姓名:
考生承诺
我已认真阅读并知晓《四川大学考场规则》和《四川大学本科学生考试违纪作弊处分规定(修订)》,郑重承诺:
1.项目(项目名,项目组长,指导老师,该老师指导的项目数)
假定:一个项目一位组长,一个项目只有一个指导老师。
2.职工(职工号,姓名,基本工资,工作部门)
假定:一个职工在一个部门工作。
3.R (A, B, C, D), F = {D→B , CD→A}
4.R(A,B,C), F = {C→A, AB→C}
请解答下列问题:
1.画出数据库的实体联系图(E-R图,5分);
2.将该E-R图转换为3NF的关系数据库模式(用下划线标出主码,5分);
3.基于上述的关系模式,用SQL写出如下查询:(5分)
求相关题目数量不足30的小节的节号和标题。(“相关题目”指使用了小节包含的知识点的题目)
参照第四大题的表结构,设有下面的SQL查询,请画出其关系代数表示的语法树,并用关系代数表达式的优化算法将其转化为优化的语法树。
5.找出所有其报酬高于所在项目平均报酬的员工的所在项目号、姓名和报酬;
6.查询参与了“张三”参与的所有项目,但没有参与“李四”参与的任何项目的员工的姓名。
某教材有若干知识点(点号,名称,视频链接),若干题目(题号,题干,难度,答案),若干小节(节号,标题,字数);每个题目使用一或多个知识点,一个知识点可被多个题目使用;一个知识点属于且只属于一个小节;一个小节包含一到多个知识点。今要建立该教材的数据库。(15分)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
评阅教师得分四川大学期末考试试题(闭卷)(2014~2015学年第2学期)
课程号:311038040 课程名称:数据库系统(A卷)任课教师:
适用专业年级:软件工程2013级学号:姓名:
2. 请将答案全部填写在本试题纸上;
3. 考试结束,请将试题纸、添卷纸和草稿纸一并交给监考老师。
✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈✈
1.Multiple Choices. (T otal marks: 10)
1.Which of the following SQL commands can be used to change, add, or drop column definitions from
a table? ______
(a)AL TER T ABLE (b) CHANGE T ABLE (c) UPDA TE T ABLE (d) MODIFY T ABLE
2.If functional dependences A→ C, AB→ D and A→ B hold, _________ does not hold.
(a)AB→ C (b)AB → CD (c) A → D (d) B → D
3.In a two-phase locking protocol, what happens when a transaction requests a conflicting lock?
______
a)The transaction immediately acquires the lock from the current lock-holder.
b)The transaction proceeds without acquiring the lock.
c)The transaction is blocked to acquire the lock.
d)The transaction is aborted immediately.
4.What attributes does a subclass have? ______
a)Just the attributes from the superclass
b)All the attributes of its superclass, and possibly more
c)A subset of the attributes of its superclass
d)None of the attributes of its superclass
5.An insertion operation will _____ if the inserted primary key has a NULL value.
(a) succeed with warning (b) fail (c) crash the system (d) succeed without warning
评阅教师得分
评阅教师得分2.Relational Algebra. (T otal marks: 10)
Consider the following relations, and write the results of relational algebra expressions.
A B C
A 2 A
A 3 B
B 2 C
B D
2 100
3 200
1)r ×s (Marks: 3)
2)r s (Marks: 3)
3)∏A,B (r) ÷∏B (s) (Marks: 4)
3.Queries. (T otal marks: 30)
Consider the following relational schemas describing an atlas(地图集) :
continent (name, area)
country (name, continent, population)
city (name, country, province)
Write SQL statements in to perform the following instructions.
评阅教师
得分
评阅教师
得分
(1) List the name of the countries of the continent whose name begins these letters:’as ’ in alphabetical order. (2) Give the number of cities for each country in the continent whose name is ‘asia ’ in ascending order. (3) List the name of all countries with more than ten cities. (4) Give the name of the country that has the most cities. (5) Give the name of the largest population continent.
(6) List the countries name in the continent ‘asia ’ that have a larger population than any of the countries of ‘europe ’.
4. Normalization. (T otal marks: 20)
1. The following table stores information about students and projects they participate in a university.
1) Identify functional dependencies of the table EMP_DEPT according to your reasonable assumptions.
(Marks: 6)
2) Identify the candidate key(s) of the table EMP_DEPT . (Marks: 6)
3) IS the relation schema student_project in BCNF ? Why? Is it in 3NF ? Why? If it is not in 3NF , bring it to a set
of relations at least in 3NF; specify primary keys and referential integrity constraints for each relation. (Marks:8)
5. Database Design (T otal marks: 30)
1.Consider above figure, which models an online bookstore. Convert the E-R diagram to 3NF relations.
Specify keys and referential integrity constraints. (Marks:15)
2.Consider the following information about a university database:
●Professors have an id, a name, a date of birth, a rank, and a research specialty.
●Projects have a project number, a sponsor name (e.g. NSF), a starting date, an ending date, and a
budget.
●Graduate students have an id, a name, a date of birth, and a degree program (e.g. M.S or Ph.D).
●Each project is managed by one professor (known as the project’s principal investigator).
●Each project is worked on by one or more professors (known as the project’s co-investigators).
●Professors can manage and/or work on multiple projects.
●Each project is worked on by one or more graduate students (known as the project’s research assistant).
●When graduate students works on a project, a professor must supervise their work on the project.
Graduate students can work on multiple projects, in which case they will have a (potentially different)
supervisor for each one.
Design an E-R diagram that captures the information above. (Mark: 15)。