CREATE TABLE "presidents_who_won_the_election" (
  "name" text,
  "election_year" real,
  "party" text,
  "birth_state" text,
  "resident_state" text
);

Question: What state was the president who was elected earlier than 1848 born in?
SQL: SELECT "birth_state" FROM "presidents_who_won_the_election" WHERE "election_year"<1848;

Question: What is the resident state for the president elected in 1864?
SQL: SELECT "resident_state" FROM "presidents_who_won_the_election" WHERE "election_year"=1864;

Question: What is the election year of the president with a Birth State of lost connecticut?
SQL: SELECT AVG("election_year") FROM "presidents_who_won_the_election" WHERE "birth_state"='lost connecticut';