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

Question: Who were the candidates in districk Pennsylvania 12?
SQL: SELECT "candidates" FROM "pennsylvania" WHERE "district"='Pennsylvania 12';

Question: What is the result for district pennsylvania 6?
SQL: SELECT "result" FROM "pennsylvania" WHERE "district"='Pennsylvania 6';

Question: Who was the incumbent when the candidates were John banks (am) 52.2% samuel power (j) 47.8%?
SQL: SELECT "incumbent" FROM "pennsylvania" WHERE "candidates"='John Banks (AM) 52.2% Samuel Power (J) 47.8%';

Question: How many times was the result was re-elected and the party was anti-masonic in the district Pennsylvania 24?
SQL: SELECT COUNT("first_elected") FROM "pennsylvania" WHERE "result"='Re-elected' AND "party"='Anti-Masonic' AND "district"='Pennsylvania 24';

Question: Who were all the candidates when the results were re-elected, first elected was 1832 and the party was jacksonian?
SQL: SELECT "candidates" FROM "pennsylvania" WHERE "result"='Re-elected' AND "first_elected"='1832' AND "party"='Jacksonian';