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

Question: How many laps for grid of 9?
SQL: SELECT "laps" FROM "race" WHERE "grid"=9;

Question: What is the high lap total for a grid less than 6, and a Time/Retired of halfshaft?
SQL: SELECT MAX("laps") FROM "race" WHERE "grid"<6 AND "time_retired"='halfshaft';