2010数据库报告.doc_第1页
2010数据库报告.doc_第2页
2010数据库报告.doc_第3页
2010数据库报告.doc_第4页
2010数据库报告.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

南京理工大学数据库系统上机报告课 程:数据库系统 系 别:计算机科学与计算机学院组 员:* 日期: 2010 年 06月 27日 一、数据库设计1.1 需求分析网络教学综合平台的基本情况:1)教师的基本信息每个教师设置唯一的教师号,对应其姓名、用户名、密码、职称、课程、Email、院系等。2)学生的基本信息每个学生根据入学年份及班级设置唯一的学号,对应其用户名、密码、院系,专业,姓名,性别,电话,课程,Email等信息。3)课程的基本信息每个课程设置唯一的课程号、课程名,开课院系,课程教师等信息。4)作业的基本信息每份作业有所属作业模板,课程,标题,截止时间,分数和发布人等信息。5)作业模板的基本信息每个作业模板包括标题,内容,参考答案等附:组员讨论记录时间:2010.5.19 地点:A108记录人员:参会人员:讨论内容:我们讨论了网络教学综合平台的成员组成以及各成员的属性。具体分工:*简明扼要的提出了该平台所需的成员以及各自的属性信息,列出草稿;*对上述草稿进行了修改和补充;*最后综合大家的意见进行了总结并打出了电子稿。stdidnamesexphoneemailCoursesTeachersdepidteaidteanameteadegreeemaildepidExercisemodeltitleSubNoExercisetitletimefull markmarkstudyteachcounamecouidhasdeclaremodelidcontentanswer1.2 ER图Students附:组员讨论记录时间:2010.5. 31 地点:机房记录人员:参会人员:讨论内容:讨论了网络教学平台各实体集,实体集的属性及实体集间的连接。具体分工:*负责找网络教学系统中的各实体集*负责各实体集的属性并画图*负责各实体集间的关系1.3 关系设计表1:Students表属性名数据类型是否主键是否允许为空缺省值说明stuidChar(10)YesNOT NULL学生学号nameChar(10)NoNOT NULL学生姓名sexBooleanNoNOT NULL学生性别phoneChar(20)NoNULL学生电话emailChar(20)NoNULL学生emaildepidChar(10)NoNOT NULL所属学院编号codeChar(10)NoNOT NULL登陆密码mobileChar(20)NoNULL手机表2:Teachers表属性名数据类型是否主键是否允许为空缺省值说明teaidChar(10)YesNOT NULL教师号depidChar(10)NoNOT NULL所属学院编号teanameChar(10)NoNOT NULL教师姓名teadegreeChar(10)NoNOT NULL教师职称emailChar(20)NoNULL教师emailcodeChar(10)NoNOT NULL登录密码表3:study表属性名数据类型是否主键是否允许为空缺省值说明stuidChar(10)YesNOT NULL学生学号couidChar(10)YesNOT NULL课程编号表4:teach表属性名数据类型是否主键是否允许为空缺省值说明teaidChar(10)YesNOT NULL教师号couidChar(10)YesNOT NULL课程编号表5:Courses表属性名数据类型是否主键是否允许为空缺省值说明couidChar(10)YesNOT NULL课程编号counameChar(10)NoNOT NULL课程名称depidChar(10)NoNOT NULL开课院系teaidChar(10)NoNOT NULL开课老师表6:Exercise表属性名数据类型是否主键是否允许为空缺省值说明titleChar(10)YesNOT NULL作业标题timedateNoNOT NULL截止时间fullmarkIntegerNoNOT NULL满分分额couidChar(10)NoNOT NULL课程编号markIntegerNoNOT NULL得分modelidChar(10)NoNOT NULL模型编号contentChar(100)NoNOT NULL作业内容sub No.Boolean NoNOT NULL是否多次提交表7:Exercisemodel表属性名数据类型是否主键是否允许为空缺省值说明modelidChar(10)YesNOT NULL模板编号titleChar(10)NoNOT NULL模板标题answerChar(100)NoNOT NULL作业答案1) stuid-name,sex,phone,email,depidStudents满足4NF。2) teaid-depid,teaname,teadegree,emailTeachers 满足4NF。3) stuid,couid-stuid,couidStudy 满足4NF。4) teaid-couidTeach 满足4NF。5) couid-counameCourses 满足4NF。6) couid,title-time,fullmark,mark,keys,content,modelidExercise 满足4NF。7) modelid-title,keysExercise model 满足4NF。附:组员讨论记录时间:2010.6.7 地点:机房记录人员:参会人员:讨论内容:讨论了网络教学平台中的关系,和各关系满足的函数依赖,满足的最高范式具体分工:*负责各关系表格的填写二、数据库编程2.1 表的创建Create database wljxCreate table Students(stuid char(10) primary key not null,name char(10) not null,sex boolean not null,phone char(20) null,email char(20) null,depid char(20) not null, code char(10) not null,mobil char(20) null) Create table Teachers(teaid char(10) primary key not null,depid char(10) not null,teaname char(10) not null,teadegree char(10) not null,email char(20) null,code char(10) not null) Create table Courses(couid char(10) primary key not null,couname char(10) not null,depid char(10) not null,teaid char(10) not null)Create table Exercise (title char(10) primary key not null,time date not null,fullmark int not null,couid char(10) not null,mark int not null,modelid char(10) not null,content char(100) not null,SubNo Boolean not null )Create table Exercisemodel(modelid char(10) primary key not null,title char(10) not null,answer char(100) not null)Create table study(stuid char(10) not null,couid char(10) not null,Primary key(stuid,couid)Create table teach (teaid char(10) not null,couid char(10) not null,Primary key(teaid,couid)2.2 数据的修改学生信息的添加Insert into Students values(0806580,zhangsan,0,12345,123,06,122,16345)Insert into Students values(0806581,lisi,0,12346,124,06,123,16346)Insert into Students values(0806582,wanger,0,12347,125,06,124,16347)Insert into Students values(0806583,qianwu,1,12348,126,06,126,16348)学生信息的删除、修改Delete from Students where stuid0806580Update Students set mobil=09876 where stuid=0806582教师信息的添加Insert into Teachers values( T000,06,dingyi,jiangshi,567,111)Insert into Teachers values( T001,06,xuyi,jiangshi,568,222)Insert into Teachers values( T002,06,wengyi,jiaoshou,569,334)教师信息的删除、修改Delete from Teachers where teaidT000Update Teachers set teadegree=jiaoshou where teaid=T001课程信息的添加Insert into Courses values(001,shujujiegou,06,T000)Insert into Courses values(002,shujuku,06,T001)Insert into Courses values(003,lisanshuxue,06,T003)课程信息的删除、修改Delete from Courses where couid000Update Courses set teaid=T002 where couid=003具体课程中选课学生的添加、删除Insert into study values(0806580,001)Insert into study values(0806581,002)Insert into study values(0806582,003)Insert into study values(0806583,002)具体课程中老师教的课程添加Insert into teach values(T000,001)Insert into teach values(T001,002)Insert into teach values(T002,003)添加一个作业模板Insert into Exercisemodel values(01,jjjj,fffee)修改和删除作业模板Delete from Exercisemodel where modelid00Update Exercisemodel set answer=ffff where modelid=01添加一个作业Insert into Exercise values(001,2010-6-20,5,001,4,01,sss,1)Insert into Exercise values(002,2010-6-21,5,002,4,01,sddd,1)修改和删除作业Delete from Exercise where title000Update Exercise set SubNo=1教师修改密码Update Teachers set code=333 where teaid=T002教师个人信息的修改Update Teachers set teadegree=jiaoshou where teaid=T001学生修改密码Update Students set code=125 where stuid=0806583学生个人信息的修改Update Students set mobil=09876 where stuid=08065822.3 查询按学院查询课程信息按学生查询所选课程信息按学生查询有待提交作业的课程信息按学生和课程查询课程作业信息按作业查看作业结果信息按教师查询所教授课程信息按教师查询未批阅作业信息按课程查看作

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论