-
Notifications
You must be signed in to change notification settings - Fork 0
/
数据库建表信息.sql
42 lines (39 loc) · 912 Bytes
/
数据库建表信息.sql
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
CREATE TABLE user (
id int(11) AUTO_INCREMENT,
name varchar(30) ,
studentID varchar(30) unique,
password varchar(30),
type varchar(10),
level int,
primary key (id)
) DEFAULT CHARSET=utf8;
CREATE TABLE work_user (
id int(11) AUTO_INCREMENT,
studentID varchar(30),
date datetime,
status varchar(10),
work varchar(30),
primary key (id),
foreign key(studentID) references user(studentID)
) DEFAULT CHARSET=utf8;
CREATE TABLE teacher (
id int(11) AUTO_INCREMENT,
name varchar(30) ,
tel varchar(30),
type varchar(10),
workID varchar(30) unique,
password varchar(30),
primary key(id)
) DEFAULT CHARSET=utf8;
CREATE TABLE work (
id int(11) AUTO_INCREMENT,
name varchar(30),
work varchar(30),
workID varchar(30),
start datetime,
end datetime,
level int,
type varchar(10),
primary key(id),
foreign key(workID) references teacher(workID)
) DEFAULT CHARSET=utf8;