-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.sql
72 lines (63 loc) · 2.03 KB
/
schema.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
DROP DATABASE IF EXISTS e_rick_test;
CREATE DATABASE e_rick_test;
USE e_rick_test;
CREATE TABLE requests (
request_id int(5) auto_increment primary key,
user_id int(5),
source_latitude float(30),
source_longitude float(30),
destination_latitude float(30),
destination_longitude float(30),
destination varchar(30),
request_time varchar(30));
CREATE TABLE autostatus (
auto_id int(5) primary key auto_increment,
auto_latitude float(30),
auto_longitude float(30),
last_updated_at varchar(30));
insert into autostatus (auto_latitude, auto_longitude, last_updated_at) values (10.7618779,78.8198142,now());
insert into autostatus (auto_latitude, auto_longitude, last_updated_at) values (10.7618779,78.8198142,now());
insert into autostatus (auto_latitude, auto_longitude, last_updated_at) values (10.7618779,78.8198142,now());
CREATE TABLE drivers (
driver_id int(5) auto_increment primary key,
drivername varchar(30),
password varchar(30),
auto_no varchar(30),
rating int(5),
mobile_no varchar(30));
CREATE TABLE friends (
friend_id int(5) auto_increment primary key,
user_id int(5),
mobile_no varchar(20),
name varchar(30));
CREATE TABLE passenger_history (
id int(5) auto_increment primary key,
passenger_id int(5),
date varchar(30),
destination varchar(30),
source varchar(30));
CREATE TABLE drivers_history (
ride_id int(5) auto_increment primary key,
driver_id int(5),
passenger_id int(5),
driver_rating int(5),
no_of_passengers int(5),
source varchar(30),
destination varchar(30),
start_time varchar(30));
CREATE TABLE passengers (
passenger_id int(5) primary key auto_increment,
roll_no int(10),
name varchar(30),
password varchar(30),
mobile varchar(30),
is_riding varchar(30),
rating varchar(30),
gender varchar(10));
CREATE TABLE rides (
id int(5) auto_increment primary key,
driver_id int(5),
passenger_id varchar(100),
stops varchar(30),
next_stop int(10)
capacity int(3));