From 5ad0561758d295150ae621ba3187d8a99cc8f8bf Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 4 Nov 2014 11:42:21 +0100 Subject: * grid/qualy consistency check SQL --- doc/sql.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/sql.txt b/doc/sql.txt index 32e7fa3..4d54f70 100644 --- a/doc/sql.txt +++ b/doc/sql.txt @@ -63,3 +63,7 @@ SELECT YEAR(rank_date), FROM rankings GROUP BY YEAR(rank_date) ORDER BY YEAR(rank_date) ASC; + + - qualifying/grid sanity check + +SELECT drivers.number, drivers.forename, drivers.surname, races.year, races.name, qualifying.number, qualifying.position, qualifying.q1, qualifying.q2, qualifying.q3, results.grid, results.number FROM qualifying INNER JOIN results ON (qualifying.driverID = results.driverId) AND (qualifying.raceId = results.raceId) JOIN drivers ON drivers.driverId = results.driverId JOIN races ON results.raceId = races.raceId WHERE qualifying.position <> results.grid ORDER BY races.date ASC -- cgit v1.2.3