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

Question: How many grids have less than 41 laps and a Driver of pedro de la rosa?
SQL: SELECT COUNT("grid") FROM "race" WHERE "laps"<41 AND "driver"='pedro de la rosa';

Question: Which Time/Retired has a Grid smaller than 3, and a Driver of mika häkkinen?
SQL: SELECT "time_retired" FROM "race" WHERE "grid"<3 AND "driver"='mika häkkinen';

Question: What are toranosuke takagi's average laps?
SQL: SELECT AVG("laps") FROM "race" WHERE "driver"='toranosuke takagi';

Question: Which grid has a Time/Retired of +5.004?
SQL: SELECT MIN("grid") FROM "race" WHERE "time_retired"='+5.004';