Table: james_k_polk
Columns: name
election_year
party
birth_state
resident_state

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

Question: What is the resident state for the president elected in 1864?
SQL: SELECT "resident_state" FROM james_k_polk 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 james_k_polk WHERE "birth_state" = 'lost connecticut'