CREATE TABLE "circuits" (
cctkey integer NOT NULL,
location_metadata jsonb NULL,
    PRIMARY KEY (cctkey)
);

First 3 rows:
  cctkey  location_metadata
--------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       3  {'name': 'Bahrain International Circuit', 'location': {'city': 'Sakhir', 'country': 'Bahrain'}, 'coordinates': {'latitude': 26.0325, 'longitude': 50.5106, 'elevation_m': None}, 'external_link': None, 'reference_code': 'bahrain'}
       4  {'name': 'Circuit de Barcelona-Catalunya', 'location': {'city': 'Montmeló', 'country': 'Spain'}, 'coordinates': {'latitude': 41.57, 'longitude': 2.26111, 'elevation_m': None}, 'external_link': 'http://en.wikipedia.org/wiki/Circuit_de_Barcelona-Catalunya', 'reference_code': 'catalunya'}
       5  {'name': 'Istanbul Park', 'location': {'city': None, 'country': 'Turkey'}, 'coordinates': {'latitude': 40.9517, 'longitude': 29.405, 'elevation_m': None}, 'external_link': 'http://en.wikipedia.org/wiki/Istanbul_Park', 'reference_code': 'istanbul'}
...


CREATE TABLE "drivers" (
drv_main integer NOT NULL,
driver_identity jsonb NULL,
    PRIMARY KEY (drv_main)
);

First 3 rows:
  drv_main  driver_identity
----------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         2  {'code': 'HEI', 'name': {'surname': 'Heidfeld', 'first_name': 'Nick'}, 'info_link': 'http://en.wikipedia.org/wiki/Nick_Heidfeld', 'reference': 'heidfeld', 'birth_date': '1977-05-10', 'nationality': 'German', 'racing_number': None}
         3  {'code': None, 'name': {'surname': 'Rosberg', 'first_name': 'Nico'}, 'info_link': 'http://en.wikipedia.org/wiki/Nico_Rosberg', 'reference': 'rosberg', 'birth_date': None, 'nationality': 'German', 'racing_number': None}
         4  {'code': 'ALO', 'name': {'surname': None, 'first_name': None}, 'info_link': None, 'reference': 'alonso', 'birth_date': '1981-07-29', 'nationality': 'Spanish', 'racing_number': '14.0'}
...


CREATE TABLE "races" (
rak_id integer NOT NULL,
yr integer NULL,
rnum integer NULL,
trkbind integer NULL,
event_schedule jsonb NULL,
    PRIMARY KEY (rak_id),
    FOREIGN KEY (trkbind) REFERENCES circuits(cctkey)
);

First 3 rows:
  rak_id    yr    rnum    trkbind  event_schedule
--------  ----  ------  ---------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
       2  2009       2          2  {'date_set': '2009/04/05', 'sessions': {'fp1': {'date': None, 'time': None}, 'fp2': {'date': None, 'time': None}, 'fp3': {'date': None, 'time': None}, 'sprint': {'date': None, 'time': None}, 'qualifying': {'date': None, 'time': None}}, 'event_name': None, 'start_time': '09:00:00', 'details_url': None}
       3  2009       3         17  {'date_set': '2009/04/19', 'sessions': {'fp1': {'date': None, 'time': None}, 'fp2': {'date': None, 'time': None}, 'fp3': {'date': None, 'time': None}, 'sprint': {'date': None, 'time': None}, 'qualifying': {'date': None, 'time': None}}, 'event_name': 'Chinese Grand Prix', 'start_time': None, 'details_url': 'http://en.wikipedia.org/wiki/2009_Chinese_Grand_Prix'}
       4  2009       4          3  {'date_set': '2009/04/26', 'sessions': {'fp1': {'date': None, 'time': None}, 'fp2': {'date': None, 'time': None}, 'fp3': {'date': None, 'time': None}, 'sprint': {'date': None, 'time': None}, 'qualifying': {'date': None, 'time': None}}, 'event_name': 'Bahrain Grand Prix', 'start_time': '12:00:00', 'details_url': None}
...


CREATE TABLE "constructor_results" (
cresref integer NOT NULL,
matchref integer NULL,
unitnode integer NULL,
scoreval real NULL,
st_mark text NULL,
    PRIMARY KEY (cresref),
    FOREIGN KEY (matchref) REFERENCES races(rak_id),
    FOREIGN KEY (unitnode) REFERENCES constructors(cstr_key)
);

First 3 rows:
  cresref    matchref    unitnode    scoreval  st_mark
---------  ----------  ----------  ----------  ---------
    15178         943           9          22
    13224         549          64           0
    14394         863          10           8
...


CREATE TABLE "constructors" (
cstr_key integer NOT NULL,
refcod text NULL,
namelabel text NULL,
naty text NULL,
linkpage text NULL,
    PRIMARY KEY (cstr_key)
);

First 3 rows:
  cstr_key  refcod      namelabel    naty     linkpage
----------  ----------  -----------  -------  ---------------------------------------
         1  mclaren     McLaren      British
         2  bmw_sauber  BMW Sauber            http://en.wikipedia.org/wiki/BMW_Sauber
         3  williams    Williams
...


CREATE TABLE "constructor_standings" (
cstnds integer NOT NULL,
rref integer NULL,
contunit integer NULL,
scr_tot real NULL,
posno integer NULL,
poslab text NULL,
trophy_w integer NULL,
    PRIMARY KEY (cstnds),
    FOREIGN KEY (rref) REFERENCES races(rak_id),
    FOREIGN KEY (contunit) REFERENCES constructors(cstr_key)
);

