forked from pipalacademy/rajdhani
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
55 lines (50 loc) · 1.06 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
create table station (
code text primary key,
name text,
zone text,
state text,
address text,
latitude real,
longitude real
);
create table train (
number text primary key,
name text,
type text,
zone text,
from_station_code text references station(code),
from_station_name text,
to_station_code text references station(code),
to_station_name text,
departure text,
arrival text,
duration_h real,
duration_m real,
distance real,
return_train text,
sleeper integer,
third_ac integer,
second_ac integer,
first_ac integer,
first_class integer,
chair_car integer
);
create table schedule (
station_code text,
station_name text,
train_number text,
train_name text,
day integer,
arrival text,
departure text
);
create table booking (
id integer primary key,
train_number text references train(number),
from_station_code text,
to_station_code text,
passenger_name text,
passenger_email text,
ticket_class text,
date text
);