Which Laps have a Time/Retired of + 4 laps, and a Grid larger than 18?
CREATE TABLE "race" (
  "driver" text,
  "team" text,
  "laps" real,
  "time_retired" text,
  "grid" real,
  "points" real
);
SELECT AVG("laps") FROM "race" WHERE "time_retired"='+ 4 laps' AND "grid">18;