-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
162 lines (152 loc) · 5.43 KB
/
database.sql
File metadata and controls
162 lines (152 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
CREATE USER 'lpl'@'%' IDENTIFIED BY '200296lpl.';
CREATE DATABASE employment_system;
GRANT ALL PRIVILEGES ON employment_system.* TO 'lpl'@'%';
#
FLUSH PRIVILEGES;
use employment_system;
create table users
(
id int auto_increment
primary key,
username char(20) null comment '用户姓名',
password varchar(25) null comment '用户密码',
phone char(20) null comment '用户手机号',
constraint user_pk_2
unique (id),
constraint users_pk
unique (phone)
);
create table pdf_url
(
id int auto_increment
primary key,
url char(100) null comment '文件url',
foreign_key int not null comment '外键',
constraint pdf_url_pk_2
unique (id),
constraint pdf_url_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table club_experience_info
(
id int auto_increment
primary key,
club_name char(10) null comment '社团组织',
club_start_time datetime null comment '社团入职时间',
club_end_time datetime null comment '社团离职时间',
club_detail varchar(500) null comment '社团细节',
foreign_key int not null comment '外键',
constraint club_experience_info_pk_2
unique (id),
constraint club_experience_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table education_info
(
id int auto_increment
primary key,
school char(15) null comment '毕业学校',
major char(10) null comment '专业',
degree char(10) null comment '学历',
grade double null comment '绩点',
`rank` int null comment '排名',
foreign_key int not null comment '外键',
constraint education_info_pk_2
unique (id),
constraint education_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table personal_info
(
id int auto_increment
primary key,
gender int null comment '性别',
phone char(20) null comment '手机号',
email char(20) null comment 'email',
identity char(20) null comment '当前身份',
foreign_key int null,
constraint personal_info_pk_2
unique (id),
constraint personal_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table project_experience_info
(
id int auto_increment
primary key,
project_name char(20) null comment '项目名',
project_position char(20) null comment '职位姓名',
project_start_time datetime null comment '开始时间',
project_end_time datetime null comment '结束时间',
project_detail varchar(500) null comment '项目经历',
foreign_key int not null,
constraint project_experience_info_pk_2
unique (id),
constraint project_experience_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table scholarship_info
(
id int auto_increment
primary key,
scholarship char(20) null comment '奖学金种类',
scholarship_time datetime null comment '获得时间',
scholarship_detail varchar(500) null comment '获得经历',
foreign_key int not null,
constraint scholarship_info_pk_2
unique (id),
constraint scholarship_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table social_act_info
(
id int auto_increment
primary key,
social_act char(30) null comment '社会实践',
act_start_time datetime null comment '开始时间',
act_end_time datetime null comment '结束时间',
act_detail varchar(500) null comment '实践经历',
foreign_key int not null,
constraint social_act_info_pk_2
unique (id),
constraint social_act_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table stu_position_info
(
id int auto_increment
primary key,
stu_position char(10) null comment '学生职务',
stu_start_time datetime null comment '开始时间',
stu_end_time datetime null comment '结束时间',
stu_detail varchar(500) null comment '职务经历',
foreign_key int not null,
constraint stu_position_info_pk_2
unique (id),
constraint stu_position_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);
create table work_experience_info
(
id int auto_increment
primary key,
company_name char(20) null comment '公司名称',
work_position char(20) null comment '职务经历',
work_start_time datetime null comment '开始时间',
work_end_time datetime null comment '结束时间',
work_detail varchar(500) null comment '工作经历',
foreign_key int not null,
constraint work_experience_info_pk_2
unique (id),
constraint work_experience_info_users_id_fk
foreign key (foreign_key) references users (id)
on delete cascade
);