Created
September 15, 2022 12:01
-
-
Save anandology/60417923ddcee758f0eb70676439a4ae to your computer and use it in GitHub Desktop.
Database schema for Rajdhani Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment