-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproject.sql
48 lines (42 loc) · 1.16 KB
/
project.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
43
44
45
46
47
48
CREATE DATABASE project;
CREATE TABLE administrator(
admin_id char(7) not null PRIMARY KEY,
admin_name text,
admin_password text);
INSERT INTO administrator values('a000001','admin1','100001');
INSERT INTO administrator values('a000002','admin1','100002');
CREATE TABLE teacher(
id char(7) not null PRIMARY KEY,
name text,
password text,
introduction text DEFAULT NULL,
address text DEFAULT NULL,
maxunllnum int DEFAULT 10000,
maxnumOfMonth int DEFAULT 100,
maxtimeOfMonth int DEFAULT 10000);
CREATE TABLE student(
id char(7) not null PRIMARYKEY,
name text,
password text DEFAULT NULL,
introduction text DEFAULT NULL);
CREATE TABLE reservation(
r_id int auto-INCREMENT PRIMARY KEY,
teacher text(7),
student text(7) DEFAULT NULL,
r_date date,
r_year int,
r_month int,
beginTime text,
finishTime text,
length int,
building text,
room text,
distance int,
vaild_stu text,
isvaild boolean DEFAULT true,
wellfinished boolean DEFAULT true);
CREATE TABLE setting(
id int auto-INCREMENT PRIMARY KEY,
maxVaildNum int,
minRegretDate int);
INSERT INTO setting(maxVaildNum,minRegretDate) values (1,5);