CREATE TABLE "locomotives" (
  "name" text,
  "builder" text,
  "type" text,
  "date" real,
  "works_number" real
);

Question: What is the total works number of the locomotive with 0-6-4t type after 1875?
SQL: SELECT SUM("works_number") FROM "locomotives" WHERE "type"='0-6-4t' AND "date">1875;

Question: What is the total work number of Gowrie after 1875?
SQL: SELECT SUM("works_number") FROM "locomotives" WHERE "date">1875 AND "name"='gowrie';

Question: What is the average work number of Snowdon Ranger with the builder Vulcan Foundry?
SQL: SELECT AVG("works_number") FROM "locomotives" WHERE "builder"='vulcan foundry' AND "name"='snowdon ranger';

Question: What is the total work number of Gowrie with a 0-6-4t type after 1908?
SQL: SELECT COUNT("works_number") FROM "locomotives" WHERE "type"='0-6-4t' AND "name"='gowrie' AND "date">1908;