How many laps had a grid of greater than 17 and retired due to collision?
CREATE TABLE "classification" (
  "driver" text,
  "constructor" text,
  "laps" real,
  "time_retired" text,
  "grid" real
);
SELECT SUM("laps") FROM "classification" WHERE "grid">17 AND "time_retired"='collision';