Table: us_house_elections_2004
Columns: district
incumbent
party
elected
status

Question: What was the year elected in District 17?
SQL: SELECT MIN("elected") FROM us_house_elections_2004 WHERE "district" = 17

Question: What was the year elected in District 15?
SQL: SELECT "elected" FROM us_house_elections_2004 WHERE "district" = 15

Question: What year was Incumbent Ed Towns elected with a district smaller than 10?
SQL: SELECT AVG("elected") FROM us_house_elections_2004 WHERE "incumbent" = 'ed towns' AND "district" < 10

Question: What party has a district of 28 and was elected after 1983?
SQL: SELECT "party" FROM us_house_elections_2004 WHERE "elected" > 1983 AND "district" = 28

Question: What's the elected year of Nydia Velazquez in a district bigger than 2 and a democrat?
SQL: SELECT AVG("elected") FROM us_house_elections_2004 WHERE "party" = 'democrat' AND "district" > 2 AND "incumbent" = 'nydia velazquez'