按关键词阅读: 课程设计 数据库 学生 成绩管理系统
1、数据库课程设计报告学生成绩管理系统学 院:专 业:班 级:姓 名:学 号:指导老师:2012/12/17目录第一部分功能描述第二部分数据流程分析(E-R图)第三部分逻辑模型设计第四部分代码实现第五部分课程设计总结第一部分通过计算机实现学生成绩管理 , 系统主要功能如下:1. 学生表包括学生学号 , 姓名 , 性别 , 班级 , 系别 , 出生日期的一些基本信息 。
2. 课程表包括课程号 , 课程名 , 课时 , 授课老师和开课日期的基本信息 。
3. 成绩表包括学生学号 , 课程号 , 成绩的基本信息 。
第二部分(E-R图)studengtcoursesnssexsnosbirthsdeptsclassteacherbeginclasscnoc 。
2、n选取score获得sncnoscore学生成绩管理分析根据数据库概念模型(ER图)建立关系模式如下:student(sno , sn , ssex , sbirth , sdept , sclass)course(sno , sn , beginclass , teacher)scoure(sn , cn , scourse,)第三部分 逻辑模型设计根据系统的总体概念设计模型、E-R图向关系模式的转化规则和数据库的范式理论 , 得到系统优化后的逻辑模型 , 如下:学生表表结构字段数据类型长度是否允许空值备注学号char12否主键姓名char10否性别char2是做检查约束出生日期smalldatetime是系部char20是班级small 。
3、int是课程表结构字段数据类型长度是否允许空值课程号char10否课程名char20否开课日期smalldatetime是任课教师varchar10是课时smallint是成绩表结构字段数据类型长度是否允许空值学号char12否课程号char10否成绩smallint是第四部分 代码实现得到系统逻辑模型后 , 就该进行数据库的物理设计和实施数据库了 , 物理设计主要是要确定数据库的存储路径、存储结构以及如何建立索引等 , 可以采用系统的默认设置 。
数据库实施主要包括在具体的DBMS中创建数据库和表的过程 , 本设计所选用的DBMS为SQL SERVER2000 , 有关创建数据库和关系表的SQL语句如下所示:创建学 。
4、生成绩管理系统create database studentsystem1on primary (name=studentsystem_data,filename=C:Documents and SettingsAdministrator桌面新建文件夹studentsystem_data.mdf,size=5,filegrowth=10%,maxsize=unlimited)log on(name=studentsystem_log,filename=C:Documents and SettingsAdministrator桌面新建文件夹studentsystem_log.ldf,size=5 。
5、,filegrowth=10%,maxsize=unlimited)use studentsystem1创建学生表create table student (sno char(12) not null,sname varchar(10) not null,ssex char(2) ,sbirth smalldatetime ,sdept varchar(20),sclass smallint ,constraint pk_sno primary key(sno),constraint ck_ssex check (ssex in (f,m)创建课程表create table course(cn 。
6、o varchar(10) not null,cn varchar(20) not null,ct smallint ,beginclass smalldatetime ,teacher varchar(10),constraint pk_cno primary key(cno),)创建成绩表create table score (sno char (12) not null,cno varchar(10) not null,score smallint ,constraint pk_snocon primary key(sno, cno),constraint fk_sno foreign。
7、key(sno ) references student(sno),constraint fk_cno foreign key(cno ) references course(cno),constraint ck_score check (score =0 and score =100)创建视图 , 将学生表和成绩表连接起来create view view1as (select student.sno,sname,ssex,sbirth,sdept,sclass,cno,score from student ,score where student.sno=score.sno)select *fr 。
8、om view1将课程表和成绩表连接起来create view view2as (select o,cn,beginclass ,ct,teacher,sno ,score from score ,course where o=o)select *from view2创建存储过程 , 根据学号查询姓名create procedure p1(sno char(12) )asdeclare sname char (12)select sname=sname from student where sno=snoprint snamep1 1根据学号查询成绩create procedure p2(sno。
9、char(12)as declare score smallint select score =score from score where sno=sno print scorep2 1在学生表中 , 根据学号增加信息create procedure inserstudent(sno char(12),sname char(10),ssex char(2),sbirth smalldatetime,sdept varchar(20),sclass smallint )as insert into student values(3,黄,m,1991-2-3,软件,19)inserstudent 3 。
10、,黄,m,1991,软件,19创建登陆sp_addlogin liu,123use studentsystem1sp_helploginssp_adduser liu,use2sp_helpusergrant select on student to use2sp_addrole role1sp_helprolegrant select ,delete ,insert,update on student to role1grant select ,delete ,insert,update on student to role1grant select ,delete ,insert,upda 。
11、te on student to role1创建登陆sp_addlogin liu1,123use studentsystem1sp_helploginssp_adduser liu1,use3sp_helpusergrant select on student to use3sp_addrole role2sp_helprolegrant select ,delete ,insert,update on student to role2grant select ,delete ,insert,update on student to role2grant select ,delete ,in 。
【学生|学生成绩管理系统数据库课程设计】12、sert,update on student to role2create trigger tr2on studentfor update as declare sno char(12)select sno=sno from deleted where sno=1if(sno=1)Rollback第五部分 课程设计总结首先 , 我要感谢我的指导老师对我的指导 。
稿源:(未知)
【傻大方】网址:/a/2021/0707/0022751645.html
标题:学生|学生成绩管理系统数据库课程设计