Skip to content

Instantly share code, notes, and snippets.

@anandology
Created September 15, 2022 12:01
Show Gist options
  • Save anandology/60417923ddcee758f0eb70676439a4ae to your computer and use it in GitHub Desktop.
Save anandology/60417923ddcee758f0eb70676439a4ae to your computer and use it in GitHub Desktop.
Database schema for Rajdhani Challenge
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