数据库期末综合练习题及答案

2026/1/26 19:05:18

) 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、决定因素


数据库期末综合练习题及答案.doc 将本文的Word文档下载到电脑
搜索更多关于: 数据库期末综合练习题及答案 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219