CREATE TABLE circuits
(
    circuitId  INTEGER
        primary key autoincrement,
    circuitRef TEXT default '' not null,
    name       TEXT default '' not null,
    location   TEXT,
    country    TEXT,
    lat        REAL,
    lng        REAL,
    alt        INTEGER,
    url        TEXT default '' not null
        unique
);
circuits
CREATE TABLE constructors
(
    constructorId  INTEGER
        primary key autoincrement,
    constructorRef TEXT default '' not null,
    name           TEXT default '' not null
        unique,
    nationality    TEXT,
    url            TEXT default '' not null
);
constructors
CREATE TABLE drivers
(
    driverId    INTEGER
        primary key autoincrement,
    driverRef   TEXT default '' not null,
    number      INTEGER,
    code        TEXT,
    forename    TEXT default '' not null,
    surname     TEXT default '' not null,
    dob         DATE,
    nationality TEXT,
    url         TEXT default '' not null
        unique
);
drivers
CREATE TABLE seasons
(
    year INTEGER default 0  not null
        primary key,
    url  TEXT    default '' not null
        unique
);
seasons
CREATE TABLE races
(
    raceId    INTEGER
        primary key autoincrement,
    year      INTEGER default 0            not null,
    round     INTEGER default 0            not null,
    circuitId INTEGER default 0            not null,
    name      TEXT    default ''           not null,
    date      DATE    default '0000-00-00' not null,
    time      TEXT,
    url       TEXT unique,
    foreign key (year) references seasons(year),
    foreign key (circuitId) references circuits(circuitId)
);
races
CREATE TABLE constructorResults
(
    constructorResultsId INTEGER
        primary key autoincrement,
    raceId               INTEGER default 0 not null,
    constructorId        INTEGER default 0 not null,
    points               REAL,
    status               TEXT,
    foreign key (raceId) references races(raceId),
    foreign key (constructorId) references constructors(constructorId)

);
constructorResults
CREATE TABLE constructorStandings
(
    constructorStandingsId INTEGER
        primary key autoincrement,
    raceId                 INTEGER default 0 not null,
    constructorId          INTEGER default 0 not null,
    points                 REAL   default 0 not null,
    position               INTEGER,
    positionText           TEXT,
    wins                   INTEGER default 0 not null,
    foreign key (raceId) references races(raceId),
    foreign key (constructorId) references constructors(constructorId)
);
constructorStandings
CREATE TABLE driverStandings
(
    driverStandingsId INTEGER
        primary key autoincrement,
    raceId            INTEGER default 0 not null,
    driverId          INTEGER default 0 not null,
    points            REAL   default 0 not null,
    position          INTEGER,
    positionText      TEXT,
    wins              INTEGER default 0 not null,
    foreign key (raceId) references races(raceId),
    foreign key (driverId) references drivers(driverId)
);
driverStandings
CREATE TABLE lapTimes
(
    raceId       INTEGER not null,
    driverId     INTEGER not null,
    lap          INTEGER not null,
    position     INTEGER,
    time         TEXT,
    milliseconds INTEGER,
    primary key (raceId, driverId, lap),
    foreign key (raceId) references races(raceId),
    foreign key (driverId) references drivers(driverId)
);
lapTimes
CREATE TABLE pitStops
(
    raceId       INTEGER not null,
    driverId     INTEGER not null,
    stop         INTEGER not null,
    lap          INTEGER not null,
    time         TEXT    not null,
    duration     TEXT,
    milliseconds INTEGER,
    primary key (raceId, driverId, stop),
    foreign key (raceId) references races(raceId),
    foreign key (driverId) references drivers(driverId)
);
pitStops
CREATE TABLE qualifying
(
    qualifyId     INTEGER
        primary key autoincrement,
    raceId        INTEGER default 0 not null,
    driverId      INTEGER default 0 not null,
    constructorId INTEGER default 0 not null,
    number        INTEGER default 0 not null,
    position      INTEGER,
    q1            TEXT,
    q2            TEXT,
    q3            TEXT,
    foreign key (raceId) references races(raceId),
    foreign key (driverId) references drivers(driverId),
    foreign key (constructorId) references constructors(constructorId)
);
qualifying
CREATE TABLE status
(
    statusId INTEGER
        primary key autoincrement,
    status   TEXT default '' not null
);
status
CREATE TABLE results
(
    resultId        INTEGER
        primary key autoincrement,
    raceId          INTEGER default 0  not null,
    driverId        INTEGER default 0  not null,
    constructorId   INTEGER default 0  not null,
    number          INTEGER,
    grid            INTEGER default 0  not null,
    position        INTEGER,
    positionText    TEXT    default '' not null,
    positionOrder   INTEGER default 0  not null,
    points          REAL   default 0  not null,
    laps            INTEGER default 0  not null,
    time            TEXT,
    milliseconds    INTEGER,
    fastestLap      INTEGER,
    rank            INTEGER default 0,
    fastestLapTime  TEXT,
    fastestLapSpeed TEXT,
    statusId        INTEGER default 0  not null,
    foreign key (raceId) references races(raceId),
    foreign key (driverId) references drivers(driverId),
    foreign key (constructorId) references constructors(constructorId),
    foreign key (statusId) references status(statusId)
);
results
original_column_name,column_name,column_description,data_format,value_description
constructorId ,constructor Id ,the unique identification number identifying constructors ,integer ,
constructorRef ,Constructor Reference name ,Constructor Reference name ,text,
name ,,full name of the constructor ,text,
nationality ,,nationality of the constructor ,text,
url ,,the introduction website of the constructor ,text,"commonsense evidence: 
How to find out the detailed introduction of the constructor: through its url"
wins ,,wins ,integer ,
constructors
original_column_name,column_name,column_description,data_format,value_description
circuitId,circuit Id ,unique identification number of the circuit ,integer ,
circuitRef,circuit reference name ,circuit reference name ,text,
name ,,full name of circuit ,text,
location  ,,location of circuit ,text,
country ,,country of circuit ,text,
lat ,latitude  ,latitude of location of circuit ,real,
lng ,longitude  ,longitude of location of circuit ,real,"commonsense evidence: 
Location coordinates: (lat, lng)"
alt ,,,integer ,not useful 
url ,,url ,text,
circuits
original_column_name,column_name,column_description,data_format,value_description
resultId,Result ID ,the unique identification number identifying race result ,integer,
raceId,race ID ,the identification number identifying the race ,integer ,
driverId ,driver ID,the identification number identifying the driver ,integer ,
constructorId ,constructor Id ,the identification number identifying which constructors ,integer ,
number ,,number  ,integer ,
grid ,,the number identifying the area where cars are set into a grid formation in order to start the race. ,integer ,
position ,,The finishing position or track of circuits ,integer ,
positionText ,position text ,,text,not quite useful 
positionOrder ,position order ,the finishing order of positions ,integer ,
points ,,points ,real,
laps ,,lap number ,integer ,
time  ,,finish time ,text,"commonsense evidence: 
1. if the value exists, it means the driver finished the race. 
2. Only the time of the champion shows in the format of ""minutes: seconds.millionsecond"", the time of the other drivers shows as ""seconds.millionsecond"" , which means their actual time is the time of the champion adding the value in this cell."
milliseconds ,,the actual finishing time of drivers in milliseconds  ,integer ,the actual finishing time of drivers  
fastestLap ,fastest lap ,fastest lap number ,integer ,
rank ,,starting rank positioned by fastest lap speed,integer ,
fastestLapTime ,fastest Lap Time,fastest Lap Time,text,"faster (smaller in the value) ""fastestLapTime"" leads to higher rank (smaller is higher rank) "
fastestLapSpeed ,fastest Lap Speed ,fastest Lap Speed ,text, (km / h) 
statusId ,status Id ,status ID ,integer,its category description appear in the table status
results
original_column_name,column_name,column_description,data_format,value_description
raceId ,race ID ,the identification number identifying race ,integer ,
driverId ,driver ID ,the identification number identifying each driver ,integer ,
stop ,,stop number ,integer ,
lap ,,lap number ,integer ,
time ,,time ,text,exact time  
duration ,,duration time ,text,seconds/ 
milliseconds ,,milliseconds ,integer ,
pitStops
original_column_name,column_name,column_description,data_format,value_description
driverStandingsId ,driver Standings Id ,the unique identification number identifying driver standing records ,integer,
raceId ,constructor Reference name ,id number identifying which races ,integer,
driverId ,,id number identifying which drivers ,integer,
points ,,how many points acquired in each race ,real,
position ,,position or track of circuits ,integer,
positionText ,position text ,,text,"same with position, not quite useful "
wins ,,wins ,integer,
driverStandings
original_column_name,column_name,column_description,data_format,value_description
statusId ,status ID,the unique identification number identifying status,integer,
status ,,full name of status ,text,
status
original_column_name,column_name,column_description,data_format,value_description
year ,race ID ,the unique identification number identifying the race,integer,
url ,,website link of season race introduction ,text,
seasons
original_column_name,column_name,column_description,data_format,value_description
qualifyId ,qualify Id ,the unique identification number identifying qualifying ,integer ,"How does F1 Sprint qualifying work? Sprint qualifying is essentially a short-form Grand Prix – a race that is one-third the number of laps of the main event on Sunday. However, the drivers are battling for positions on the grid for the start of Sunday's race. "
raceId ,race Id ,the identification number identifying each race ,integer ,
driverId ,driver Id,the identification number identifying each driver ,integer ,
constructorId ,constructor id ,constructor Id ,integer ,
number ,,number ,integer ,
position ,,position or track of circuit ,integer ,
q1 ,qualifying 1 ,time in qualifying 1 ,text,"in minutes / seconds / ... 
commonsense evidence: 
Q1 lap times determine pole position and the order of the front 10 positions on the grid. The slowest driver in Q1 starts 10th, the next starts ninth and so on. 
All 20 F1 drivers participate in the first period, called Q1, with each trying to set the fastest time possible. Those in the top 15 move on to the next period of qualifying, called Q2. The five slowest drivers are eliminated and will start the race in the last five positions on the grid. "
q2 ,qualifying 2 ,time in qualifying 2 ,text,"in minutes / seconds / ... 
commonsense evidence: 
only top 15 in the q1 has the record of q2 
Q2 is slightly shorter but follows the same format. Drivers try to put down their best times to move on to Q1 as one of the 10 fastest cars. The five outside of the top 10 are eliminated and start the race from 11th to 15th based on their best lap time. "
q3 ,qualifying 3 ,time in qualifying 3 ,text,"in minutes / seconds / ... 
commonsense evidence: 
only top 10 in the q2 has the record of q3 "
qualifying
original_column_name,column_name,column_description,data_format,value_description
constructorStandingsId ,constructor Standings Id ,unique identification of the constructor standing records ,integer ,
raceId ,race id ,id number identifying which races ,integer ,
constructorId ,constructor id ,id number identifying which id ,integer ,
points,,how many points acquired in each race ,,
position ,,position or track of circuits ,integer ,
positionText ,position text ,,text,"same with position, not quite useful "
wins ,,wins ,integer ,
constructorStandings
original_column_name,column_name,column_description,data_format,value_description
raceId ,race ID ,the identification number identifying race,integer ,
driverId ,driver ID ,the identification number identifying each driver ,integer ,
lap ,,lap number ,integer ,
position ,,position or track of circuits  ,integer ,
time ,,lap time  ,text,in minutes / seconds / ... 
milliseconds ,,milliseconds ,integer ,
lapTimes
original_column_name,column_name,column_description,data_format,value_description
raceId ,race ID ,the unique identification number identifying the race ,integer ,
year ,,year ,integer ,
round ,,round ,integer ,
circuitId ,Circuit Id ,circuit Id ,integer ,
name ,,name of the race ,text,
date ,,duration time ,date,
time ,,time of the location ,text,
url ,,introduction of races ,text,
races
original_column_name,column_name,column_description,data_format,value_description
driverId ,driver ID ,the unique identification number identifying each driver,integer,
driverRef ,driver reference name ,driver reference name ,text,
number ,,number ,integer,
code ,,abbreviated code for drivers ,text,"if ""null"" or empty, it means it doesn't have code "
forename ,,forename ,text,
surname ,,surname ,text,
dob ,date of birth ,date of birth ,date,
nationality ,,nationality of drivers ,text,
url ,,the introduction website of the drivers ,text,
drivers
original_column_name,column_name,column_description,data_format,value_description
constructorResultsId,constructor Results Id,constructor Results Id,integer,
raceId,race Id,race id,integer,
constructorId,constructor Id,constructor id,integer,
points,,points,real,
status,,status,text,
constructorResults