




已阅读5页,还剩19页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
数据库原理与应用数据库原理与应用 课程设计课程设计 试题库及在线考试系统数据库设计试题库及在线考试系统数据库设计 2010 2011 学年第一学期第学年第一学期第 17 周 周 2010 年 12 月 1 目录目录 1 概概述述 1 1 1 项目背景项目背景 1 1 2 系统说明系统说明 1 2 需求分析需求分析 1 2 1 需求分析需求分析 1 2 2 数据需求数据需求 1 2 3 事物需求事物需求 2 2 4 数据字典数据字典 2 3 方案图表设计方案图表设计 3 3 1 关系模式关系模式 3 3 2 E R 图图 3 3 2 1 课程信息实体E R图 3 3 2 2 考生信息实体E R图 4 3 2 3 试题信息实体E R图 4 3 2 4 记录信息实体E R图 5 3 2 4 信息实体E R总图 5 3 3数据流程图 6 3 4 关系图关系图 7 4 数据数据库库源源代码代码 7 4 1 数据库创建数据库创建 7 4 1 1 创建数据库 7 4 1 2 课程信息表建立 7 4 1 3 创建试题库表 8 4 1 4 考生表建立 8 4 1 5 考试记录表建立 8 4 2 数据初始化 9 4 2 2 将课程类别加入表course表中 9 4 2 2 将已有的试题加入system examination表中 9 4 2 3 将考生信息加入system examinee表中 10 4 2 4 添加已完成考试的记录 11 5 结果数据处理结果数据处理 12 5 1 单表查询单表查询 12 5 1 1 表course中查询 12 5 1 2 表system examination中查询 13 5 1 3 将考生信息加入system examinee表中结果查询 13 5 1 4 考试纪录表examination record结果查询 14 5 2 待补考处理待补考处理 14 5 2 1 待补考查询 14 5 3 考考试试操作操作 15 2 5 3 1 查询还未完成的考试试题 15 5 3 2 查询已完成的考试试题 16 5 4 考生操作考生操作 16 5 4 1 申请考生考号 16 5 4 2 注销考生考号 17 5 5 试题查试题查询询 17 5 51 查询所有试题所对应的类别 17 5 5 2 查询所有计算机网络的考试 18 5 6 考生状态考生状态 18 5 6 1 查询什么人考了什么试 18 5 6 2 查询蒋伟考了什么试 19 6 结束语结束语 20 7 参考文献参考文献 20 1 1 1 概述概述 1 1 项目背景项目背景 随着绿色生活 绿色工作概念的提出 无纸化办公已经逐渐成为各个企事业单位的需求 特别是对于学校进行教学的一个必然趋势 然而 在线考试系统是学校无纸化办公的一个重要 途径 此外 试题库系统更是能最大程度上收集与整理学校的教学资源 方便老师 学生的教 学工作 提高学校工作的效率 因此 必须制定一套合理 有效 规范和实用的试题库及在线 考试管理系统 对试题资料进行集中统一的管理 另一方面 IT 产业和 Internet 获得了飞速发展 计算机应用已渗透到了各个领域 引起信 息管理的革命 实现了信息的自动化处理 提高了处理的及时性和正确性 提高学校试题库管理工作效率 做到信息的规范管理 科学统计和快速查询 让学生和老 师都能感受到在线考试系统带来的便利 1 2 系统说明系统说明 该试题与在线考试系统主要能实现学生在线考试与浏览试题库的功能 系统能对考生的考 试情况实现一定的查询 添加与删除功能 对试题库进行查询 添加 删除操作 在线考试系 统对考生的考试情况进行评分与记录操作 2 2 需求分析需求分析 2 1 需求分析需求分析 2 2 数据需求数据需求 图书馆管理信息系统需要完成功能主要有 1 考生基本信息的输入 包括学号 姓名 年级 专业 所学课程 2 考生基本信息的查询 修改 包括学号 姓名 年级 专业 所学课程等 3 课程信息的输入 包括课程编号 课程名称 4 课程信息的查询 修改 包括课程编号 课程名称 5 试题库信息的输入 包括试题编号 试题所属课程 试题章节 上传日期 6 试题库信息的查询 修改 包括试题编号 试题所属课程 试题章节 上传日期等 2 7 已完成考试的信息输入 包括学号 试题编号 考试完成日期 考试成绩 8 已完成考试的信息查询 修改 包括学号 试题编号 考试完成日期 考试成绩 9 待完成的考试输入 包括学号 试题编号 考试完成期限等 10 待完成的考试查询 删除 包括学号 试题编号 考试完成期限等 2 3 事物需求事物需求 1 在考生信息管理部分 要求 a 可以查询考生信息 b 可以对考生信息进行添加及删除的操作 2 在试题信息管理部分 要求 a 可以浏览试题信息 要求 b 可以对试题信息进行维护 包括添加及删除的操作 3 在考试信息管理部分 要求 a 可以浏览考试信息 b 可以对借阅考试进行维护操作 4 在管理者信息管理部分 要求 a 显示当前数据库中管理者情况 b 对管理者信息维护操作 2 4 数据字典数据字典 表 2 1 course 课程信息表 表中列名表中列名数据类型数据类型可否为空可否为空说明说明 coursenovarcharnot null 主键主键 课程编号课程编号 coursenvarcharnot null课程名称课程名称 表 2 2 system examinee 考生信息表格 表中列名表中列名数据类型数据类型可否为空可否为空说明说明 examineeidvarcharnot null 主键主键 考生学号考生学号 examineenamenvarcharnot null考生姓名考生姓名 examineegradeintnot null考生年级考生年级 examineesubjectnvarcharnot null考生专业考生专业 examineecoursenvarcharnull所学课程所学课程 表 2 3 system examination 试题信息表 表中列名表中列名数据类型数据类型可否为空可否为空说明说明 examinationidvarcharNot null 主键主键 试题编号试题编号 coursenonvarcharNot null所属课程所属课程 examinationchapternvarcharNot null试题章节试题章节 3 examinationdatedatetimenull上传日期上传日期 endlinedatetimenull完成期限完成期限 isdonevarcharnull是否完成是否完成 表 2 4 examination record 考试记录信息表 表中列名表中列名数据类型数据类型可否为空可否为空说明说明 examineeidvarcharNot null 外主键外主键 考生学号考生学号 examinationidvarcharNot null 外主键外主键 试题编号试题编号 recorddatedatetimeNot null考试时间考试时间 recordgoalvarcharNot null考试成绩考试成绩 3 3 方案图表设计方案图表设计 3 1 关系模式关系模式 一 课程信息 课程编号 课程名称 二 考生 考生学号 考生姓名 考生年级 考生专业 所学课程 三 试题 试题编号 所属课程 试题章节 上传日期 完成期限 四 考试记录 考生学号 试题编号 考试时间 考试成绩 以上通过关系代数方法的进行运算得到所需要的结果 在实验结果中可以看到 3 2 E R 图图 根据 1 所要实现的功能设计 可能建立它们之间的关系 进而实现逻辑结构功能 试题库及在线考试系统可以划分的实体有 课程信息实体 考生信息实体 试题信息实体 考 试记录信息实体 用 E R 图一一描述这些实体 3 2 1 课程信息实体课程信息实体 E R 图 图 课程信息实体课程信息实体 课程编号课程编号课程名称课程名称 4 图 3 1 课程信息实体 E R 图 3 2 2 考生信息实体考生信息实体 E R 图 图 考生信息实体考生信息实体 考生学号考生学号 考生姓名考生姓名 考生年考生年 级级 考生专业考生专业 所学课程所学课程 图 3 2 考生信息实体 E R 图 3 2 3 试题信息实体试题信息实体 E R 图 图 试题实体试题实体 试题编号试题编号 所属课程所属课程 试题章节试题章节 上传日期上传日期 完成期限完成期限 是否完成是否完成 图 3 3 试题信息实体 E R 图 5 3 2 4 记录信息实体记录信息实体 E R 图 图 考生学号考生学号 试题编号试题编号 考试时间考试时间 隔隔 考试记录信息实体实体考试记录信息实体实体 考试成绩考试成绩 隔隔 图 3 4 考试记录信息实体 E R 图 3 2 5 信息实体信息实体 E R 总图 总图 信息登记信息登记 考生实体考生实体 试题实体试题实体 课程信息实体课程信息实体 考试考试 待考待考 待考信息实体待考信息实体 考试记录信息实体考试记录信息实体 实体实体 图 3 5 总的信息实体 E R 图 3 3 数据流程图数据流程图 6 D5 待考信息录入待考信息录入 基本信息录入基本信息录入 D2 D1 基本信息录入基本信息录入 基本信息录入基本信息录入 D3 D4 考试信息录入考试信息录入 考生信息返回考生信息返回 试题信息返回试题信息返回 图 3 6 系统的数据流程图 课程信息设置课程信息设置 考生登记考生登记 课程信息管理课程信息管理 试题登记试题登记 读者信息管理读者信息管理试题信息管理试题信息管理 考试信息管理考试信息管理 7 3 4 关系图 关系图 图 3 7 数据库存表关系图 4 4 数据库源代码数据库源代码 4 1 数据库建立数据库建立 4 1 1 创建数据库创建数据库 CREATE DATABASE examinationsystem GO USE examinationsystem go 4 1 2 课程信息表建立课程信息表建立 create table course courseno varchar 30 primary key course nvarchar 30 8 go 4 1 3 创建试题库表创建试题库表 create table system examination examinationid varchar 20 primary key courseno 30 Not null examinationchapter nvarchar 30 Not null examinationdate datetime endline datetime isdone varchar 10 foreign key courseno references course courseno go 4 1 4 考生表建立考生表建立 create table system examinee examineeid varchar 20 primary key examineename nvarchar 9 not null examineegrade int not null examineesubject nvarchar 10 not null courseno varchar 30 Not null foreign key courseno references course courseno go 4 1 5 考试记录表建立考试记录表建立 create table examination record examinationid varchar 20 primary key examineeid varchar 9 recorddate datetime recordgoal int foreign key examineeid references system examinee examineeid foreign key examinationid references system examination examinationid go 9 4 2 数据初始化数据初始化 4 2 1 将课程类别加入表将课程类别加入表 course 中中 insert into course courseno course values 1 数据库技术 insert into course courseno course values 2 面向对象编程 insert into course courseno course values 3 计算机网络 insert into course courseno course values 4 网页制作 insert into course courseno course values 5 信息分析与预测 insert into course courseno course values 6 信息经济学 insert into course courseno course values 7 管理信息系统 go 4 2 2 将已有的试题加入将已有的试题加入 system examination 表中表中 insert into system examination examinationid courseno examinationchapter examinationdate endline isdone values 0010101 1 第一章第一节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0010102 1 第一章第二节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0020203 2 第二章第三节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0020301 2 第三章第一节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0030103 3 第一章第三节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno 10 examinationchapter examinationdate endline values 0030303 3 第三章第三节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0040202 4 第二章第二节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0050305 5 第三章第五节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0050702 5 第七章第二节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0060402 6 第四章第二节 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0060000 6 综合考试 2010 10 01 2010 12 31 1 insert into system examination examinationid courseno examinationchapter examinationdate endline values 0070000 7 期末测试 2010 10 01 2010 12 31 1 go 4 2 3 将考生信息加入将考生信息加入 system examinee 表中表中 insert into system examinee examineeid examineename examineegrade examineesubject c ourseno values B08650207 陈远鹏 2008 信息管理 6 insert into system examinee examineeid examineename examineegrade examineesubject c ourseno 11 values B08650131 陈特 2008 信息管理 6 insert into system examinee examineeid examineename examineegrade examineesubject c ourseno values B08310101 赵铭静 2008 软件设计 5 insert into system examinee examineeid examineename examineegrade examineesubject c ourseno values B07650231 潘虹 2007 信息管理 3 insert into system examinee examineeid examineename examineegrade examineesubject c ourseno values B08530301 蒋伟 2008 网络工程 1 insert into system examinee examineeid examineename examineegrade examineesubject c ourseno values B07310132 李叶风 2007 软件设计 1 go 4 2 4 添加已完成考试的记录添加已完成考试的记录 添加已完成考试的记录 同时将在完成的考试标记置 1 insert into examination record examineeid examinationid recorddate recordgoal values B08310101 0010102 2010 10 27 11 24 54 96 update system examination set isdone 1 where examinationid 0010102 insert into examination record examineeid examinationid recorddate recordgoal values B08530301 0050305 2007 12 27 08 26 51 86 update system examination set isdone 1 where examinationid 0050305 insert into examination record examineeid examinationid recorddate recordgoal values B08650207 0030103 2007 12 27 08 26 51 56 update system examination set isdone 1 where examinationid 0030103 insert into examination record 12 examineeid examinationid recorddate recordgoal values B08310101 0050702 2007 10 21 12 11 51 73 update system examination set isdone 1 where examinationid 0050702 insert into examination record examineeid examinationid recorddate recordgoal values B08650207 0030103 2007 12 28 14 11 51 88 update system examination set isdone 1 where examinationid 0030103 insert into examination record examineeid examinationid recorddate recordgoal values B07310132 0040202 2007 08 28 15 11 31 45 update system examination set isdone 1 where examinationid 0040202 go 5 5 结果数据处理结果数据处理 5 1 单表查询单表查询 5 1 1 表表 course 中查询中查询 13 图 5 1 表 course 中内容 5 1 2 表表 system examination 中查询中查询 图 5 2 表 system examination 中内容 5 1 3 将考生信息加入将考生信息加入 system examinee 表中结果查询 表中结果查询 图 5 3 表 system examinee 中内容 14 5 1 4 考试纪录表考试纪录表 examination record 结果查询结果查询 图 5 4 表 examination record 中内容 5 2 待补考处理待补考处理 5 2 1 待补考查询待补考查询 现在对考生查询是否有不及格的考试 select system examinee examineeid 考生学号 system examinee examineename 考生姓名 system examination examinationid 试题编号 system examination examinationchapter 试题章节 examination record recordgoal 考试成绩 from examination record system examinee system examination where system examinee examineeid examination record examineeid and system examination examinationid examination record examinationid and examination record recordgoal 60 go 15 图 5 5 选出有不及格考试的考生 5 3 考试操作考试操作 5 3 1 查询查询还未完成的考试试题还未完成的考试试题 select examinationid 试题编号 examinationchapter 试题章节 from system examination where isdone 1 go 图 5 6 16 5 3 2 查询已查询已完成的考试试题完成的考试试题 select examinationid 试题编号 examinationchapter 试题章节 from system examination where isdone 0 go 图 5 7 5 4 考生操作 5 4 1 申请申请考生考号考生考号 申请考生考号 与学号一致 Insert into system examinee examineeid examineename examineegrade examineesubject c ourseno values B09310103 小华 2009 电子工程 7 查询 select from system examinee where examineeid B09310103 go 17 图 5 8 说明 查询相应的纪录增加了小华这样一个考生的纪录 5 4 2 注销注销考生考号考生考号 注销考生考号 说明 1 在注销之前执行所有的考试过程 就是上面写到的所述SQL语句 然后执行 delete from system examinee where examineeid B09310103 2 小华考生纪录就被删除了 同时要删除和小华考试纪录的内容 delete from examination record where examineeid B09310103 5 5 试题查询试题查询 5 5 1 查询所有试题所对应的类别查询所有试题所对应的类别 查询所有试题所对应的类别 查询所有试题所对应的类别 select distinct examinationid 试题编号 course 课程类别 from course system examination where course courseno system examination courseno 18 图 5 9 5 5 2 查询所有计算机网络的考试 查询所有计算机网络的考试 select distinct examinationid 试题编号 course 课程类别 from course system examination where course courseno system examination courseno and course courseno 3 图 5 10 5 6 考生状态考生状态 5 6 1 查
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 蒸汽杀菌锅知识培训要点
- 2025年社区卫生服务知识考试题库(附答案)
- 2025年普通处方权考试题及答案
- 2025诊所租赁合同范本参考
- 叉车实操考试全套试题及答案
- 2025年高考化学试题分类汇编:有机化学基础(含解析)
- 2025全面授权合同协议书汇编
- 物业安全生产试题及答案
- 2025年4月护理理论知识考试模拟题(含参考答案)
- 2025年北京市旅游合同范本(BF)
- 10kA配电站房标准建设规范及施工工艺
- 床边护理查体内容
- 公司价值观与伦理管理制度
- 2024-2025学年初中音乐七年级上册(2024)苏少版(2024)教学设计合集
- DB61∕T 1856-2024 国土调查成本定额
- 2024年中国EPP包装制品市场调查研究报告
- 初中道德与法治教研组工作计划
- 地基沉降量计算-地基沉降自动计算表格
- 部编版(2024版)七年级历史上册第1课《远古时期的人类活动》精美课件
- 2024年云南省昆明市官渡区、呈贡区小学六年级第二学期小升初数学试卷含解析
- 《立在地球边上放号》《峨日朵雪峰》联读课件32张高中语文必修上册
评论
0/150
提交评论