Question: When was the incumbent first elected in the district where the result was a democratic-republican gain? 
SQL: SELECT First elected FROM table WHERE Result = Democratic-Republican gain