学生档案管理系统数据库设计书.docx
《学生档案管理系统数据库设计书.docx》由会员分享,可在线阅读,更多相关《学生档案管理系统数据库设计书.docx(20页珍藏版)》请在冰点文库上搜索。
![学生档案管理系统数据库设计书.docx](https://file1.bingdoc.com/fileroot1/2023-6/9/16cf5135-d038-4cd7-bdb3-6a53c67d1c01/16cf5135-d038-4cd7-bdb3-6a53c67d1c011.gif)
学生档案管理系统数据库设计书
学生档案管理系统数据库设计书
1.1课程设计目的
编写的这个再就业服务中心管理信息系统,第一是为了学以致用,将学到的知识运用到
实际中去,第二也是为了学到更多的东西,加深自己对C#和SQL的理解。
1.2开发背景
随着我国市场经济的快速发展和信息化水平的不断提高和网络运用的不断普及,如何利
用先进的管理手段,提高高校管理的水平,是当今社会所面临的一个课题。
各种各样的网上管理系统应运而生。
1.3需求分析
1.4开发环境
VisualStudio是微软公司推出的开发环境。
是目前最流行的Windows平台应用程序开发环境。
VisualStudio可以用来创建Windows平台下的Windows应用程序和网络应用程序,也可以用来创建网络服务、智能设备应用程序和Office插件。
2.1系统功能描述学生档案管理系统包括用户管理模块、档案管理模块、成绩管理模块,奖惩管理模块、基本信息管理模块、帮助模块。
用户管理模块:
对系统用户进行管理,包括添加新用户,对已有用户的查询修改,用户密码采用md5加密方法进行加密,以提高用户帐号的安全性。
档案管理模块:
对学生的档案信息进行管理,包括档案的录入,档案的查询,档案的修改,方便管理者进行管理,无需传统的手填表式管理,降低了出错的可能性。
成绩管理模块:
对学生的成绩进行管理,包括成绩的录入,成绩的修改,成绩的查询,方便管理人员适时的对学生的成绩进行操作,同时也方便了管理人员对学生成绩的了解。
奖惩管理模块:
对学生的奖惩信息进行记录,修改,查询,让每个人的信息可以及时的体现在档案上,方便以后的查询。
基本信息管理模块:
对学生的一些基本信息进行管理,及时的修改学生的基本信息,可做到及时性,准确性。
帮助模块:
对学生档案管理系统进行介绍,对一些基本信息和使用方法向用户做初步的介绍,方便用户的使用和减少用户摸索的时间,提高用户的工作效率。
2.2功能模块图
2.3关系模式图
3.1E-R图
3.2关系图
班级表一Class
ClassID
char(8)
不允许空
主键
className
char(20)
不允许空
DeptID
char(8)
允许空
学院表--College
CollegeID
char(8)
不允许空
主键
CollegeName
char(20)
不允许空
CollegeSummary
nchar(10)
允许空
课程表一Course
Cno
char(10)
不允许空
主键
Cname
char(10)
不允许空
keshi
int
不允许空
xuefen
int
不允许空
ksxs
char(8)
不允许空
院系表--Dept
DeptID
char(8)
不允许空
主键
DeptName
char(30)
不允许空
CollegeID
char(8)
允许空
获奖表--HuoJiang
pW
*
char(100)
datetime
a6eiu!
char(100)
char(100)
datetime
char(8)
char(20
char(8)
char
(2)
char(8)
char(8)
char(20
char(4)
char(20
o
s
(f)
Adiux-g
E°ls
S|
0)
605
1s
N
E1s
6
CD
O|S
RoomID
ClassID
■C£s
IS
S」mage
0)'
o
Is
s
IS
§s
茎①pms——*刖*
州
*
o
s
ouO
OS——*5
char(8)
char(20
RoomID
RoomAdd
RoomNum
Eoo^—*湮甲
char(8)
RewardID
RewardName
RewardLevel
char(8)
PunishlD
PunishName
p」eM①耳—<8
uscnd——*!
?
威
datetime
char(8)
o
s
RewardID
0)
E
S」tzz
char(100)
不允许空
S_jtlxdh
char(15)
允许空
S_sj
char(11)
允许空
用户表--Users
Uid
int
不允许空
主键
Uname
char(20)
不允许空
PassWord
char(20)
不允许空
违纪表--WeiJi
Sno
char(10)
不允许空
主键
PunishID
char(8)
不允许空
主键
Time
datetime
不允许空
chulijieguo
text
允许空
3.3创建表、视图、索引脚本
一、数据库创建:
CREATEDATABASStudentRecordDB
ON
(NAM=StudentRecordDB_data,FILENAME='f:
\studentrecorddb\StudentRecordDB_data.mdf')
LOGON
(NAM=StudentRecordDB_log,FILENAME='f:
\studentrecorddb\StudentRecordDB_log.ldf')
GO
2、班级表:
CREATETABLEClass(
ClassIDCHAR8)NOTNULL,
ClassNameCHAR20)NOTNULL,
DeptIDCHAR8)NULL,)
3、院系表
CREATETABLECollege(
CollegeIDCHAR8)NOTNULL,
CollegeNameCHAR20)NOTNULL,
CollegeSummaryCHAR10)NULL,)
4、课程表
CREATETABLECourse(
CnoCHAR10)NOTNULL,
CnameCHAR10)NOTNULL,
keshiintNOTNULL,
xuefenintNOTNULL,
ksxschar(8)NOTNULL)
5、系表:
CREATETABLEDept(
DeptIDCHAR(8)NOTNULL,DeptNameCHAR(30)NOTNULL,CollegeIDCHAR(8)NULL)
6、获奖表:
CREATETABLEHuoJiang(SnoCHAR(10)NOTNULL,RewardIDCHAR(8)NOTNULL,TimedatetimeNULL)
7、处罚表:
CREATETABLEPunish(
PunishIDchar(8)NOTNULL,PunishNamechar(10)NULL)
8、奖励表:
CREATETABLEReward(
RewardIDchar(8)NOTNULL,RewardNamechar(10)NOTNULL,RewardLevelchar(10)NOTNULL)
9、宿舍表:
CREATETABLERoom(
RoomIDchar(8)NOTNULL,RoomAddchar(20)NOTNULL,RoomNumintNOTNULL)
10、选课表:
CREATETABLESC(
Snochar(10)NOTNULL,Cnochar(10)NOTNULL,ScoreintNULL)
11、学生表:
CREATETABLEStudent(
Snochar(10)NOTNULL,S_namechar(8)NOTNULL,S_xmpychar(20)NOTNULL,S_cymchar(8)NULL,S_sexchar
(2)NOTNULL,S_ageintNOTNULL,S_mzchar(10)NOTNULL,S_jgchar(100)NOTNULL,S_csrqdatetimeNOTNULL,RommIDintNULL,ClassIDintNULL,S_sfzhchar(15)NOTNULL,
S_imageimageNULL,S_zzmmchar(4)NOTNULL,S_csdchar(100)NULL,S_sydchar(100)NOTNULL,S_rxnfdatetimeNOTNULL,S_byxxchar(20)NOTNULL,S_pyccchar(10)NOTNULL,S_jtzzchar(100)NOTNULL,S_jtlxdhchar(15)NULL,S_sjchar(11)NULL)
12、用户表:
CREATETABLEUsers(UidintNOTNULL,Unamechar(20)NOTNULL,PassWordchar(20)NOTNULL)
13、违纪记录表:
CREATETABLEWeiJi(Snochar(10)NOTNULL,PunishIDchar(8)NOTNULL,TimedatetimeNOTNULL,chulijieguotextNULL)GO
二、视图--查询成绩USEStudentRecordDBGOCREATEVIEWSCORE_VIEW
ASSELECTStudent.Sno,S_name,Cname,ScoreFROMStudent,Course,SC
WHEREStudent.Sno=sc.SnoANDSC.Cno=Course.Cno
GO
--查询基本信息USEStudentRecordDB
GOCREATEVIEWjbxx_VIEW
ASSELECTStudent.Sno,S_name,S_sex,S_age,S_jg,S_zzmm,S_rxnf,S_jtzz,S_sj,Class.ClassID,Dept.DeptID,Room.RoomID
FROMStudent,Class,Dept,Room
WHEREStudent.ClassID=Class.ClassIDANDClass.DeptID=Dept.DeptIDANDStudent.RoomID=Room.RoomID
GO
--查询获奖情况USEStudentRecordDB
GO
CREATEVIEWHJ_VIEW
ASSELECTStudent.Sno,S_name,RewardName
FROMStudent,HuoJiang,Reward
WHEREStudent.Sno=HuoJiang.SnoANDHuoJiang.RewardID=Reward.RewardIDGO
--查询违纪情况USEStudentRecordDB
GOCREATEVIEWCF_VIEW
ASSELECTStudent.Sno,S_name,PunishName,chulijieguo
FROMStudent,WeiJi,Punish
WHEREStudent.Sno=WeiJi.SnoANDWeiJi.PunishID=Punish.PunishIDGO
--通过姓名和课程名查询该生该课程成绩
IFEXISTS(SELECTNAMEFROMsysobjectsWHERENAME='Pro_S_name'ANDTYPE='p')DROPPROCEDURPEro_S_name
GO
createprocedurePro_QScore
@S_name_inchar(8),@Cname_inchar(10),@Score_outintoutput
Asselect@Score_out=Scorefromstudent,course,scwherestudent.Sno=sc.Snoandcourse.Cno=sc.CnoandS_name=@S_name_inandCname=@Cname_in
三、索引
--创建索引
useStudentRecordDB
go
create
index
ind_ClassID
onClass(ClassID)
create
index
ind_Cnoon
Course(Cno)
create
index
ind_DeptID
onDept(DeptID)
create
index
ind_huojiang
onHuoJiang(Sno,RewardID)
create
index
ind_PunishID
onPunish(PunishID)
create
index
ind_RewardID
onReward(RewardID)
create
index
ind_RoomID
onRoom(RoomID)
createindexind_sconSC(Sno,Cno)
create
index
ind_Sno
onStudent
(Sno)
create
index
ind_Uid
onUsers(Uid)
create
index
ind_weiji
onWeiJi
(Sno,PunishID)
go
3.4完整性约束、自定义约束
--class表约束
useStudentRecordDB
go
altertableClass
addconstraintpk_ClassIDprimarykey(ClassID)go
--course表约束
useStudentRecordDB
go
altertableCourse
addconstraintpk_Cnoprimarykey(Cno)
go
--dept表约束
useStudentRecordDB
go
altertableDept
addconstraintpk_DeptIDprimarykey(DeptID)go
--huojiang表约束
useStudentRecordDB
go
altertableHuoJiang
addconstraintpk_huojiangprimarykey(Sno,RewardID)go
--punish表约束
useStudentRecordDB
go
altertablePunish
addconstraintpk_PunishIDprimarykey(PunishID)go
--reward表约束useStudentRecordDBgo
altertableReward
addconstraintpk_RewardIDprimarykey(RewardID)go
--room表约束useStudentRecordDBgoaltertableRoom
addconstraintpk_RoomIDprimarykey(RoomID)go
--sc表约束
useStudentRecordDBgo
--参照完整性
useStudentRecordDB
go
ALTERTABLESCWITHNOCHECK
ADDCONSTRAINTFK_student_scFOREIGNKEY(Sno)REFERENCEStudent(Sno)ONDELETECASCADE
ALTERTABLESCWITHNOCHECK
ADDCONSTRAINTFK_course_scFOREIGNKEY(Cno)REFERENCECSourse(Cno)
ONDELETECASCADE
ALTERTABLEHuoJiangWITHNOCHECK
ADDCONSTRAINTFK_student_huojiangFOREIGNKEY(Sno)REFERENCEStudent(Sno)
ONDELETECASCADE
ALTERTABLEHuoJiangWITHNOCHECK
ADDCONSTRAINTFK_reward_huojiangFOREIGNKEY(RewardID)REFERENCES
Reward(RewardID)
ONDELETECASCADE
ALTERTABLEWeiJiWITHNOCHECK
ADDCONSTRAINTFK_student_weijiFOREIGNKEY(Sno)REFERENCEStudent(Sno)
ONDELETECASCADE
ALTERTABLEWeiJiWITHNOCHECKADDCONSTRAINTFK_punish_weijiFOREIGNKEY(PunishID)REFERENCEPSunish(PunishID)ONDELETECASCADE
useStudentRecordDB
go
create
index
ind_ClassID
onClass(ClassID)
create
index
ind_Cnoon
Course(Cno)
create
index
ind_DeptID
onDept(DeptID)
create
index
ind_huojiang
onHuoJiang(Sno,RewardID)
create
index
ind_PunishID
onPunish(PunishID)
create
index
ind_RewardID
onReward(RewardID)
create
index
ind_RoomID
onRoom(RoomID)
create
index
ind_sconSC(Sno,Cno)
create
index
ind_Snoon
Student(Sno)
createindexind_UidonUsers(Uid)
createindexind_weijionWeiJi(Sno,PunishID)go
--class表约束(实体完整性)useStudentRecordDBgoaltertableClass
addconstraintpk_ClassIDgo--course表约束(实体完整性)useStudentRecordDBgoaltertableCourse
addconstraintpk_Cnogo--dept表约束(实体完整性)useStudentRecordDBgoaltertableDept
addconstraintpk_DeptIDgo--huojiang表约束(实体完整性)useStudentRecordDBgoaltertableHuoJiang
addconstraintpk_huojianggo
--punish表约束(实体完整性)useStudentRecordDBgoaltertablePunish
addconstraintpk_PunishIDgo
--reward表约束(实体完整性)useStudentRecordDBgoaltertableReward
addconstraintpk_RewardIDgo
--room表约束(实体完整性)useStudentRecordDB
primarykey(ClassID)
primarykey(Cno)
primarykey(DeptID)
primarykey(Sno,RewardID)
primarykey(PunishID)
primarykey(RewardID)
go
altertableRoom
addconstraintpk_RoomIDprimarykey(RoomID)go
--sc表约束(实体完整性)useStudentRecordDBgo
altertableSC
addconstraintpk_scprimarykey(Sno,Cno)go
--student表约束(实体完整性)useStudentRecordDBgoaltertableStudent
addconstraintpk_Snoprimarykey(Sno)go
--Users表约束(实体完整性)useStudentRecordDBgoaltertableUsers
addconstraintpk_Uidprimarykey(Uid)go
--weiji表约束(实体完整性)useStudentRecordDBgo
altertableWeiJi
addconstraintpk_weijiprimarykey