发布时间 : 星期二 文章数据库期末综合练习题及答案更新完毕开始阅读9e7de1056c85ec3a87c2c550
) as begin
delete from score
where 学号=@a and 课程名=@b end
8.declare @a char(8),@b varchar(10),@c numeric(5,2) declare xxx cursor
for select 学号,课程名,成绩 from score open xxx
fetch xxx into @a,@b,@c while @@fetch_status=0 begin
print @a+replicate(' ',3)+@b+str(@c)+replicate(' ',3)+(case when @c>=90 then '优秀' when @c>=70 then '良好' when @c>=60 then '及格' else '不及格' end )
fetch from xxx into @a,@b,@c
end close xxx deallocate xxx
9.declare @a char(8),@b varchar(10) declare @c numeric(5,2) declare @d int set @d=80 declare xxx cursor
for select 学号,课程名,成绩 from score open xxx
fetch xxx into @a,@b,@c while @@fetch_status=0 begin
if(@c>=@d) print @a+replicate(' ',3)+@b+str(@c,5) fetch from xxx into @a,@b,@c end close xxx deallocate xxx
10.declare @a char(8),@b varchar(10) declare @s char(8),@r varchar(10)
set @s='20030001' set @r='数学' declare xxx cursor
for select 学号,课程名 from score open xxx
fetch xxx into @a,@b while @@fetch_status=0 begin
if(@a=@s and @b=@r) begin
delete from score where current of xxx break end
fetch from xxx into @a,@b end close xxx deallocate xxx
五、期末综合练习题参考答案
第一章 填空题
1. 分开 2. 文件系统、数据库系统
3. 记录、数据项 4. 局部、全局 5. 二元、一元 6. 多、多 7. 多、多 8. 型、值
9. 树、二维表格 10. 关系定义、DBMS 11. 状态、行为
12. 数据库管理员、数据库设计员、应用程序员、终端用户 13. 中间、最上、最下 14. 建立、维护 15. 定义、查询、更新、控制 第二章 填空题
1. 24、3 2. 超码、候选码、主码、备用码 3. 班级号、外码 4. R1、R2
5. 完整性、数据库 6. 选择、投影、连接、除 7. 2、1 8. C、X、S 9. ?
(X)、S
学生号
第三章 填空题
1. X←→Y、决定因素 2. 完全、部分 3. 学号、系主任 4. X→Y、X→Z、分解性 5. (A,D)、2 6. (A,D)、伪传递 7. 第一、不可再分 8. (A,D)、部分 9. 第一、3 10. 第二、3 11. 第三 12. BC、决定因素