Table: election_results_1800_2
Columns: district
incumbent
party
first_elected
result
candidates

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 election_results_1800_2 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 election_results_1800_2 WHERE "result" = 'Democratic-Republican gain'

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

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