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

Question: What party did the incumbent from the Virginia 5 district who was re-elected and was first elected in 1797 belong to?
SQL: SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "result"='Re-elected' AND "first_elected"='1797' AND "district"='Virginia 5';

Question: When was the incumbent first elected in the district where the result was a democratic-republican gain? 
SQL: SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "result"='Democratic-Republican gain';

Question: In what district was the incumbent Edwin Gray? 
SQL: SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Edwin Gray';

Question: When was the incumbent from the Virginia 10 district first elected? 
SQL: SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "district"='Virginia 10';