CREATE TABLE "massachusetts" (
  "district" text,
  "incumbent" text,
  "party" text,
  "first_elected" real,
  "result" text,
  "candidates" text
);

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

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

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

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