summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-11-04 11:42:21 +0100
committeremkael <emkael@tlen.pl>2014-11-04 11:42:21 +0100
commit5ad0561758d295150ae621ba3187d8a99cc8f8bf (patch)
tree8c78a2c1eca8a47518a7ea7d18b5908730e97e75 /doc
parent1649776a7ddf4b9483adc039aa16f114b2dbb273 (diff)
* grid/qualy consistency check SQL
Diffstat (limited to 'doc')
-rw-r--r--doc/sql.txt4
1 files changed, 4 insertions, 0 deletions
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