On driverStandings table there are also some duplicate entries for driverId 128, on races 300, 301, 302, 303 and 304.
The constructorStandings and driverStandings duplicates can be removed by the following two queries:
delete from constructorstandings where constructorstandingsid = 24518;
delete from driverstandings where driverstandingsid in (7118, 7149, 7180, 7211, 7243);
Finally, on the results table, there are 83 occasions where the same driverId has 2 or more results for the same raceId. This would mean the same driver participated on the same race for different teams. Did those drivers actually switch teams mid-race?
These entries can be found with this query:
select driverid, raceid, count(1) c from results group by driverid, raceid having c > 1;
“Finally, on the results table, there are 83 occasions where the same driverId has 2 or more results for the same raceId. This would mean the same driver participated on the same race for different teams. Did those drivers actually switch teams mid-race?”
Not necessarily different “teams”, just different entries, your query does not group by teams (i.e. constructors).
And yes, shared drives and car switches have long history in F1.
Hi, Chris, I’ve just checked. Nothing’s the problem with these.
77 of these are just shared drives/car switches.
The remaining 6 are:
- two entries for Harald Ertl in the 1978 Italian GP (he DNPQ’d an Ensign and DNQ’d an ETS)
- two entries for Keith Greene in the 1962 British GP (he was initially entered in car 50, but that didn’t arrive, so he practised in car 48 and DNS’d)
- two entries for Ron Flockhart in the 1958 Monaco GP (he tried and failed to qualify a Cooper and a BRM)
It’s just that a unique constraint on (raceId, driverId) is an invalid assumption on Eneko’s behalf as there are genuine multiple entries for the same driver in some races.
Thank you looking into it, emkael. Agreed, a unique index constraint for the races table does not apply, my bad. I updated the gist with the indices last night to reflect that change. The other indices should work well.
For the 2017 Season I tried querying http://ergast.com/api/f1/2017/results?limit=1000 and noticed that the displayed number (#2) for Stoffel Vandoorne was coming out at (#47) in one of the columns.
After poking around i noticed that the “attribute:number” is correctly showing #2 for him but his “driver.permanentnumber” is set to #47
Also, the grid #s shown for Australia-2017 seem to be outdated.
Daniel Ricciardo shows up #15 after he received a 5-grid penalty but during the formation lap his called stalled and he was forced to start from PitLane moving everyone below him up one spot and having him start from PitLane (i.e. 20).
Thanks, now corrected. Note that drivers don’t move up the grid (the vacated space is left unoccupied) and that I use ‘0’ to indicate that a driver started from the pit lane.
Ricciardo’s case is an odd one - I can’t recall any precedent of a driver “retiring” into the pit lane on formation lap, but not retiring from the race entirely.
So far, it’s been either a grid drop into the pit lane (due to penalties) - the grid was moved up because that was the new correct grid order, and driver(s) starting from the pit lane were at the back of the grid.
Or, it’s been a DNS (with either grid position “0” or driver’s initial grid position) if a car didn’t make to the grid.
All in all, not sure how it should be handled.
Anyway, speaking of grid position bugs - 1989 Spanish GP, Eddie Cheever (resultId = 8388) has a grid position of 61 (number of laps he covered in that race) - should be 22 🙂
Hi there!
F1 driver standing shows wrong order here http://ergast.com/api/f1/2017/2/driverStandings
vettel and hamilton have same points, same wins. But vettel goes first because he win first.
Really like the API, helping me creating a hobby project. Noticed a small error in the circuit name for the Russin circuit. It no longer is called “Sochi International Street Circuit” but it is now called “Sochi Autodrom”.
On driverStandings table there are also some duplicate entries for driverId 128, on races 300, 301, 302, 303 and 304.
The constructorStandings and driverStandings duplicates can be removed by the following two queries:
delete from constructorstandings where constructorstandingsid = 24518;
delete from driverstandings where driverstandingsid in (7118, 7149, 7180, 7211, 7243);
Finally, on the results table, there are 83 occasions where the same driverId has 2 or more results for the same raceId. This would mean the same driver participated on the same race for different teams. Did those drivers actually switch teams mid-race?
These entries can be found with this query:
select driverid, raceid, count(1) c from results group by driverid, raceid having c > 1;
Thanks!
“Finally, on the results table, there are 83 occasions where the same driverId has 2 or more results for the same raceId. This would mean the same driver participated on the same race for different teams. Did those drivers actually switch teams mid-race?”
Not necessarily different “teams”, just different entries, your query does not group by teams (i.e. constructors).
And yes, shared drives and car switches have long history in F1.
Thanks Eneko,
The standings errors have been corrected. I’ll work through the 83 results to find out what the problem is in a few days.
Chris
Hi, Chris, I’ve just checked. Nothing’s the problem with these.
77 of these are just shared drives/car switches.
The remaining 6 are:
- two entries for Harald Ertl in the 1978 Italian GP (he DNPQ’d an Ensign and DNQ’d an ETS)
- two entries for Keith Greene in the 1962 British GP (he was initially entered in car 50, but that didn’t arrive, so he practised in car 48 and DNS’d)
- two entries for Ron Flockhart in the 1958 Monaco GP (he tried and failed to qualify a Cooper and a BRM)
It’s just that a unique constraint on (raceId, driverId) is an invalid assumption on Eneko’s behalf as there are genuine multiple entries for the same driver in some races.
Thank you looking into it, emkael. Agreed, a unique index constraint for the races table does not apply, my bad. I updated the gist with the indices last night to reflect that change. The other indices should work well.
Regards,
Eneko
Thanks Emkael - hard to imagine all that car hopping these days!
Hi Chris,
Will you update the database image with latest races and drivers? 2017 races are not in the races table yet….
Thanks
Alan
Hi Alan,
Done - watch out for updates though, as new drivers are announced etc.
qualifying row with id 409 has strange characters in the q1 column:
1:36.827â€
qualifying rows with raceid 64 are incorrectly formatted:
id 998 = 1:15:329
id 988 = 1:14:862
id 990 = 1:14:934
Further to my previous qualifying formatting issues there are some that have the following formatting:
id 1007 = 1.20.080
Thanks Rob - all now corrected.
Jean Alesi has grid position 41 on 1998 Australian Grand Prix (result id 3666). The correct grid position is 12. (https://en.wikipedia.org/wiki/1998_Australian_Grand_Prix#Race)
The ’98 Australian GP has incorrect grid position for Jarno Trulli, too. He qualified 15th, Wikipedia lists grid position of 11 (the same as Wurz’s).
For the 2017 Season I tried querying http://ergast.com/api/f1/2017/results?limit=1000 and noticed that the displayed number (#2) for Stoffel Vandoorne was coming out at (#47) in one of the columns.
After poking around i noticed that the “attribute:number” is correctly showing #2 for him but his “driver.permanentnumber” is set to #47
Can you please fix this?
Also, the grid #s shown for Australia-2017 seem to be outdated.
Daniel Ricciardo shows up #15 after he received a 5-grid penalty but during the formation lap his called stalled and he was forced to start from PitLane moving everyone below him up one spot and having him start from PitLane (i.e. 20).
https://en.wikipedia.org/wiki/2017_Australian_Grand_Prix#Race
Eneko, Emkael,
Thanks - now fixed.
Hi Jorge,
Thanks, now corrected. Note that drivers don’t move up the grid (the vacated space is left unoccupied) and that I use ‘0’ to indicate that a driver started from the pit lane.
Thanks for the fixes.
Ricciardo’s case is an odd one - I can’t recall any precedent of a driver “retiring” into the pit lane on formation lap, but not retiring from the race entirely.
So far, it’s been either a grid drop into the pit lane (due to penalties) - the grid was moved up because that was the new correct grid order, and driver(s) starting from the pit lane were at the back of the grid.
Or, it’s been a DNS (with either grid position “0” or driver’s initial grid position) if a car didn’t make to the grid.
All in all, not sure how it should be handled.
Anyway, speaking of grid position bugs - 1989 Spanish GP, Eddie Cheever (resultId = 8388) has a grid position of 61 (number of laps he covered in that race) - should be 22 🙂
Will there be an update for the whole VES/VER acronym debacle, resulting in reporting Verstappen as “VER” from 2017 onward?
He’s currently still turning up as “code=VES” in the Aussie GP results.
Hi, max verstappen is named VER in 2017 ( .. it was VES in 2016 2015 ..)
thanks Koen
sperry, koen,
Thanks for the heads-up. Verstappen is now VER but this can’t be time-dependent due to technical limitations.
Hi, ok, why not just change it to VER so that it is correct now in stead of being correct in the past ?
Hi koen,
That is what I’ve done.
Chris
oki thx
Thanks a ton, Chris. Not just for the VES->VER update, but for hosting and maintaining this whole API!
Hi there!
F1 driver standing shows wrong order here
http://ergast.com/api/f1/2017/2/driverStandings
vettel and hamilton have same points, same wins. But vettel goes first because he win first.
Thanks Basil - now corrected. Looks like there’s a bug.
Hi Chris,
Really like the API, helping me creating a hobby project. Noticed a small error in the circuit name for the Russin circuit. It no longer is called “Sochi International Street Circuit” but it is now called “Sochi Autodrom”.
Regards,
Mark
Hi Mark,
Thanks for the heads-up - now updated.
Chris