时间:2021-07-01 10:21:17 帮助过:9人阅读
CREATE DATABASE `stusys` ; USE `stusys`; DROP TABLE IF EXISTS `tb_class`; CREATE TABLE `tb_class` ( `cid` int(11) NOT NULL AUTO_INCREMENT COMMENT ‘班级编号‘, `cname` varchar(100) NOT NULL COMMENT ‘班级名称‘, `qq` varchar(20) DEFAULT NULL COMMENT ‘班级QQ群‘, `school` varchar(100) DEFAULT NULL COMMENT ‘学生名称‘, `headmaster` varchar(50) DEFAULT NULL COMMENT ‘班主任‘, `tel` varchar(50) DEFAULT NULL COMMENT ‘班主任电话号码‘, `declaration` varchar(200) DEFAULT NULL COMMENT ‘班级宣言‘, PRIMARY KEY (`cid`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; insert into `tb_class`(`cid`,`cname`,`qq`,`school`,`headmaster`,`tel`,`declaration`) values (1,‘ 2013级数学 ‘,‘57197804 ‘,‘湖南大学 ‘,‘王娟‘,‘15388088011 ‘,‘自强不息‘); DROP TABLE IF EXISTS `tb_college`; CREATE TABLE `tb_college` ( `collegeId` int(11) NOT NULL, `collegeName` varchar(20) DEFAULT NULL, `collegeRoom` varchar(20) DEFAULT NULL, `collegeDeanID` int(11) DEFAULT NULL, `collegeTel` varchar(11) DEFAULT NULL, `collegeEmail` varchar(20) DEFAULT NULL, `schoolId` int(11) DEFAULT NULL, PRIMARY KEY (`collegeId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `tb_course`; CREATE TABLE `tb_course` ( `courseId` int(11) NOT NULL, `coutseName` varchar(20) DEFAULT NULL, `teacherId` int(11) DEFAULT NULL, `courseRoom` varchar(20) DEFAULT NULL, `maxstudentNum` int(11) DEFAULT NULL, `collegeId` int(11) DEFAULT NULL, PRIMARY KEY (`courseId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `tb_school`; CREATE TABLE `tb_school` ( `schoolId` int(11) NOT NULL, `schoolName` varchar(20) DEFAULT NULL, `schoolPrincipal` varchar(20) DEFAULT NULL, `schoolAdd` varchar(200) DEFAULT NULL, `schoolEmain` varchar(200) DEFAULT NULL, `schoolTel` varchar(11) DEFAULT NULL, `schoolWebsite` varchar(30) DEFAULT NULL, PRIMARY KEY (`schoolId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `tb_score`; CREATE TABLE `tb_score` ( `scoreId` int(11) NOT NULL, `studentId` int(11) DEFAULT NULL, `courseId` int(11) DEFAULT NULL, `score` float DEFAULT NULL, PRIMARY KEY (`scoreId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `tb_student`; CREATE TABLE `tb_student` ( `stuNo` bigint(11) NOT NULL AUTO_INCREMENT COMMENT ‘学号‘, `name` varchar(50) NOT NULL COMMENT ‘姓名‘, `password` varchar(200) NOT NULL COMMENT ‘密码‘, `idCard` varchar(18) DEFAULT NULL COMMENT ‘身份证‘, `sex` char(2) DEFAULT NULL COMMENT ‘性别‘, `education` varchar(8) DEFAULT NULL COMMENT ‘学历 0:专科 1:本科 2:硕士 3:博士‘, `schoolId` int(100) DEFAULT NULL COMMENT ‘毕业学校‘, `professional` varchar(100) DEFAULT NULL COMMENT ‘专业‘, `acceptanceDate` date DEFAULT NULL COMMENT ‘入学日期‘, `birthday` date DEFAULT NULL COMMENT ‘出生日期‘, `status` varchar(20) DEFAULT NULL COMMENT ‘状态‘, `tel` varchar(50) DEFAULT NULL COMMENT ‘联系电话号码‘, `secondTel` varchar(50) DEFAULT NULL COMMENT ‘第二联系电话号码‘, `qq` varchar(20) DEFAULT NULL COMMENT ‘QQ‘, `email` varchar(100) DEFAULT NULL COMMENT ‘邮箱‘, `address` varchar(200) DEFAULT NULL COMMENT ‘地址‘, `classId` int(11) DEFAULT NULL COMMENT ‘班级编号‘, `isAdmin` int(11) DEFAULT ‘0‘ COMMENT ‘是否是管理员 0:表示学生 1:管理员 0:学生‘, `photoPath` varchar(200) DEFAULT NULL COMMENT ‘头像文件名‘, PRIMARY KEY (`stuNo`) ) ENGINE=InnoDB AUTO_INCREMENT=910513201420 DEFAULT CHARSET=utf8; insert into `tb_student`(`stuNo`,`name`,`password`,`idCard`,`sex`,`education`,`schoolId`,`professional`,`acceptanceDate`,`birthday`,`status`,`tel`,`secondTel`,`qq`,`email`,`address`,`classId`,`isAdmin`,`photoPath`) values (1001,‘admin‘,‘admin‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL),(910513201419,‘ 邹智 ‘,‘123456‘,‘430181198612113330‘,‘男‘,‘1‘,1,‘数学‘,‘2013-09-05‘,‘1994-08-16‘,‘ 在读 ‘,‘ 15111141999‘,NULL,NULL,NULL,NULL,1,0,NULL); DROP TABLE IF EXISTS `tb_teacher`; CREATE TABLE `tb_teacher` ( `teacherid` int(11) NOT NULL, `teacherName` varchar(20) DEFAULT NULL, `password` varchar(20) DEFAULT NULL, `idCard` varchar(18) DEFAULT NULL, `sex` varchar(2) DEFAULT NULL, `teacherTitle` varchar(8) DEFAULT NULL, `entryDate` date DEFAULT NULL, `birthday` date DEFAULT NULL, `status` varchar(8) DEFAULT NULL, `tel` varchar(11) DEFAULT NULL, `secondTel` varchar(11) DEFAULT NULL, `qq` varchar(20) DEFAULT NULL, `email` varchar(100) DEFAULT NULL, `address` varchar(200) DEFAULT NULL, `schoolid` int(11) DEFAULT NULL, `collegeId` int(11) DEFAULT NULL, `isAdmin` int(11) DEFAULT NULL, `photoPath` varchar(200) DEFAULT NULL, PRIMARY KEY (`teacherid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;转自 https://www.cnblogs.com/365txrw/p/StuDataBase.html
学生信息管理系统数据库设计
标签:邮箱 cout ssid 图片 post 成绩表 ESS 系统数据库 uda