《数据库毕业设计选题系统课程设计.docx》由会员分享,可在线阅读,更多相关《数据库毕业设计选题系统课程设计.docx(11页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、数据库毕业设计选题系统课程设计1. 需求分析系统需求分析:随着互联的发展,计算机的软硬件不断的更新迭代,这时计算机已经可以管理超规模的数据,件系统远远不能满各种应的需求, 数据库使得数据实现了结构化存储,数据更容易被共享。数据库管理系统既便于数据的集中管理,控制冗余,提数据的利率和致性,利于应程序的开发和维护。随着校学数越来越多,课程越来越丰富,学多师少,迫切需要个数据库管理系统来管理、存取量的信息,则建个学毕 业设计选题系统具有常的实际应意义。我们知道计算机具有运算速度快,处理能强等特点。因此,为了保证学校信息的流畅,作效,学毕业设计选题系统应运。这不但能使教务员从复杂的管理中解脱出来,且对
2、于推动教学的发展也起到常重要的作。系统功能需求分析:教师和学进双向选择,即学可选择相应的毕业设计题,教师也可选择学。1)教师:1.1 教师可以增加毕业设计题,数,及要求。1.2 教师可录取报名的学,查看学的详细信息如学的基本信息等内容。 1.3针对不同的户,可进相关的统计、查询可查看报的学数,基本信息等。 2)学:2.1 可浏览教师的毕业设计题及教师的简介等内容。2.2 可查看的个信息(基本信息)。2.3 可以报毕业设计题,每限报两个,第选题志愿和第选题志愿。3)管理员3.1 可对每个教师、学进统计分析与维护。2. 概念设计( E-R图)根据需求分析结果,学、教师、管理员、题、班级、专业、学院
3、等可建模为基本实体集。 各基本实体集的属性定义如下:1. 学(Student)实体集。其属性有:学号(studentNo)、姓名(studentName)、性别(sex)、出期(birthday)、籍贯(native)、民族(nation)等。2. 教师(Teacher)实体集。其属性有:教师编号(teacherNo)、姓名(teacherName)、性别(sex)、学位(degree)等。3. 班级(Class)实体集。其属性有:班级编号(classNo)、班级名称(className)等。4. 专业(Speciality)实体集。其属性有:专业编号(specialityNo)、专业名称(s
4、pecialityName)等。5. 学院(Institute)实体集。其属性有:学院编号(instituteNo)、学院名称(instituteName)等。6. 题(Title)实体集。其属性有:题编号(titleNo)、题名称(titleName)、要求(requirement)、数(population) 等。7. 管理员(Manager)实体集。其属性有:号(managerNo)、姓名(managerName)、性别(sex)、联系式(phoneNum)。定义联系集及属性:1. 选题(SelectTitle)联系集:它是题实体集与学实体集的对多联系集,其描述属性有:题编号(title
5、No)、学号(studentNo)、教师编号(teacherNo)、志愿(wish)、录取情况(admission)等。2. 出题(SetTitle)联系集:它是教师实体集与题实体集的对多联系集,没有联系属性。3. 指导(Guidance)联系集:它是教师实体集与学实体集的对多联系集,没有联系属性。4. 包含(Include)联系集:它是班级实体集与学实体集的对多联系集,没有联系属性。5. 拥有(Hold)联系集:它是专业实体集和班级实体集的对多联系集,没有联系属性。6. 属于(Belong)联系集:它是学院实体集与教师实体集的对多联系集,没有联系属性。7. 设置(Establish)联系集:
6、它是学院实体集与专业实体集的对多联系集,没有联系属性。 权限设置:(1)户(User):账号(userNo)、登录密码(password)、姓名(userName)、份(identity)等。3. 逻辑设计(下划线加粗代表主码,斜体加粗代表外码 )(1)学Student表:由学关系实体集转化来。属性名称数据类型属性描述studentNochar(12)学号studentNamevarchar(20)姓名sexchar(2)性别birthdaydatetime出期学Student(studentNo,studentName,sex,birthday,native,nation,classNo);
7、nativenationvarchar(20)varchar(10)籍贯民族classNochar(8)班级编号(2)教师Teacher表:由教师实体集转化来。教师Teacher(teacherNo,teacherName,sex,degree,instituteNo);属性名称数据类型属性描述teacherNochar(6)教师编号teacherNamevarchar(20)姓名sexchar(2)性别degreevarchar(10)学位instituteNochar(3)学院编号(3)班级Class表:由班级实体集转化来。属性名称数据类型属性描述classNochar(8)班级编号cla
8、ssNamevarchar(20)班级名称specialityNochar(5)专业编号班级Class(classNo,className,specialityNo);(4)专业Speciality表:由专业实体集转化来。属性名称数据类型属性描述specialityNochar(5)专业编号specialityNamevarchar(20)专业名称instituteNochar(3)学院编号专业Speciality(specialityNo,specialityName,instituteNo);属性名称数据类型属性描述instituteNochar(3)学院编号instituteNameva
9、rchar(20)学院名称(5)学院Institute表:由学院实体集转化来。学院Institute(instituteNo,instituteName);(6)题Title表:由题实体集转化来。题Title(titleNo,titleName,requirement,population,teacherNo);属性名称数据类型属性描述titleNochar(9)题编号titleNamevarchar(20)题名称requirementvarchar(100)要求populationint数teacherNochar(6)教师编号(7)管理员Manager实体集转化的关系模式。管理员Manag
10、er(managerNo,managerName,sex,phoneNum);属性名称数据类型属性描述managerNochar(4)号managerNamevarchar(20)姓名sexchar(2)性别phoneNumvarchar(13)联系式(8)选题SelectTitle联系集转化的关系模式。选题SelectTitle(titleNo,studentNo,teacherNo,wish,admission);属性名称数据类型属性描述titleNochar(9)题编号studentNochar(12)学号teacherNochar(6)教师编号wishchar(4)志愿admissio
11、n(9)户User关系模式。char(1)录取情况户User(userNo,password,userName,identity);属性名称数据类型属性描述userNovarchar(12)账号passwordvarchar(20)登录密码userNamevarchar(20)姓名identityvarchar(3)份4. 模式求精(1) 学Student(studentNo,studentName,sex,birthday,native,nation,classNo);分析Student关系模式得函数依赖关系为:tudentNo-studentName,sex,birthday,native
12、,nation,classNo 满BCNF范式。(2) 教师Teacher(teacherNo,teacherName,sex,degree,instituteNo);分析Teacher关系模式得函数依赖关系为:teacherNo-teacherName,sex,degree,instituteNo 满BCNF范式。(3) 班级Class(classNo,className,specialityNo)分析Class关系模式得函数依赖关系为: classNo-className,specialityNo 满BCNF范式。(4) 专业Speciality(specialityNo,speciali
13、tyName,instituteNo);分析Speciality关系模式得函数依赖关系为: specialityNo-specialityName,instituteNo 满BCNF范式。(5)学院Institute(instituteNo,instituteName); 分 析 Speciality 关 系 模 式 得 函 数 依 赖 关 系 为 : instituteNo-instituteName满BCNF范式。 (6) 题 Title(titleNo,titleName,requirement,population,teacherNo); 分析Speciality关系模式得函数依赖关系
14、为:titleNo-titleName,requirement,population,teacherNo 满BCNF范式。5. 表的设计(1) 学Student表(studentNo,studentName,sex,birthday,native,nation,classNo)(2) 教师Teacher表(teacherNo,teacherName,sex,degree,instituteNo)(3) 班级Class表(classNo,className,specialityNo);(4) 专业Speciality表(specialityNo,specialityName,instituteN
15、o);(5)学院Institute表(instituteNo,instituteName);(6)题Title表(titleNo,titleName,requirement,population,teacherNo);(7)管理员Manager表(managerNo,managerName,sex,phoneNum);(8)选题SelectTitle表(titleNo,studentNo,teacherNo,wish,admission);(9)户User表(userNo,password,userName,identity);SET NAMES utf8mb4;SET FOREIGN_KEY
16、_CHECKS = 0;- Table structure for classDROP TABLE IF EXISTS class;CREATE TABLE class (classNo char(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 班级编号,className varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 班级名称,specialityNo char(5) CHARACTER SET utf8 COLLAT
17、E utf8_general_ci NULL DEFAULT NULL COMMENT 专 业 编 号 , PRIMARY KEY (classNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for instituteDROP TABLE IF EXISTS institute; CREATE TABLE institute (instituteNo char(3) CHARACTER SET utf8 C
18、OLLATE utf8_general_ci NOT NULL COMMENT 学院编号,instituteName varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 学 院 名 称 , PRIMARY KEY (instituteNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for managerDROP TA
19、BLE IF EXISTS manager; CREATE TABLE manager (managerNo char(4) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 管理员编号,managerName varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 姓 名 ,sex char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 性
20、 别 ,phoneNum varchar(13) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 联 系 式 , PRIMARY KEY (managerNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for selecttitleDROP TABLE IF EXISTS selecttitle; CREATE TAB
21、LE selecttitle (titleNo char(9) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 题编号,studentNo char(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 学 号 ,teacherNo char(6) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 教师编号,wish char(4) CHARACTER SET utf8 COLLA
22、TE utf8_general_ci NOT NULL COMMENT 第志愿/第志愿,admission char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 是 / 否 , PRIMARY KEY (titleNo, studentNo, teacherNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for special
23、ityDROP TABLE IF EXISTS speciality; CREATE TABLE speciality (specialityNo char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 专业编号,specialityName varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 专业名称,instituteNo varchar(3) CHARACTER SET utf8 COLLATE utf8_genera
24、l_ci NULL DEFAULT NULL COMMENT 学 院 编 号 , PRIMARY KEY (specialityNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for studentDROP TABLE IF EXISTS student; CREATE TABLE student (studentNo char(12) CHARACTER SET utf8 COLLATE utf8_gen
25、eral_ci NOT NULL COMMENT 学 号 ,studentName varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 姓 名 ,sex char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 性别,男、,birthday date NULL DEFAULT NULL COMMENT 出期,native varchar(20) CHARACTER SET utf8 COLLATE utf8_
26、general_ci NULL DEFAULT NULL COMMENT 籍 贯 ,nation varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 民 族 ,classNo char(8) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 班 级 编 号 , PRIMARY KEY (studentNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = u
27、tf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for teacherDROP TABLE IF EXISTS teacher; CREATE TABLE teacher (teacherNo char(6) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 教师编号,teacherName varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 姓
28、 名 ,sex char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 性 别 ,degree varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 学 位 ,instituteNo char(3) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 学 院 编 号 , PRIMARY KEY (teach
29、erNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for titleDROP TABLE IF EXISTS title;CREATE TABLE title (titleNo char(9) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 题编号,titleName varchar(20) CHARACTER SET utf8 CO
30、LLATE utf8_general_ci NOT NULL COMMENT 题名称,requirement varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 要 求 ,population int(11) NULL DEFAULT NULL COMMENT 数,teacherNo varchar(6) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 教 师 编 号 , PRIMARY KEY
31、 (titleNo) USING BTREE) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;- Table structure for userDROP TABLE IF EXISTS user;CREATE TABLE user (userNo varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 账 号 ,password varchar(20) CHARACTER SET ut
32、f8 COLLATE utf8_general_ci NOT NULL COMMENT 密 码 ,userName varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 户 名 称 ,identity varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 份:学、教师、管理员, PRIMARY KEY (userNo) USING BTREE) ENGINE = InnoDB CHARACTER SE
33、T = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; SET FOREIGN_KEY_CHECKS = 1;6. 功能设计(1)查看某位学的基本信息SELECT * FROM student WHERE studentNo=.; 查看某位教师的基本信息SELECT * FROM teacher WHERE teacherNo=.;(2)学浏览教师的毕业设计题SELECT * FROM title(3)教师可录取报名的学UPDATE selecttitle SET admission=是 WHERE studentNo=. AND wi
34、sh=.;(4)教师更新题信息UPDATE title SET . WHERE titleNo=.;(5)教师查看每个题的选题数SELECT titleNo,teacherNo,COUNT(DISTINCT studentNo) FROM selecttitle GROUP BY titleNo HAVING teacherNo=.;(6)统计每位教师的出题数SELECT teacherNo,COUNT(DISTINCT titleNO)FROM title GROUP BY teacherNo;(7)教师删除某个题信息(删除)DELETE FROM title WHERE titleNo=.
35、;(8)删除已被录取的学的另个未录取的选题信息DELETE FROM selecttitle WHERE admission= 否 AND studentNo=.;(9)教师查看报了题的某个学的信息SELECT a.studentNo,studentName,sex,birthday,native,nation,classNo FROM student a,selecttitle bWHERE a.studentNo=b.studentNo AND b.studentNo=.;(10)学查看选题的教师的基本信息SELECT b.teacherNo,teacherName,sex,degree,
36、instituteName FROM selecttitle a,teacher b,institute cWHERE a.teacherNo=b.teacherNo AND b.instituteNo=c.instituteNo AND a.teacherNo=.;(11)查询学所在班级,专业SELECT studentNo,studentName,className,specialityName FROM student a LEFT JOIN class b ON a.classNo=b.classNo RIGHT JOIN speciality c ON b.specialityNo=c.specialityNoWHERE studentNo=.;(12)查询选了某个题的学的信息SELECT studentNo,studentName,sex,classNo FROM studentWHERE studentNo IN(SELECT studentNo FROM selecttitle WHERE titleNo=.);