杭电 2015年数据库期末试卷
D. R ε BCN F
14、设关系模式 R{A,B,C,D,E},其上的函数依赖集 F={AB→C,DC→E,D→B},则可导出的函数依赖是( )
A、AD→E
B、BC→E
C、DC→AB
D、DB→A
15、在SQL SERVER15/服务器上,存储过程是一组预先定义并( )的Transact-SQL语句
第1页
共4页
选课 SC(学生号 sno,课程号 cno,成绩 score) 用关系代数写出下述检索,字段用英文表示。。 (1)查询职称为'讲师'的女教师的教师号。 (2)查询计算机系教师所授的课程名。 (3)查询至少选修了“李丽”老师所授全部课程的学生号。 (4)查询没有选修“数据库”的学生姓名。 (5)查询至少上 2 门课程的教师名。
Sex Address PhoneNumber Email DeptID
Bi(t 1 表示’男’) 否
Char(20)
可
Char(12)
可
Char(30)
可
Char(3)
可
性别 通信地址 电话号码 电子邮件 部门编号
外键
属性名 DeptID DeptName Leader
部门表(Department)
备注 主键,外键
请使用 SQL 语句完成下面各题,并把答案写在答题纸上。 (1)找出没有提供“通信地址”的员工名。
(2)查询“研发部”员工的收入情况,显示收入、支出这两项。
(3)统计各部门在 1966 年以前出生的雇员的人数(qty)和部门号。
(4)将“销售部”的领导更改为“李强”。
五、设计题(本大题共 7 小题,每小题 5 分,共 35 分)
(3) R3 = R T
A>D
(5) R5 = T ÷R
三、应用题(本大题共 5 小题,每小题 4 分,共 20 分) 已知关系模式: 教师 T(教师号 tno,姓名 tname,性别 tsex,年龄 tage,系别 tdept,职称 tlevel,工资 tpay), 授课 TC(教师号 tno,课程号 cno), 课程 C(课程号 cno,课程名 cname,课时 chour) 学生 S(学生号 sno,学生名 sname,学生性别 ssex,学生年龄 sage,学生系别 sdept)
A、6
B、9
C、12
D、15
11、设四元关系 R(A,B,C,D),则下面不正确的是(
)
A. D,B (R) 为取属性D,B的两列组成新关系
B. 4,2 (R) 为取属性的值是4,2的两列组成新关系
C. D,B (R) 与 4,2 (R) 是等价的
D. D,B (R) 与 2,4 (R) 是相同关系
成的情况发放酬金。 (5)工程项目有工程号、工程名两个属性;部门有部门号、部门名称两个属性;职工有职工号、姓名、
性别属性。 要求: (1)根据上述规则设计 E-R 模型。【5】 (2)将 E-R 模型转换成关系数据模型,并用下划线标明每个关系中的主键,用波浪线标明外键。【4】
2、关系模式 R(A,B,C,D,E),函数依赖 F={A→D,E→D,D→B,BC→D,CD→A } (1)求出 R 的所有候选键;【4】 (2)根据函数依赖关系,确定关系模式 R 属于第几范式 【2】
C.不同的数据只能被对应的应用程序所使用
D.以上三种说法都不对
2、在数据库系统中,模式/外模式映像用于解决数据的( )
A. 结构独立性
B. 物理独立性
C. 逻辑独立性
D. 分布独立性
3、用户或应用程序看到的那部分局部逻辑结构和特征的描述是( )
A. 模式
B. 物理模式
C. 子模式
D. 内模式
4、关系数据模型是目前最重要的一种数据模型,它的三个要素分别是( )
A. 保存
B. 编译
C. 解释
D.编写
二、计算题(本大题共 5 小题,每小题 3 分,共 15 分)
设有关系 R、S、T(如下表所示),计算:
R
S
AB ad be cd
AB db ad dc
T
B
C
D
d
b
d
c
c
a
e
b
d
(1) R1 = R∪S
(4) R4 =∏D,C (R T)
2>2
(2) R2 = R-S
共4页
(7)创建存储过程 upEmpInfoByDepName,根据部门名,显示部门的员工信息,包括员工号、员工 名、电话号码。
第2页
共4页
杭州电子科技大学计算机学院期末考试答题卷( A )
考试课程 教师姓名
专业
数据库
考生姓名
14 软件工程
班级
考试日期
学号 成绩
(请大家把答案写在答题纸上)
第3页
共4页
第4页
四、应用题(本大题共 2 小题,共 15 分) 1、假设某公司的业务规则如下: (1)公司下设几个部门,如技术部、财务部、市场部等。 (2)每个部门承担多个工程项目,每个工程项目属于一个部门。 (3)每个部门有多名职工,每一名职工只能属于一个部门。 (4)一个职工可能参与多个工程项目,且每个工程项目有多名职工参与施工。根据职工在工程项目中完
杭州电子科技大学计算机学院期末考试卷( A )
考试课程 教师姓名
专业
数据库
考生姓名
14 软件工程
班级
考试日期
学号 成绩
(请大家把答题的答案写在 答题纸 上)
一、单项选择(本大题共15小题,每小题1分,共15分)
1、数据独立性是数据库技术的重要特点之一。所谓数据独立性是指(
)
A. 数据与程序独立存放
B.不同的数据被存放在不同的文件中
B. 参照完整性约束
C. 域完整性约束
D. 关键字完整性约束
7、SQL 语句中,以下哪个字符串可以用通配符[^12][34]56%表示(
)
A. '123456'
B. '234567'
C. '345678'
D. '654356'
8、关系数据库系统实现专门的关系运算包括( )
A.排序、索引、统计
B. 关联、更新、排序
C.选择、投影、连接
D. 显示、打印、制表
9、有关系R和S,R∩S的运算等价于( )
A.S –(R – S) B. R –(R – S) C.(R – S)U S
D. R U(R – S)
10、设在一个ER模型中有6个不同的实体集和9个不同的二元联系,其中包括3个一对一联系、3个一对多
联系和3个多对多联系,则将此ER模型转换成关系模型时,至少得到( )个关系模式。
B. 一个 NCHAR 占用 2 个字节的空间
C. 当要存储的字符型数据非常大时,应该选择 TEXT 或 CHAR 数据类型
D. 相同长度的 NCHAR 和 CHAR 数据,所占用的存储空间相同
6、有一个关系:学生(学号,姓名,系别),规定学号的值域是 8 个数字组成的字符串,这一规则属于( )
A. 实体完整性约束
属性名
数据类型
D
Char(6)
否
员工号
主键
empName
Char(10)
否
员工名
Birthday
Datetime
否
出生日期 如“1991-2-3”
(5)将员工少于 5 人的部门删除
(6)创建视图 vwEmpSalaryInfo,查看所有员工的薪资情况,显示员工名和实际薪资(收入-支出) (realIncome)。
设人事部数据库有三个基本表,其中表结构如下:
(涉及多表关联时,请尽量使用 e,d, s 分别作为 from 关键字后 Employees, Department 和 Salary 三
张表的别名)
(Select 后的字段如需使用别名显示,会在题目中标识出来,否则请直接使用字段名)
员工表(Employees)
数据类型
可否为空 含义
Char(3)
否
部门编号
Char(20)
否
部门名称
Char(6)
可
部门领导编号
备注 主键
外键
属性名 EmpID InCome OutCome
薪资表(Salary)
数据类型
可否为空
Char(6)
否
decimal(10,2) 否
decimal(10,2) 可
含义 员工号 收入 支出
12、关系数据库规范化是为解决关系数据库中( )问题而引入的
A.插入、删除和数据冗余
B.提高查询速度
C.减少数据操作的复杂性
D.保证数据的安全性和完整性
13、若关系模式 R(A,B,C,D),函数依赖为:A→C,D→B,则 R 所属的最高范式( )
A. R ε 1N F
B. R ε 2N F
C. R ε 3N F
A. 实体完整性、参照完整性、用户自定义完整性
B. 数据结构、关系操作、完整性约束
C. 数据增加、数据修改、数据查询
D. 外模式、模式、内模式
5、SQL SERVER 提供了多种字符数据类型,CHAR,VARCHAR,TEXT,NCHAR,NVARCHAR 等,下列说法
正确的是( )
A. VARCHAR 数据类型,如果插入的数据长度长于最大长度,则超过的将会被截断并插入
(完整word版)2015年数据库期末考试试题和答案
试题一一、单项选择题(本大题共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。
数字系统设计II-2014-2015-期末考试试卷
浙江大学20 14–20 15学年秋冬学期《数字系统设计II》课程期末考试试卷课程号:111C0130,开课学院:_信息与电子工程学系_考试试卷:√A卷、B卷(请在选定项上打√)考试形式:√闭、开卷(请在选定项上打√)允许带1张A4 大小的手写资料和计算器入场考试日期:2015 年1月24 日,考试时间:120 分钟诚信考试,沉着应考,杜绝违纪。
考生姓名:学号:所属院系(专业):_This question considers the basic MIPS 5-stage pipeline (IF, ID, EX, MEM, WB). 1)Assume that each of the above steps takes the amount of time specified in theGiven the times for the datapath stages listed above, what would the clock period be for the entire datapath? In a pipelined datapath, assuming no hazards or stalls, how many seconds will it take to execute an instruction?2)Assume that you have the following sequence of pipelined instructions:lw $6, 0($7)add $8, $9, $10sub $11, $6, $8Where will the data operands that are processed during the EX stage of the subtract (sub) instruction come from? (Consider two situations: (1) there is no forwarding, and (2) there is full forwarding.)2. PIPELINE (13 points):Use the following MIPS code fragment:I1: ADDI $3, $0, 100 # $3 = 100I2: ADD $4, $0, $0 # $4 = 0Loop:I3: LW $5, 0($1) # $5 = MEM[$1]I4: ADD $4, $4, $5 # $4 = $4 + $5I5: LW $6, 0($2) # $6 = MEM[$2]I6: SUB $4, $4, $6 # $4 = $4 – $6I7: ADDI $1, $1, 4 # $1 = $1 + 4I8: ADDI $2, $2, 4 # $2 = $2 + 4I9: ADDI $3, $3, -1 # $3 = $3 – 1I10: BNE $3, $0, Loop #if ($3 != 0) goto Loop1) Show the timing of one loop iteration on the 5-stage MIPS pipeline withoutforwarding hardware. Complete the timing table, shown as Table Q2.1in the next page, showing all the stall cycles. Assume that the branch will stall the pipeline for 1 clock cycle only.2) According to the timing diagram of Table Q2.1, compute the number of clockcycles and the average CPI to execute ALL the iterations of the above loop.Table Q2.1 Timing of one loop iteration on the 5-stage MIPS pipeline without forwarding hardware. (F: instruction fetch, D: instruction decode, X: execute, M: memory access, W: write back.) We assume that the register write is done in the first half of the clock cycle and that register reads are done in the second half of the cycle.3 / 103. CACHE (10 points):A 16-byte cache has 8-byte blocks, has 2 sets, and is 2-way set-associative. The cache initially is empty (all valid bits are off: indicated by a blank box in the table below). The cache receives requests in the sequence listed in Table Q3.1. For each address in the sequence (a) split it into the tag, index, and offset; (b) categorize the access as a hit, a compulsory miss, a confict miss, or a capacity miss (You can abbreviate hit=H, Compulsory=O, Confict=F, Capacity=P); (c) show the new contents of the cache after the access----write the tags for each way, and note which way is LRU.The first one is done for you.Table Q3.14. VIRTUAL MEMORY (9 points):Describe the number of bits required in each entry of a TLB that has the following characteristics:· Virtual addresses are 32 bits wide· Physical addresses are 31 bits wide· The page size is 2K bytes· The TLB contains 16 entries of the page table· The TLB is direct-mappedNote:Each entry of the TLB contains the following items:- a valid bit- the physical page number of the desired virtual page- a tag used to see if the desired entry of the page table is stored in the TLB- ignore the “dirty” bit1)Physical page number:2)Tag:3)The number of bits required in each entry of a TLB:5. CHOICE (60 points) (note: only one is correct):(1)Which of the following descriptions is the reason why binary expression is still used incomputer technique. ( )A: It saves components.B: It has fast computing ability.C: It is decided by the physical property of components.D: It has nice convenience in coping with information.(2)Which one is not one of the five classic components of a computer? ( )A: InputB: BusC: MemoryD: Output(3)What is the range of exponent of IEEE 745 single precision? ( )A: 1~254B: -128~126C: -126 ~127D:-127~128(4)Assume a test program A is running on computer A. It consumes 100 seconds totally, 90for CPU and 10 for I/O. Now, the CPU speed improved by 50% and I/O spee d hasn‟t changed. How much time it takes to run program A now? ( )A: 55 secB: 60 secC: 65 secD: 70 sec(5)A simple program is running on a 32-bit computer. x(int), y(short), z are variables in thisprogram. If x = 127 and y = -9, what are the contents in computer memory after executing the assigning statement z = x + y? ( )A: x = 0000007FH, y = FFF9H, z = 0076HB: x = 0000007FH, y = FFF9H, z = 00000076HC: x = 0000007FH, y = FFF7H, z = 0076HD: x = 0000007FH, y = FFF7H, z = 00000076H(6)Which of the following instructions could this single-cycle datapath description bereferring to? ( )Description :Two source registers (ReadReg) and one destination register (WriteReg) are selected, and the values are read from the source registers and sent as input to the ALU.The ALU operation is performed, the result is written to the destination register, and the PC is updated.A: add B: ori C: li D: sll(7)The following commands were used to store the contents of registers $s0 and $s1 onto thestack:addi $sp, $sp, -8sw $s0, 0($sp)sw $s1, 4($sp)# insert various unrelated instructions hereAssuming that neither the stack pointer nor the stack has been changed during the "various unrelated instructions" part, which of the following would allow you to recover the contents of $s0 and $s1 while returning $sp to its original (pre-decremented) value? ( )A: addi $sp, $sp, 8; lw $s0, 4($sp); lw $s1, 0($sp)B: addi $sp, $sp, 8; lw $s0, 0($sp); lw $s1, 4($sp)C: lw $s0, 4($sp); lw $s1, 0($sp); addi $sp, $sp, 8D: lw $s0, 0($sp); lw $s1, 4($sp); addi $sp, $sp, 8(8)How the cache conflict misses will be affected by the following modifications? ( )Assume the baseline cache is set associative.(a). Double the associativity while keep the capacity and line size constant(b). Double the number of sets while keep the capacity and line size constantA: Decrease; IncreaseB: Increase; DecreaseC: Increase; IncreaseD: Decrease; Decrease(9)Which of the following statements about multiplication and division is incorrect? ( ) A: Integer multiplications takes an input two 32-bit values and returns a 64-bit valueB: The result of a multiplication is stored in a read-only (for the programmer at least) "product" registerC: The product of two numbers is accesssed using two separate instructions - mfhi to get bits 0-31 (the rightmost bits), and mflo to get bits 32-63D: The div command stores the quotient and the remainder in the product register, and the two can be accessed using mfhi and mflo(10)Which of the following is generally true about a design with two levels of caches? ( ) A: First-level caches are more concerned about hit time, and second-level caches are more concerned about miss rate.B: First-level caches are more concerned about miss rate, and second-level caches are more concerned about hit time.C: Second-level caches often use lower associativity than first-level caches given the focus of reducing miss rates.D: Second-level caches are as fast as first-level caches.(11)The communication between central system and the outside environment is doneby ( )A: Input-output subsystemB: Control systemC: Memory systemD: Logic system(12)Which of the following statements about flash memory is wrong? ( )A: The information can be either read or written, and the read speed is the same as write speed.B: The storage unit is consist of MOSFET, so it is a semiconductor storage.C: Information will not lose after power down.D: It can be a replacement for the external memory.(13)Which of the following situation will not happen? ( )A: TLB miss, Cache miss, Page missB: TLB miss, Cache hit, Page hitC: TLB hit, Cache hit, Page hitD: TLB hit, Cache hit, Page miss(14)The techniques which move the program blocks to or from the physical memory is calledas ______. ( )A: Paging B: Virtual memory organisation C: Overlays D: Framing(15)The method of synchronising the processor with the I/O device in which the device sendsa signal when it is ready is______. ( )A: Exceptions B: Signal handling C: Interrupts D: DMA(16)Let's say we have an array with 4 integer elements. The address of the first element in thearray is stored in $t0. Which of the following gives us the result of the last element of the array (stored in $t1)? ( )A: addi $t1, $t0, 3; sll $t1, 2;B: addi $t1, $t0, 16C: sll $t0, 2; addi $t1, $t0, 3D: addi $t1, $t0, 12(17)How many total bits are required for a direct-mapped cache with 16KB of data and4-word blocks, assuming a 32-bit address? Take valid bit into consideration. ( )A: 146Kbits B: 147Kbits C: 148Kbits D: 149Kbits(18)Consider a virtual memory system with 32-bit virtual byte address, 4KB/page, 32 bitseach entry. The physical memory is 512MB. Then, the total size of page table needs. ( ) A: 1MB B: about 3MB C: 4MB D: 8MB(19)What is the average time to read or write a 512-byte sector for a typical disk rotating at10,000 RPM? The advertised average seek time is 6 ms, the transfer rate is 50 MB/sec, and the controller overhead is 0.2 ms. Assume that the disk is idle so that there is no waiting time. ( )A: 6.0ms B: 9.0ms C: 9.01ms D: 9.21ms(20)In cache, the replacement strategy includes RAND, FIFO and LRU. Which of thesestrategies is relative to the locality principle? ( )A: RAND B: FIFO C: LRU D: NONE6. CACHE DESIGN (10 points) (Additional Questions)To improve the hit rate for our data cache, we made it 2-way set associative (it was formerly direct mapped). Sadly as a consequence the hit time has gone up, and we are going to use way-prediction to improve it. Each cache set will have a way prediction indicating which way is likely to be accessed.When doing a cache access, the prediction is used to route the data. If it is incorrect, there will be a delay as the correct way is used. If the desired data is not resident in the cache, it is like a normal cache miss. After a cache miss, the prediction is not used since the correct block is already known. Figure Q6.1-A summarizes this process.Figure Q6.1-A: Way-prediction FSMSince there are two ways, only one bit will be used per prediction, and its value will directly correspond to the way. How the predictions are generated or maintained are beyond the scope of this problem. You can assume that at the beginning of a cycle, the selected prediction is available, and determining the prediction is not on the critical path. The diagram of the data portion of our cache is shown in Figure Q.6.1-B.Figure Q6.1-B Data portion of the cacheOur cache has 16 byte lines, is 2-way set associative, and has a total capacity of 4kB.A.Please complete Table Q6.1 with delays across each element of the cache. Usingthe data you compute in Table Q6.1, calculate the critical path delay through this cache (from when the Input Address is set to when the correct data is on the DataYou may assume that the prediction register is correctly loaded at the start of the cycle, and the clk-to-q delay is 100ps. The inverting and non-inverting buffer drivers both have the same delay. You only need to worry about the case of a fast hit (cache hit with correct prediction).B.Now we will study the impact of way prediction on cache hit rate. For thisproblem, the cache is a 128 byte, 2-way set associative cache with 16 bytes per cache line. The cache is byte addressable and uses a least recently used (LRU) replacement policy.Please complete Table Q6.2 showing a trace of memory accesses. In the table, each entry contains the {tag, index} contents of that line, or “-”, if no data is present. You should only fill in elements in the table when a value changes. For simplicity, the addresses are only 8 bits.The first 3 lines of the table have been filled in for you. The initial values marked with a …*‟ are the least recently used ways in that set. For your convenience, the address breakdown for access to the main cache is depicted below.。
2015-2016学年第一学期数据库期末考试卷a整理版
广州民航职业技术学院2015/2016学年第一学期14级《数据库原理与应用》期末考试卷(A卷) (闭卷)班级学号姓名成绩注意:选择和判断题的答案请填到答题卡上。
一、单项选择题(每题2分,共15题,30分)1.用于对数据库中数据的物理结构描述的是(C)A.逻辑模式 B.用户模式C.存储模式 D.概念模式2.现要查找缺少学习成绩(G)的学生学号(Sno)和课程号(Cno),相应的SQL语句SELECT Sno,Cno FROM SC WHERE中WHERE后正确的条件表达式是 DA.G=0 B.G<=0 C.G=NULL D.G IS NULL3.下述SQL语句中,起修改表中数据作用的命令动词是 C 。
A. ALTERB. CREATEC. UPDATED. INSERT4.在关系数据库系统中,定义数据结构的数据称作“元数据”,它们也以二维表的形式存储于数据库中,称作__C____。
A、数据文件B、源代码C、数据字典D、源文件5.数据库创建后就可以创建表了,创建表可以用___D___等方法来创建。
A、企业管理器B、查询分析器C、OSQLD、企业管理器和CREATE TABLE语句6.删除一个表,正确的SQL语句是(_C__)。
A、DROP 表名B、Alter Table 表名C、DROP Table 表名D、Alter表名7.表Tabl_1中有一列被表Tabl_2引用作外码。
在数据库中定义这两个表时,正确的安排顺序是(A )。
A、先定义表Tabl_1,然后再定义表Tabl_2B、可以先定义表Tabl_2C、于定义的先后顺序无关系D、以上说法都不对8.假定Sname是字符串类型,下来条件表达式,符合语法要求的是(D )。
A.Sname<>12355 B.Sname=伪劣商品C.Sname≠‘王一平’D.Sname=‘12355’9.下列SQL语句中,能够完成求某列最小值的是( C )。
杭电 2015年数据库期末试卷
设人事部数据库有三个基本表,其中表结构如下:
(涉及多表关联时,请尽量使用 e,d, s 分别作为 from 关键字后 Employees, Department 和 Salary 三
张表的别名)
(Select 后的字段如需使用别名显示,会在题目中标识出来,否则请直接使用字段名)
员工表(Employees)
C.不同的数据只能被对应的应用程序所使用
D.以上三种说法都不对
2、在数据库系统中,模式/外模式映像用于解决数据的( )
A. 结构独立性
B. 物理独立性
C. 逻辑独立性
D. 分布独立性
3、用户或应用程序看到的那部分局部逻辑结构和特征的描述是( )
A. 模式
B. 物理模式
C. 子模式
D. 内模式
4、关系数据模型是目前最重要的一种数据模型,它的三个要素分别是( )
(7)创建存储过程 upEmpInfoByDepName,根据部门名,显示部门的员工信息,包括员工号、员工 名、电话号码。
第2页
共4页
杭州电子科技大学计算机学院期末考试答题卷( A )
考试课程 教师姓名
专业
数据库
考生姓名
14 软件工程
班级
考试日期
学号 成绩
(请大家把答案写在答题纸上)
第3页
共4页
第4页
备注 主键,外键
请使用 SQL 语句完成下面各题,并把答案写在答题纸上。 (1)找出没有提供“通信地址”的员工名。
(2)查询“研发部”员工的收入情况,显示收入、支出这两项。
(3)统计各部门在 1966 年以前出生的雇员的人数(qty)和部门号。
(4)将“销售部”的领导更改为“李强”。
2022年杭州电子科技大学信息管理与信息系统专业《数据库概论》科目期末试卷B(有答案)
2022年杭州电子科技大学信息管理与信息系统专业《数据库概论》科目期末试卷B(有答案)一、填空题1、数据模型是由______________、______________和______________三部分组成。
2、数据仓库是______、______、______、______的数据集合,支持管理的决策过程。
3、SQL语言的数据定义功能包括______、______、______和______。
4、在SQL语言中,为了数据库的安全性,设置了对数据的存取进行控制的语句,对用户授权使用____________语句,收回所授的权限使用____________语句。
5、设有关系模式R(A,B,C)和S(E,A,F),若R.A是R的主码,S.A是S的外码,则S.A的值或者等于R中某个元组的主码值,或者______取空值,这是规则,它是通过______和______约束来实现的。
6、____________和____________一起组成了安全性子系统。
7、数据管理技术经历了______________、______________和______________3个阶段。
8、关系数据库中基于数学的两类运算是______________和______________。
9、采用关系模型的逻辑结构设计的任务是将E-R图转换成一组______,并进行______处理。
10、设某数据库中有作者表(作者号,城市)和出版商表(出版商号,城市),请补全如下查询语句,使该查询语句能查询作者和出版商所在的全部不重复的城市。
SELECT城市FROM作者表_____SELECT城市FROM出版商表;二、判断题11、视图是可以更新的。
()12、数据库模式和实例是一回事。
()13、在综合分E-R图时,会出现属性冲突,结构冲突,命名冲突。
()14、在数据库表中,空值表示数值0。
()15、全码的关系模式一定属于BC范式。
()16、在第一个事务以S锁方式读数据R时,第二个事务可以进行对数据R加S锁并写数据的操作。
杭电《数据库概论》习题答案
《软件技术基础》之数据库概论习题一、选择题1.把一个数据库分布在若干台计算机中,称为()数据库A.网状B.层次分布式 D.集中式2.关系数据库系统中,一个关系相当于()一张二维表 B.一条记录C.一个关系数据库D.一个实体3.在数据库设计中,E—R图(即实体联系图)是为了描述()A实体 B.结构数据模型C.关系D.概念数据模型4.关系数据库是用( C )实现数据间的联系A.表 ps:准确地说是二维表格B.外键C.关系D.指针5.数据库体系三级模式中,模式/内模式的映像使数据库具有()A.数据独立性B.数据逻辑独立性数据物理独立性 D.数据的一致性6.下面()不是数据库系统具有的特征?A.数据共享冗余大C.用数据模型描述数据D.数据独立于程序7.下面()描述了事物的特征,但不涉及信息在计算机中表示。
A实体 B. 概念数据模型C.关系D. 结构数据模型8.关系数据库与网状、层次数据库的主要区别在于()A.关系数据库存在关系B.关系数据库用表格表达数据C.关系数据库应用广泛9.数据管理技术发展过程中,文件系统与数据库系统的重要区别是数据库系统具有( )A .数据可共享 B. 数据无冗余C. 特定的数据模型有专门的数据管理软件10.在下面列出的几种语言中,哪一种是关系数据库的标准语言? ( )A. C++B. FORTRAN 11.假定有学生关系S 、课程关系C 、学生选课关系SC 的ER 图四,在由其产生的关系集合中查找选修"COMPUTER"课程的女学生的姓名,将涉及到关系( )图一A .,C ,SC12.设有关系R,S和T 如下。
关系T 是由关系R 和S 经过哪种操作得到的?( )A. R ∪×S D. R ∞S 13.下列选项中属于实体关系的是?( )A. 关系型B. 结构模型 一对多 D. 以上都不是二、填空题1.数据库系统中,常用的三种数据结构模型为:层次、网状、关系。
杭州电子科技大学学生考试卷07-08(2)(数据库概论B)
A.三级模式之间的两种映射B.模式与内模式
C.模式与外模式D.三层模式
3.SQL语言中,删除一个表的命令是〔〕。
A DELETE B DROP C CLEAR D REMOVE
4.关系代数表达式的优化策略中,首先要做的是( )
A.对文件进行预处理 B.尽早执行选择运算
三、判断改错题〔判断正误,错误的请直接在题目上改正。每题2分,共10分〕
1.可以在根本表上定义视图,也可以在视图上定义视图。〔〕
2.一个关系中任意两列的值都不能相同。〔〕
3.对关系R进行投影运数。〔〕
4.如果一个关系模式R属于BCNF,那么R一定属于3NF。〔〕
5.在SQL的查询语句中,对应关系代数中“选择〞运算的语句是SELECT。〔〕
第1页共3页
四、问答题〔共20分〕
1.什么是数据库的完整性?它与平安性有什么不同?(5分)
2.试述数据库系统的组成。(5分)
3.设有关系模式R〔A,B,C〕,F是R上成立的函数依赖集,F={AC→B,AB→C,B→C},试问R在函数依赖范围内最高能到达第几范式,并简要说明理由。(6分)
4.Dept 表及已有的一些行数据如下所示 (department 为主码 ) ,请问以下插入语句哪些正确的,哪些是错误的,错在哪里?(4分)
DEPARTMENT
NAME
LOCATION
BUDGET
20
Sales
Miami
1700000
10
Marketing
New york
2000000
A.insert into dept values(10,‘research', ‘new york',1500000)
杭电_-_穆海伦_-_软件工程_期末试题2015
2014年--2015年杭电软件工程期末试题回忆(穆海轮的课)一.单选题(10分)二.多选题(20分)三.大题(70分)1. 某高校一个成绩管理系统,记录并管理所有选修课程的学生的平时成绩和考试成绩【问题1】(4分)使用说明中的词语,给出图1-1中的外部实体E1~E4的名称。
【问题2】(3分)使用说明中的词语,给出图1-2中的数据存储D1~D5的名称。
【问题3】(6分)数据流图1-2缺少了三条数据流,根据说明及数据流图1-1提供的信息,分别指出这三条数据流的起点和终点。
【问题4】(3分)简要叙述在本例中运用了哪几条画分层DFD图的指导原则。
【问题5】(4分)数据流图是在系统分析与总体设计阶段宏观地描述系统功能需求的重要图形化工具,程序流程图也是软件开发过程中比较常用的图形化工具。
简要说明数据流图和程序流程图在适用场合与作用上的区别。
【问题1】E1考试委员会,E2主讲教师,E3选课学生,E4教务处【问题2】D1学生信息文件D2课程信息文件D3课程单元信息文件D4课程成绩文件 D5无效成绩文件【问题3】E4教务处—>3记录无效成绩 (具体处理意见) ,2记录无效成绩—> 4生成成绩列表(有效成绩),4生成成绩列表—>5生成最终成绩单(成绩单内容)【问题4】第一层DFD应当是基本系统模型注意父图和子图的平衡,维护信息的连续性区分局部文件和局部外部项遵守加工编号原则【问题5】数据流图是用来交流对系统的认识和分析及设计系统的工具;只是描绘数据在软件中的流动和被处理的逻辑过程。
不需考虑怎样具体实现这些功能。
程序流程图便于直观地展现程序控制流程,不去考虑全局结构;只是用来描绘控制结构。
2 . 下图为某程序模块的N_S图,试画出相应的程序流程图、PAD图和程序图,并计算其环域复杂度。
(15分)PAD图(上图)程序流程图(上图)程序图(上图)环域复杂度为:6+1=73.。
杭电 数据结构 期末复习卷及答案
1. 数据结构可用三元式表示(D,S,P)。
其中:D是数据对象,S是D上的关系集,P是对D的基本操作集。
×3. 队列是数据对象特定的线性表。
×4. 二叉树是一棵结点的度最大为二的树。
×7.一棵无向连通图的生成树是其极大的连通子图。
×8.二叉排序树的查找长度至多为log2n。
×10.对于目前所知的排序方法,快速排序具有最好的平均性能。
√12. 二维数组是其数据元素为线性表的线性表。
√14. 折半查找不适用于有序链表的查找。
√15. 完全二叉树必定是平衡二叉树。
Right 中序二叉树的优点是便于在中序下查找直接前驱结点和直接后继结点。
√18. 平均查找长度与记录的查找概率有关。
√19. 广义表的表头和表尾都有可能是原子或广义表。
×1. 若广义表LS满足GetHead(LS)==GetTail(LS),则LS为( b )。
A. ( )B. (( ))C. (( ),( ))D. (( ),( ),( ))5. 对二叉排序树按(c)可得到有序序列。
a:层次遍历 b:前序遍历 c:中序遍历 d:后序遍历8.关键路径是指在只有一个源点和一个汇点的有向无环网中源点至汇点(c)的路径。
a:弧的数目最多 b:弧的数目最少 c:权值之和最大 d:权值之和最小9. 哈希表的查找效率取决于(d)。
a: 哈希函数 b:处理冲突的方法。
c:哈希表的装填因子d:以上都是10.从逻辑上可以把数据结构分成( c )。
c: 线性结构和非线性结构13.当待排序序列的关键字次序为倒序时,若需为之进行正序排序,下列方案中( d )为佳。
a: 起泡排序 b: 快速排序c: 直接插入排序 d: 简单选择排序14.若从二叉树的根结点到其它任一结点的路径上所经过的结点序列按其关键字递增有序,则该二叉树是( c )。
a: 二叉排序树 b: 赫夫曼树 c: 堆 d: 平衡二叉树15.下图所有可能的拓扑序列有( b )种。
2015年数据结构期末考试题及答案,推荐文档(2021年整理)
2015年数据结构期末考试题及答案,推荐文档(word版可编辑修改) 编辑整理:尊敬的读者朋友们:这里是精品文档编辑中心,本文档内容是由我和我的同事精心编辑整理后发布的,发布之前我们对文中内容进行仔细校对,但是难免会有疏漏的地方,但是任然希望(2015年数据结构期末考试题及答案,推荐文档(word版可编辑修改))的内容能够给您的工作和学习带来便利。
同时也真诚的希望收到您的建议和反馈,这将是我们进步的源泉,前进的动力。
本文可编辑可修改,如果觉得对您有帮助请收藏以便随时查阅,最后祝您生活愉快业绩进步,以下为2015年数据结构期末考试题及答案,推荐文档(word版可编辑修改)的全部内容。
2012年数据结构期末考试题及答案一、选择题1.在数据结构中,从逻辑上可以把数据结构分为 C 。
A.动态结构和静态结构 B.紧凑结构和非紧凑结构C.线性结构和非线性结构 D.内部结构和外部结构2.数据结构在计算机内存中的表示是指 A 。
A.数据的存储结构B.数据结构C.数据的逻辑结构 D.数据元素之间的关系3.在数据结构中,与所使用的计算机无关的是数据的 A 结构。
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 .(1)A.找出数据结构的合理性 B.研究算法中的输入和输出的关系C.分析算法的效率以求改进 C.分析算法的易读性和文档性(2)A.空间复杂度和时间复杂度 B.正确性和简明性C.可读性和文档性 D.数据复杂性和程序复杂性8.下面程序段的时间复杂度是O(n2) 。
