CREATE TABLE "moto_gp_classification" (
  "rider" text,
  "manufacturer" text,
  "laps" real,
  "time_retired" text,
  "grid" real
);

Question: What is the average grid with a number of laps smaller than 8?
SQL: SELECT AVG("grid") FROM "moto_gp_classification" WHERE "laps"<8;

Question: What is the lowest grid with rider casey stoner and laps that are smaller than 27?
SQL: SELECT MIN("grid") FROM "moto_gp_classification" WHERE "rider"='casey stoner' AND "laps"<27;

Question: What is the total grid number with laps that are larger than 27?
SQL: SELECT COUNT("grid") FROM "moto_gp_classification" WHERE "laps">27;

Question: What is the lowest number of laps with a time/retired of +38.426?
SQL: SELECT MIN("laps") FROM "moto_gp_classification" WHERE "time_retired"='+38.426';

Question: What is the sum of laps that has a time/retired that is +19.475?
SQL: SELECT SUM("laps") FROM "moto_gp_classification" WHERE "time_retired"='+19.475';