CREATE TABLE "classification" (
  "driver" text,
  "constructor" text,
  "laps" real,
  "time_retired" text,
  "grid" real
);

Question: I want the total number of Laps for time/retired for + 4 Laps and grid more than 20
SQL: SELECT COUNT("laps") FROM "classification" WHERE "time_retired"='+ 4 laps' AND "grid">20;

Question: I want the average Laps for grid of 9
SQL: SELECT AVG("laps") FROM "classification" WHERE "grid"=9;