CREATE TABLE "senate" (
  "senator" text,
  "party" text,
  "district" real,
  "home_town" text,
  "took_office" real
);

Question: Which Home Town has a Took Office of 1983, and a District larger than 15?
SQL: SELECT "home_town" FROM "senate" WHERE "took_office"=1983 AND "district">15;

Question: Which Senator has a Party of republican, a Home Town of houston, and a District of 7?
SQL: SELECT "senator" FROM "senate" WHERE "party"='republican' AND "home_town"='houston' AND "district"=7;

Question: Which Home Town has a Senator of dan shelley?
SQL: SELECT "home_town" FROM "senate" WHERE "senator"='dan shelley';

Question: Which Took Office has a Party of democratic, a Home Town of victoria, and a District smaller than 18?
SQL: SELECT COUNT("took_office") FROM "senate" WHERE "party"='democratic' AND "home_town"='victoria' AND "district"<18;

Question: Which Took Office has a District of 29?
SQL: SELECT AVG("took_office") FROM "senate" WHERE "district"=29;