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

Question: What is the mean number of laps where Time/retired was a water leak and the grid number was bigger than 12?
SQL: SELECT AVG("laps") FROM "race" WHERE "time_retired"='water leak' AND "grid">12;

Question: What is the mean number of laps when time/retired was spun off and the driver was Nick Heidfeld?
SQL: SELECT AVG("laps") FROM "race" WHERE "time_retired"='spun off' AND "driver"='nick heidfeld';

Question: What is the sum grid number when the driver was Luciano Burti?
SQL: SELECT COUNT("grid") FROM "race" WHERE "driver"='luciano burti';

Question: Which constructor had a laps number bigger than 3 when the driver was Jarno Trulli?
SQL: SELECT "constructor" FROM "race" WHERE "laps">3 AND "driver"='jarno trulli';