Table: election_results_2002
Columns: district
incumbent
party
first_elected
result
candidates

Question: Who were the candidates when ed markey was the incumbent?
SQL: SELECT "candidates" FROM election_results_2002 WHERE "incumbent" = 'Ed Markey'

Question: How many times was the incumbent mike capuano
SQL: SELECT COUNT("result") FROM election_results_2002 WHERE "incumbent" = 'Mike Capuano'

Question: Who were the candidates when Barney Frank was the incumbent?
SQL: SELECT "candidates" FROM election_results_2002 WHERE "incumbent" = 'Barney Frank'

Question: What was the earliest year someone was first elected from Massachusetts 3
SQL: SELECT MIN("first_elected") FROM election_results_2002 WHERE "district" = 'Massachusetts 3'