-
Notifications
You must be signed in to change notification settings - Fork 2
/
formula1_ergast_data_user_guide.txt
200 lines (185 loc) · 17.8 KB
/
formula1_ergast_data_user_guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
+----------------------------+
| Ergast Database User Guide |
+----------------------------+
| Version: 1.0 |
| Date: 31 January 2021 |
| Author: Chris Newell |
+----------------------------+
+----------------------+ +------------------------------------------------------------------+
| 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 |
+-----------+--------------+------+-----+------------+----------------+------------------------------------+
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 |
+-----------------+--------------+------+-----+---------+----------------+---------------------------------------------+
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" |
+----------+--------------+------+-----+---------+----------------+---------------------------------+
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
To view a copy of this license, visit: http://creativecommons.org/licenses/by-nc-sa/3.0/