If you identify any API bugs or errors in the data please record them here.
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.
The standings errors have been corrected. I’ll work through the 83 results to find out what the problem is in a few days.
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.
Thanks Emkael – hard to imagine all that car hopping these days!
Will you update the database image with latest races and drivers? 2017 races are not in the races table yet….
Done – watch out for updates though, as new drivers are announced etc.
Mail (will not be published) (required)
Notify me of follow-up comments by email.
Notify me of new posts by email.
and Comments (RSS)