f1db User Guide
f1db User Guide
+----------------------+
+------------------------------------------------------------------+
| List of Tables | | General Notes
|
+----------------------+
+------------------------------------------------------------------|
| circuits | | Dates, times and durations are in ISO 8601
format |
| constructorResults | | Dates and times are UTC
|
| constructorStandings | | Strings use UTF-8 encoding
|
| constructors | | Primary keys are for internal use only
|
| driverStandings | | Fields ending with "Ref" are unique identifiers
for external use |
| drivers | | A grid position of '0' is used for starting
from the pitlane |
| lapTimes | | Labels used in the positionText fields:
|
| pitStops | | "D" - disqualified
|
| qualifying | | "E" - excluded
|
| races | | "F" - failed to qualify
|
| results | | "N" - not classified
|
| seasons | | "R" - retired
|
| status | | "W" - withdrew
|
+----------------------+
+------------------------------------------------------------------+
circuits table
+------------+--------------+------+-----+---------+----------------
+---------------------------+
| Field | Type | Null | Key | Default | Extra | Description
|
+------------+--------------+------+-----+---------+----------------
+---------------------------+
| circuitId | int(11) | NO | PRI | NULL | auto_increment | Primary key
|
| circuitRef | varchar(255) | NO | | | | Unique
circuit identifier |
| name | varchar(255) | NO | | | | Circuit name
|
| location | varchar(255) | YES | | NULL | | Location name
|
| country | varchar(255) | YES | | NULL | | Country name
|
| lat | float | YES | | NULL | | Latitude
|
| lng | float | YES | | NULL | | Longitude
|
| alt | int(11) | YES | | NULL | | Altitude
(metres) |
| url | varchar(255) | NO | UNI | | | Circuit
Wikipedia page |
+------------+--------------+------+-----+---------+----------------
+---------------------------+
constructor_results table
+----------------------+--------------+------+-----+---------+----------------
+----------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+----------------------+--------------+------+-----+---------+----------------
+----------------------------------------+
| constructorResultsId | int(11) | NO | PRI | NULL | auto_increment |
Primary key |
| raceId | int(11) | NO | | 0 | |
Foreign key link to races table |
| constructorId | int(11) | NO | | 0 | |
Foreign key link to constructors table |
| points | float | YES | | NULL | |
Constructor points for race |
| status | varchar(255) | YES | | NULL | | "D"
for disqualified (or null) |
+----------------------+--------------+------+-----+---------+----------------
+----------------------------------------+
constructor_standings table
+------------------------+--------------+------+-----+---------+----------------
+------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+------------------------+--------------+------+-----+---------+----------------
+------------------------------------------+
| constructorStandingsId | int(11) | NO | PRI | NULL | auto_increment |
Primary key |
| raceId | int(11) | NO | | 0 | |
Foreign key link to races table |
| constructorId | int(11) | NO | | 0 | |
Foreign key link to constructors table |
| points | float | NO | | 0 | |
Constructor points for season |
| position | int(11) | YES | | NULL | |
Constructor standings position (integer) |
| positionText | varchar(255) | YES | | NULL | |
Constructor standings position (string) |
| wins | int(11) | NO | | 0 | |
Season win count |
+------------------------+--------------+------+-----+---------+----------------
+------------------------------------------+
constructors table
+----------------+--------------+------+-----+---------+----------------
+-------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+----------------+--------------+------+-----+---------+----------------
+-------------------------------+
| constructorId | int(11) | NO | PRI | NULL | auto_increment | Primary
key |
| constructorRef | varchar(255) | NO | | | | Unique
constructor identifier |
| name | varchar(255) | NO | UNI | | |
Constructor name |
| nationality | varchar(255) | YES | | NULL | |
Constructor nationality |
| url | varchar(255) | NO | | | |
Constructor Wikipedia page |
+----------------+--------------+------+-----+---------+----------------
+-------------------------------+
driver_standings table
+-------------------+--------------+------+-----+---------+----------------
+-------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+-------------------+--------------+------+-----+---------+----------------
+-------------------------------------+
| driverStandingsId | int(11) | NO | PRI | NULL | auto_increment |
Primary key |
| raceId | int(11) | NO | | 0 | |
Foreign key link to races table |
| driverId | int(11) | NO | | 0 | |
Foreign key link to drivers table |
| points | float | NO | | 0 | | Driver
points for season |
| position | int(11) | YES | | NULL | | Driver
standings position (integer) |
| positionText | varchar(255) | YES | | NULL | | Driver
standings position (string) |
| wins | int(11) | NO | | 0 | | Season
win count |
+-------------------+--------------+------+-----+---------+----------------
+-------------------------------------+
drivers table
+-------------+--------------+------+-----+---------+----------------
+--------------------------+
| Field | Type | Null | Key | Default | Extra | Description
|
+-------------+--------------+------+-----+---------+----------------
+--------------------------+
| driverId | int(11) | NO | PRI | NULL | auto_increment | Primary key
|
| driverRef | varchar(255) | NO | | | | Unique
driver identifier |
| number | int(11) | YES | | NULL | | Permanent
driver number |
| code | varchar(3) | YES | | NULL | | Driver code
e.g. "ALO" |
| forename | varchar(255) | NO | | | | Driver
forename |
| surname | varchar(255) | NO | | | | Driver
surname |
| dob | date | YES | | NULL | | Driver date
of birth |
| nationality | varchar(255) | YES | | NULL | | Driver
nationality |
| url | varchar(255) | NO | UNI | | | Driver
Wikipedia page |
+-------------+--------------+------+-----+---------+----------------
+--------------------------+
lap_times table
+--------------+--------------+------+-----+---------+-------
+-----------------------------------+
| Field | Type | Null | Key | Default | Extra | Description
|
+--------------+--------------+------+-----+---------+-------
+-----------------------------------+
| raceId | int(11) | NO | PRI | NULL | | Foreign key link to
races table |
| driverId | int(11) | NO | PRI | NULL | | Foreign key link to
drivers table |
| lap | int(11) | NO | PRI | NULL | | Lap number
|
| position | int(11) | YES | | NULL | | Driver race position
|
| time | varchar(255) | YES | | NULL | | Lap time e.g.
"1:43.762" |
| milliseconds | int(11) | YES | | NULL | | Lap time in
milliseconds |
+--------------+--------------+------+-----+---------+-------
+-----------------------------------+
pit_stops table
+--------------+--------------+------+-----+---------+-------
+-----------------------------------+
| Field | Type | Null | Key | Default | Extra | Description
|
+--------------+--------------+------+-----+---------+-------
+-----------------------------------+
| raceId | int(11) | NO | PRI | NULL | | Foreign key link to
races table |
| driverId | int(11) | NO | PRI | NULL | | Foreign key link to
drivers table |
| stop | int(11) | NO | PRI | NULL | | Stop number
|
| lap | int(11) | NO | | NULL | | Lap number
|
| time | time | NO | | NULL | | Time of stop e.g.
"13:52:25" |
| duration | varchar(255) | YES | | NULL | | Duration of stop
e.g. "21.783" |
| milliseconds | int(11) | YES | | NULL | | Duration of stop in
milliseconds |
+--------------+--------------+------+-----+---------+-------
+-----------------------------------+
qualifying table
+---------------+--------------+------+-----+---------+----------------
+----------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+---------------+--------------+------+-----+---------+----------------
+----------------------------------------+
| qualifyId | int(11) | NO | PRI | NULL | auto_increment | Primary
key |
| raceId | int(11) | NO | | 0 | | Foreign
key link to races table |
| driverId | int(11) | NO | | 0 | | Foreign
key link to drivers table |
| constructorId | int(11) | NO | | 0 | | Foreign
key link to constructors table |
| number | int(11) | NO | | 0 | | Driver
number |
| position | int(11) | YES | | NULL | | Qualifying
position |
| q1 | varchar(255) | YES | | NULL | | Q1 lap
time e.g. "1:21.374" |
| q2 | varchar(255) | YES | | NULL | | Q2 lap
time |
| q3 | varchar(255) | YES | | NULL | | Q3 lap
time |
+---------------+--------------+------+-----+---------+----------------
+----------------------------------------+
races table
+-------------+--------------+------+-----+------------+----------------
+------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+-------------+--------------+------+-----+------------+----------------
+------------------------------------+
| raceId | int(11) | NO | PRI | NULL | auto_increment | Primary
key |
| year | int(11) | NO | | 0 | | Foreign
key link to seasons table |
| round | int(11) | NO | | 0 | | Round
number |
| circuitId | int(11) | NO | | 0 | | Foreign
key link to circuits table |
| name | varchar(255) | NO | | | | Race name
|
| date | date | NO | | 0000-00-00 | | Race date
e.g. "1950-05-13" |
| time | time | YES | | NULL | | Race
start time e.g."13:00:00" |
| url | varchar(255) | YES | UNI | NULL | | Race
Wikipedia page |
| fp1_date | date | YES | | NULL | | FP1 date
|
| fp1_time | time | YES | | NULL | | FP1 start
time |
| fp2_date | date | YES | | NULL | | FP2 date
|
| fp2_time | time | YES | | NULL | | FP2 start
time |
| fp3_date | date | YES | | NULL | | FP3 date
|
| fp3_time | time | YES | | NULL | | FP3 start
time |
| quali_date | date | YES | | NULL | |
Qualifying date |
| quali_time | time | YES | | NULL | |
Qualifying start time |
| sprint_date | date | YES | | NULL | | Sprint
date |
| sprint_time | time | YES | | NULL | | Sprint
start time |
+-------------+--------------+------+-----+------------+----------------
+------------------------------------+
results table
+-----------------+--------------+------+-----+---------+----------------
+---------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+-----------------+--------------+------+-----+---------+----------------
+---------------------------------------------+
| resultId | int(11) | NO | PRI | NULL | auto_increment | Primary
key |
| raceId | int(11) | NO | | 0 | | Foreign
key link to races table |
| driverId | int(11) | NO | | 0 | | Foreign
key link to drivers table |
| constructorId | int(11) | NO | | 0 | | Foreign
key link to constructors table |
| number | int(11) | YES | | NULL | | Driver
number |
| grid | int(11) | NO | | 0 | | Starting
grid position |
| position | int(11) | YES | | NULL | | Official
classification, if applicable |
| positionText | varchar(255) | NO | | | | Driver
position string e.g. "1" or "R" |
| positionOrder | int(11) | NO | | 0 | | Driver
position for ordering purposes |
| points | float | NO | | 0 | | Driver
points for race |
| laps | int(11) | NO | | 0 | | Number
of completed laps |
| time | varchar(255) | YES | | NULL | |
Finishing time or gap |
| milliseconds | int(11) | YES | | NULL | |
Finishing time in milliseconds |
| fastestLap | int(11) | YES | | NULL | | Lap
number of fastest lap |
| rank | int(11) | YES | | 0 | | Fastest
lap rank, compared to other drivers |
| fastestLapTime | varchar(255) | YES | | NULL | | Fastest
lap time e.g. "1:27.453" |
| fastestLapSpeed | varchar(255) | YES | | NULL | | Fastest
lap speed (km/h) e.g. "213.874" |
| statusId | int(11) | NO | | 0 | | Foreign
key link to status table |
+-----------------+--------------+------+-----+---------+----------------
+---------------------------------------------+
sprint_results table
+-----------------+--------------+------+-----+---------+----------------
+---------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
Description |
+-----------------+--------------+------+-----+---------+----------------
+---------------------------------------------+
| sprintResultId | int(11) | NO | PRI | NULL | auto_increment | Primary
key |
| raceId | int(11) | NO | | 0 | | Foreign
key link to races table |
| driverId | int(11) | NO | | 0 | | Foreign
key link to drivers table |
| constructorId | int(11) | NO | | 0 | | Foreign
key link to constructors table |
| number | int(11) | YES | | NULL | | Driver
number |
| grid | int(11) | NO | | 0 | | Starting
grid position |
| position | int(11) | YES | | NULL | | Official
classification, if applicable |
| positionText | varchar(255) | NO | | | | Driver
position string e.g. "1" or "R" |
| positionOrder | int(11) | NO | | 0 | | Driver
position for ordering purposes |
| points | float | NO | | 0 | | Driver
points for race |
| laps | int(11) | NO | | 0 | | Number
of completed laps |
| time | varchar(255) | YES | | NULL | |
Finishing time or gap |
| milliseconds | int(11) | YES | | NULL | |
Finishing time in milliseconds |
| fastestLap | int(11) | YES | | NULL | | Lap
number of fastest lap |
| fastestLapTime | varchar(255) | YES | | NULL | | Fastest
lap time e.g. "1:27.453" |
| statusId | int(11) | NO | | 0 | | Foreign
key link to status table |
+-----------------+--------------+------+-----+---------+----------------
+---------------------------------------------+
seasons table
+-------+--------------+------+-----+---------+-------+-----------------------+
| Field | Type | Null | Key | Default | Extra | Description |
+-------+--------------+------+-----+---------+-------+-----------------------+
| year | int(11) | NO | PRI | 0 | | Primary key e.g. 1950 |
| url | varchar(255) | NO | UNI | | | Season Wikipedia page |
+-------+--------------+------+-----+---------+-------+-----------------------+
status table
+----------+--------------+------+-----+---------+----------------
+---------------------------------+
| Field | Type | Null | Key | Default | Extra | Description
|
+----------+--------------+------+-----+---------+----------------
+---------------------------------+
| statusId | int(11) | NO | PRI | NULL | auto_increment | Primary key
|
| status | varchar(255) | NO | | | | Finishing
status e.g. "Retired" |
+----------+--------------+------+-----+---------+----------------
+---------------------------------+