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

Question: Which Works number has a Number larger than 807, and a Type of 0-6-0, and a Date of 1920?
SQL: SELECT AVG("works_number") FROM "locomotives" WHERE "number">807 AND "type"='0-6-0' AND "date"=1920;

Question: Which Type has a Date smaller than 1943, and a Builder of alco schenectady, and a Number larger than 822, and Works number of 59867?
SQL: SELECT "type" FROM "locomotives" WHERE "date"<1943 AND "builder"='alco schenectady' AND "number">822 AND "works_number"=59867;

Question: Which Date has a Builder of alco schenectady, and a Number larger than 835, and Works number of 56566?
SQL: SELECT AVG("date") FROM "locomotives" WHERE "builder"='alco schenectady' AND "number">835 AND "works_number"=56566;