First 3 rows:
  cstnds    rref    contunit    scr_tot    posno    poslab    trophy_w
--------  ------  ----------  ---------  -------  --------  ----------
   25335     898           9        553        1         1          12
   10478     451          53         16        7         7           0
    8849     359          42          0       18        18           0
...


CREATE TABLE "driver_standings" (
drv_stnd integer NOT NULL,
rlink integer NULL,
drive_link integer NULL,
acc_pt real NULL,
px integer NULL,
px_desc text NULL,
topmark integer NULL,
    PRIMARY KEY (drv_stnd),
    FOREIGN KEY (rlink) REFERENCES races(rak_id),
    FOREIGN KEY (drive_link) REFERENCES drivers(drv_main)
);

First 3 rows:
  drv_stnd    rlink    drive_link    acc_pt    px    px_desc    topmark
----------  -------  ------------  --------  ----  ---------  ---------
     50065      752           531       nan    56         56          0
     54588      651           362         0   nan                     0
     16188      329            92       nan    36                     0
...


CREATE TABLE "lap_times" (
rc_index integer NOT NULL,
wheel_unit integer NOT NULL,
lapval integer NOT NULL,
pp integer NULL,
tmdesc text NULL,
msec_val integer NULL,
    PRIMARY KEY (rc_index, wheel_unit, lapval),
    FOREIGN KEY (rc_index) REFERENCES races(rak_id),
    FOREIGN KEY (wheel_unit) REFERENCES drivers(drv_main)
);

First 3 rows:
  rc_index    wheel_unit    lapval    pp  tmdesc      msec_val
----------  ------------  --------  ----  --------  ----------
      1093             4        55     7  1:43.848      103848
        64             2         7    19  1:21.522       81522
       928           830        51     8  1:44.392      104392
...


CREATE TABLE "pit_stops" (
matchidx integer NOT NULL,
wunit integer NOT NULL,
pause_no integer NOT NULL,
moment integer NULL,
attime text NULL,
durtxt text NULL,
ms_count integer NULL,
    PRIMARY KEY (matchidx, wunit, pause_no),
    FOREIGN KEY (matchidx) REFERENCES races(rak_id),
    FOREIGN KEY (wunit) REFERENCES drivers(drv_main)
);

First 3 rows:
  matchidx    wunit    pause_no    moment  attime      durtxt    ms_count
----------  -------  ----------  --------  --------  --------  ----------
       911        3           2        19  14:41:14    22.936       22936
      1084      840           2        48  16:01:18    21.952       21952
      1081      844           1         9  15:20:26    23.212       23212
...


CREATE TABLE "qualifying" (
qualkey integer NOT NULL,
rbind integer NULL,
pilotrec integer NULL,
corptag integer NULL,
regno integer NULL,
px_pos integer NULL,
q1_r text NULL,
q2_r text NULL,
q3_r text NULL,
    PRIMARY KEY (qualkey),
    FOREIGN KEY (rbind) REFERENCES races(rak_id),
    FOREIGN KEY (pilotrec) REFERENCES drivers(drv_main),
    FOREIGN KEY (corptag) REFERENCES constructors(cstr_key)
);

First 3 rows:
  qualkey    rbind    pilotrec    corptag    regno    px_pos  q1_r      q2_r      q3_r
---------  -------  ----------  ---------  -------  --------  --------  --------  --------
     6815      954           1        131       44         1  1:14.121  1:13.076  1:12.812
     8587     1041         832          1       55        10  1:27.378  1:26.361  1:26.709
     6452      933         831         15       12         9  1:12.001  1:09.652  1:09.713
...


CREATE TABLE "sprint_results" (
srescode integer NOT NULL,
matchref integer NULL,
unitdrive integer NULL,
makeref integer NULL,
rno integer NULL,
sprint_performance jsonb NULL,
    PRIMARY KEY (srescode),
    FOREIGN KEY (matchref) REFERENCES races(rak_id),
    FOREIGN KEY (unitdrive) REFERENCES drivers(drv_main),
    FOREIGN KEY (makeref) REFERENCES constructors(cstr_key)
);

First 3 rows:
  srescode    matchref    unitdrive    makeref    rno  sprint_performance
----------  ----------  -----------  ---------  -----  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         5        1061          846          1      4  {'grid': 6, 'points': 0, 'timing': {'final_time': '+24.111', 'duration_ms': 1562537}, 'fastest_lap': {'lap_time': '1:30.566', 'lap_number': 16}, 'status_code': 1, 'ranking_order': 5, 'final_position': 5, 'laps_completed': 17, 'position_label': '5'}
         6        1061          817          1      3  {'grid': 7, 'points': 0, 'timing': {'final_time': '+30.959', 'duration_ms': 1569385}, 'fastest_lap': {'lap_time': '1:30.640', 'lap_number': 17}, 'status_code': 1, 'ranking_order': 6, 'final_position': 6, 'laps_completed': 17, 'position_label': '6'}
         7        1061            4        214     14  {'grid': 11, 'points': 0, 'timing': {'final_time': '+43.527', 'duration_ms': 1581953}, 'fastest_lap': {'lap_time': '1:31.773', 'lap_number': 17}, 'status_code': 1, 'ranking_order': 7, 'final_position': 7, 'laps_completed': 17, 'position_label': '7'}
...
