=========================
1. Creating databases and Tables
=========================
A total of 6 tables, Student information table, class information table, Teacher information table, curriculum, selection of curriculum, teachers schedule
#班级信息表class, the structure is as follows
Field name |
Field type |
Constraint conditions |
Field meaning description |
Classno |
varchar (6) |
Primary Key |
Class number |
ClassName |
Varchar (20) |
NOT NULL |
Class name |
Classspecial |
VARCHAR2 (20) |
|
Affiliated Professional |
Classdept |
VARCHAR2 (20) |
|
Affiliated Department |
#学生基本信息表student, the structure is as follows:
Field name |
Field type |
Constraint conditions |
Field meaning description |
Sno |
Number (8) |
Primary Key |
School Number |
Sname |
VARCHAR2 (8) |
NOT NULL |
Name |
Ssex |
VARCHAR2 (2) |
' Male ' or ' female ' |
Gender |
Sbirthday |
Date |
|
Date of birth |
Classno |
varchar (6) |
Foreign Key |
Class number |
#教师信息表teacher, the structure is as follows:
Field name |
Field type |
Constraint conditions |
Field meaning description |
Tno |
Number (6) |
Primary Key |
Teacher Number |
Tname |
VARCHAR2 (8) |
NOT NULL |
Name of teacher |
Tsex |
VARCHAR2 (2) |
' Male ' or ' female ' |
Gender |
Tbirthday |
Date |
|
Date of birth |
Ttitle |
VARCHAR2 (10) |
|
Title |
#课程信息表course, the structure is as follows:
Field name |
Field type |
Constraint conditions |
Field meaning description |
Cno |
Number (6) |
Primary Key |
Course Number |
CName |
VARCHAR2 (30) |
NOT NULL |
Course Name |
Score |
Number (6,2) |
|
Credits |
#选修课程信息表sc, the structure is as follows:
Field name |
Field type |
Constraint conditions |
Field meaning description |
Sno |
Number (8) |
Foreign Key |
School Number |
Cno |
Number (6) |
Foreign Key |
Course Number |
Grade |
Number (6,1) |
|
Results |
#教师任课情况表teaching, the structure is as follows:
Field name |
Field type |
Constraint conditions |
Field meaning description |
Tno |
Number (6) |
Foreign Key |
Teacher Number |
Cno |
Number (6) |
Foreign Key |
Course Number |
MySQL Database basic Practice--the course practice of engineering database of Jiaotong University