-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdatabase.sql
52 lines (48 loc) · 1.85 KB
/
database.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
49
50
51
52
CREATE DATABASE taxis_service_database;
USE taxis_service_database;
CREATE TABLE users(
id int(255) auto_increment not null,
name varchar(100) not null,
email varchar(255) not null,
password varchar(255) not null,
CONSTRAINT pk_usuarios PRIMARY KEY(id),
CONSTRAINT uq_email UNIQUE(email)
)ENGINE=InnoDb;
CREATE TABLE reservations(
id int(255) auto_increment not null,
user_email varchar(255) not null,
reserved_for date not null,
reserved_at date not null,
CONSTRAINT pk_reservations PRIMARY KEY(id)
)ENGINE=InnoDb;
CREATE TABLE times(
id int(255) auto_increment not null,
hour varchar(100) not null,
taxis_availability int(100) not null,
CONSTRAINT pk_times PRIMARY KEY(id)
)ENGINE=InnoDb;
INSERT INTO times VALUES(NULL, "08:00", 8);
INSERT INTO times VALUES(NULL, "08:30", 8);
INSERT INTO times VALUES(NULL, "09:00", 8);
INSERT INTO times VALUES(NULL, "09:30", 8);
INSERT INTO times VALUES(NULL, "10:00", 8);
INSERT INTO times VALUES(NULL, "10:30", 8);
INSERT INTO times VALUES(NULL, "11:00", 8);
INSERT INTO times VALUES(NULL, "11:30", 8);
INSERT INTO times VALUES(NULL, "12:00", 8);
INSERT INTO times VALUES(NULL, "12:30", 8);
INSERT INTO times VALUES(NULL, "13:00", 8);
INSERT INTO times VALUES(NULL, "13:30", 8);
INSERT INTO times VALUES(NULL, "14:00", 8);
INSERT INTO times VALUES(NULL, "14:30", 8);
INSERT INTO times VALUES(NULL, "15:00", 8);
INSERT INTO times VALUES(NULL, "15:30", 8);
INSERT INTO times VALUES(NULL, "16:00", 8);
INSERT INTO times VALUES(NULL, "16:30", 8);
INSERT INTO times VALUES(NULL, "17:00", 8);
INSERT INTO times VALUES(NULL, "17:30", 8);
INSERT INTO times VALUES(NULL, "18:00", 8);
INSERT INTO times VALUES(NULL, "18:30", 8);
INSERT INTO times VALUES(NULL, "19:00", 8);
INSERT INTO times VALUES(NULL, "19:30", 8);
INSERT INTO times VALUES(NULL, "20:00", 8);