output
stringlengths
27
479
instruction
stringlengths
407
1.39k
SELECT "circuit" FROM "table1_26638600_3" WHERE "lites_1_race_one_winning_team"='#66 Gunnar Racing';
## Task Generate a SQL query to answer the following question: `On which circuit was the lites 1 race one winning team #66 Gunnar Racing?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26638600_3" ( "rnd" real, "circuit" text, "lites_1_race_one_winning_team" text, "lites_2_race_one_winning_team" text, "lites_1_race_two_winning_team" text, "lites_2_race_two_winning_team" text ); ### SQL Given the database schema, here is the SQL query that answers `On which circuit was the lites 1 race one winning team #66 Gunnar Racing?`: ```sql
SELECT "circuit" FROM "table1_26638600_3" WHERE "lites_1_race_two_winning_team"='#13 Inspire Motorsports';
## Task Generate a SQL query to answer the following question: `On which circuit was the lites race two winning team #13 Inspire Motorsports?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26638600_3" ( "rnd" real, "circuit" text, "lites_1_race_one_winning_team" text, "lites_2_race_one_winning_team" text, "lites_1_race_two_winning_team" text, "lites_2_race_two_winning_team" text ); ### SQL Given the database schema, here is the SQL query that answers `On which circuit was the lites race two winning team #13 Inspire Motorsports?`: ```sql
SELECT "lites_2_race_two_winning_team" FROM "table1_26638600_3" WHERE "lites_1_race_one_winning_team"='#13 Inspire Motorsports';
## Task Generate a SQL query to answer the following question: `Who was the lites 2 race two winning team when #13 Inspire Motorsports was the Lites 1 race one winning team?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26638600_3" ( "rnd" real, "circuit" text, "lites_1_race_one_winning_team" text, "lites_2_race_one_winning_team" text, "lites_1_race_two_winning_team" text, "lites_2_race_two_winning_team" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the lites 2 race two winning team when #13 Inspire Motorsports was the Lites 1 race one winning team?`: ```sql
SELECT "original_air_date" FROM "table1_2667438_5" WHERE "no_in_series"=32;
## Task Generate a SQL query to answer the following question: ` What date did series number 32 premiere? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2667438_5" ( "no_in_series" real, "no_in_season" real, "title" text, "directed_by" text, "written_by" text, "original_air_date" text, "prod_code" text ); ### SQL Given the database schema, here is the SQL query that answers ` What date did series number 32 premiere? `: ```sql
SELECT MAX("difference") FROM "table1_26677836_1";
## Task Generate a SQL query to answer the following question: `WHat is the highest difference?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26677836_1" ( "place" real, "nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "table_points" real ); ### SQL Given the database schema, here is the SQL query that answers `WHat is the highest difference?`: ```sql
SELECT "nation" FROM "table1_26677836_1" WHERE "for"=326;
## Task Generate a SQL query to answer the following question: `What is the nation when the for is 326?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26677836_1" ( "place" real, "nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "table_points" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the nation when the for is 326?`: ```sql
SELECT MAX("lost") FROM "table1_26677836_1";
## Task Generate a SQL query to answer the following question: `What is the highest lost?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26677836_1" ( "place" real, "nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "table_points" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the highest lost?`: ```sql
SELECT "nation" FROM "table1_26677836_1" WHERE "place"=2;
## Task Generate a SQL query to answer the following question: `What is the nation when the place is 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26677836_1" ( "place" real, "nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "table_points" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the nation when the place is 2?`: ```sql
SELECT COUNT("against") FROM "table1_26677836_1" WHERE "nation"='[[|]] (19)';
## Task Generate a SQL query to answer the following question: `How many times is the nation [[|]] (19)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_26677836_1" ( "place" real, "nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "table_points" real ); ### SQL Given the database schema, here is the SQL query that answers `How many times is the nation [[|]] (19)?`: ```sql
SELECT "party" FROM "pennsylvania" WHERE "incumbent"='Mathias Morris';
## Task Generate a SQL query to answer the following question: `Which party does the incumbent Mathias Morris belong to?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which party does the incumbent Mathias Morris belong to?`: ```sql
SELECT "district" FROM "pennsylvania" WHERE "incumbent"='Luther Reily';
## Task Generate a SQL query to answer the following question: `Which district does the incumbent Luther Reily represent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which district does the incumbent Luther Reily represent?`: ```sql
SELECT "candidates" FROM "pennsylvania" WHERE "district"='Pennsylvania 11';
## Task Generate a SQL query to answer the following question: `Who are the candidates for the Pennsylvania 11 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the candidates for the Pennsylvania 11 district?`: ```sql
SELECT COUNT("candidates") FROM "pennsylvania" WHERE "district"='Pennsylvania 11';
## Task Generate a SQL query to answer the following question: `How many people won the election in the Pennsylvania 11 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many people won the election in the Pennsylvania 11 district?`: ```sql
SELECT COUNT("first_elected") FROM "table1_2668173_4" WHERE "result"='Lost re-election Anti-Masonic gain';
## Task Generate a SQL query to answer the following question: `How many times did the incumbent was first elected and then lost re-election anti-masonic gain?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668173_4" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many times did the incumbent was first elected and then lost re-election anti-masonic gain?`: ```sql
SELECT "candidates" FROM "table1_2668173_4" WHERE "incumbent"='Henry Logan';
## Task Generate a SQL query to answer the following question: `Who were the candidates if the incumbent was Henry Logan?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668173_4" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates if the incumbent was Henry Logan?`: ```sql
SELECT "district" FROM "table1_2668173_4" WHERE "incumbent"='Mathias Morris';
## Task Generate a SQL query to answer the following question: `What was the district of the incumbent Mathias Morris?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668173_4" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the district of the incumbent Mathias Morris?`: ```sql
SELECT COUNT("first_elected") FROM "table1_2668173_4" WHERE "party"='Anti-Masonic';
## Task Generate a SQL query to answer the following question: `How many incumbents was first elected in the Anti-Masonic party?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668173_4" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many incumbents was first elected in the Anti-Masonic party?`: ```sql
SELECT "incumbent" FROM "table1_2668243_17" WHERE "candidates"='Robert Monell (J) 63.6% Tilly Lynde 36.4%';
## Task Generate a SQL query to answer the following question: `Name the incumbent for robert monell (j) 63.6% tilly lynde 36.4%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668243_17" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the incumbent for robert monell (j) 63.6% tilly lynde 36.4%`: ```sql
SELECT COUNT("first_elected") FROM "table1_2668243_17" WHERE "candidates"='Thomas Maxwell (J) 60.1% David Woodcock (AJ) 39.9%';
## Task Generate a SQL query to answer the following question: `Name the number of first elected for thomas maxwell (j) 60.1% david woodcock (aj) 39.9%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668243_17" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the number of first elected for thomas maxwell (j) 60.1% david woodcock (aj) 39.9%`: ```sql
SELECT "candidates" FROM "table1_2668243_17" WHERE "district"='New York 21';
## Task Generate a SQL query to answer the following question: `Name the candidates for new york 21` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668243_17" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the candidates for new york 21`: ```sql
SELECT "candidates" FROM "table1_2668243_17" WHERE "incumbent"='Selah R. Hobbie';
## Task Generate a SQL query to answer the following question: `Name the candidates for selah r. hobbie` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668243_17" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the candidates for selah r. hobbie`: ```sql
SELECT "result" FROM "table1_2668243_17" WHERE "candidates"='James Lent (J) 52.3% Silas Wood (AJ) 47.7%';
## Task Generate a SQL query to answer the following question: `Name the result for james lent (j) 52.3% silas wood (aj) 47.7%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668243_17" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the result for james lent (j) 52.3% silas wood (aj) 47.7%`: ```sql
SELECT "candidates" FROM "pennsylvania" WHERE "district"='Pennsylvania 12';
## Task Generate a SQL query to answer the following question: `Who were the candidates in districk Pennsylvania 12?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates in districk Pennsylvania 12?`: ```sql
SELECT "result" FROM "pennsylvania" WHERE "district"='Pennsylvania 6';
## Task Generate a SQL query to answer the following question: `What is the result for district pennsylvania 6?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the result for district pennsylvania 6?`: ```sql
SELECT "incumbent" FROM "pennsylvania" WHERE "candidates"='John Banks (AM) 52.2% Samuel Power (J) 47.8%';
## Task Generate a SQL query to answer the following question: `Who was the incumbent when the candidates were John banks (am) 52.2% samuel power (j) 47.8%?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the incumbent when the candidates were John banks (am) 52.2% samuel power (j) 47.8%?`: ```sql
SELECT COUNT("first_elected") FROM "pennsylvania" WHERE "result"='Re-elected' AND "party"='Anti-Masonic' AND "district"='Pennsylvania 24';
## Task Generate a SQL query to answer the following question: `How many times was the result was re-elected and the party was anti-masonic in the district Pennsylvania 24?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many times was the result was re-elected and the party was anti-masonic in the district Pennsylvania 24?`: ```sql
SELECT "candidates" FROM "pennsylvania" WHERE "result"='Re-elected' AND "first_elected"='1832' AND "party"='Jacksonian';
## Task Generate a SQL query to answer the following question: `Who were all the candidates when the results were re-elected, first elected was 1832 and the party was jacksonian?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "pennsylvania" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were all the candidates when the results were re-elected, first elected was 1832 and the party was jacksonian?`: ```sql
SELECT MAX("rank_qualifying") FROM "competitive_history" WHERE "location"='Ghent' AND "year"=2011 AND "score_qualifying"='14.850';
## Task Generate a SQL query to answer the following question: `In Ghent in 2011, what was the rank-qualifying value when the score-qualifying value was 14.850` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "competitive_history" ( "year" real, "competition" text, "location" text, "apparatus" text, "rank_final" real, "score_final" text, "rank_qualifying" real, "score_qualifying" text ); ### SQL Given the database schema, here is the SQL query that answers `In Ghent in 2011, what was the rank-qualifying value when the score-qualifying value was 14.850`: ```sql
SELECT MAX("rank_final") FROM "competitive_history" WHERE "apparatus"='Floor Exercise';
## Task Generate a SQL query to answer the following question: `What was the maximum rank-final score on the floor exercise?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "competitive_history" ( "year" real, "competition" text, "location" text, "apparatus" text, "rank_final" real, "score_final" text, "rank_qualifying" real, "score_qualifying" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the maximum rank-final score on the floor exercise?`: ```sql
SELECT MAX("rank_final") FROM "competitive_history" WHERE "score_final"='14.975';
## Task Generate a SQL query to answer the following question: `What was the maximum rank-final value for a score of 14.975?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "competitive_history" ( "year" real, "competition" text, "location" text, "apparatus" text, "rank_final" real, "score_final" text, "rank_qualifying" real, "score_qualifying" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the maximum rank-final value for a score of 14.975?`: ```sql
SELECT "location" FROM "competitive_history" WHERE "score_final"='15.050';
## Task Generate a SQL query to answer the following question: `Where did the event with a final score of 15.050 occur?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "competitive_history" ( "year" real, "competition" text, "location" text, "apparatus" text, "rank_final" real, "score_final" text, "rank_qualifying" real, "score_qualifying" text ); ### SQL Given the database schema, here is the SQL query that answers `Where did the event with a final score of 15.050 occur?`: ```sql
SELECT COUNT("party") FROM "united_states_house_of_representatives_e" WHERE "district"='South Carolina 2';
## Task Generate a SQL query to answer the following question: `how many "Party" are in district south carolina 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `how many "Party" are in district south carolina 2?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "result"='Re-elected' AND "district"='South Carolina 7';
## Task Generate a SQL query to answer the following question: `What "party" was re-elected in district South Carolina 7?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What "party" was re-elected in district South Carolina 7?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='South Carolina 6';
## Task Generate a SQL query to answer the following question: `who were the "candidate" of South Carolina 6?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `who were the "candidate" of South Carolina 6?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='South Carolina 7';
## Task Generate a SQL query to answer the following question: `Who was the "incumbent" of district south carolina 7?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the "incumbent" of district south carolina 7?`: ```sql
SELECT COUNT("first_elected") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John Roane';
## Task Generate a SQL query to answer the following question: `How many people were first elected when john roane was the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many people were first elected when john roane was the incumbent?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John S. Barbour';
## Task Generate a SQL query to answer the following question: `What party did john s. barbour represent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did john s. barbour represent?`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "candidates"='Andrew Stevenson (J) 100%';
## Task Generate a SQL query to answer the following question: `What was the result of the election featuring andrew stevenson (j) 100%?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result of the election featuring andrew stevenson (j) 100%?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Nathaniel H. Claiborne';
## Task Generate a SQL query to answer the following question: `What candidate(s) ran for election when nathaniel h. claiborne was the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What candidate(s) ran for election when nathaniel h. claiborne was the incumbent?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "first_elected"='1818';
## Task Generate a SQL query to answer the following question: `Who was the ran as an incumbent leader first in 1818?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the ran as an incumbent leader first in 1818?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Joshua Sands';
## Task Generate a SQL query to answer the following question: `Who were the running candidates when Joshua Sands was the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the running candidates when Joshua Sands was the incumbent?`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "party"='Adams-Clay Federalist' AND "incumbent"='Stephen Van Rensselaer';
## Task Generate a SQL query to answer the following question: `What was the result of the election where stephen van rensselaer was the incumbent and the party represented was the adams-clay federalist party?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result of the election where stephen van rensselaer was the incumbent and the party represented was the adams-clay federalist party?`: ```sql
SELECT COUNT("district") FROM "united_states_house_of_representatives_e" WHERE "first_elected"='1811';
## Task Generate a SQL query to answer the following question: `How many district has a candidate that was first elected on 1811?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many district has a candidate that was first elected on 1811?`: ```sql
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Charles A. Wickliffe';
## Task Generate a SQL query to answer the following question: `In what district was the incumbent Charles A. Wickliffe? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `In what district was the incumbent Charles A. Wickliffe? `: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Thomas P. Moore';
## Task Generate a SQL query to answer the following question: `What party did the incumbent Thomas P. Moore belong to?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did the incumbent Thomas P. Moore belong to?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Kentucky 9';
## Task Generate a SQL query to answer the following question: `Who were the candidates in the Kentucky 9 district? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates in the Kentucky 9 district? `: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Kentucky 5';
## Task Generate a SQL query to answer the following question: `Who were the candidates in the Kentucky 5 district? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates in the Kentucky 5 district? `: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "candidates"='William Drayton (J)';
## Task Generate a SQL query to answer the following question: `Who was the incumbent when the candidate was william drayton (j)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the incumbent when the candidate was william drayton (j)?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "candidates"='George McDuffie (J)';
## Task Generate a SQL query to answer the following question: `What party did candidate george mcduffie (j) represent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did candidate george mcduffie (j) represent?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Robert P. Letcher';
## Task Generate a SQL query to answer the following question: `What party did robert p. letcher represent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did robert p. letcher represent?`: ```sql
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Henry Clay';
## Task Generate a SQL query to answer the following question: `What district(s) did henry clay represent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What district(s) did henry clay represent?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "result"='Retired Jacksonian gain';
## Task Generate a SQL query to answer the following question: `Who were the candidates for election that had a result of a retired jacksonian gain?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates for election that had a result of a retired jacksonian gain?`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "district"='Virginia 22';
## Task Generate a SQL query to answer the following question: `What ended up happening in the district Virginia 22?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What ended up happening in the district Virginia 22?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "district"='Virginia 4';
## Task Generate a SQL query to answer the following question: `What party won the Virginia 4 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party won the Virginia 4 district?`: ```sql
SELECT COUNT("result") FROM "united_states_house_of_representatives_e" WHERE "district"='Virginia 4';
## Task Generate a SQL query to answer the following question: `How many people won the election in the district of Virginia 4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many people won the election in the district of Virginia 4?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Virginia 6';
## Task Generate a SQL query to answer the following question: `Who is the incumbent in the Virginia 6 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who is the incumbent in the Virginia 6 district?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Samuel Smith';
## Task Generate a SQL query to answer the following question: `What is Samuel Smith's party?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What is Samuel Smith's party?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Peter Little';
## Task Generate a SQL query to answer the following question: `what is Peter Little's party?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `what is Peter Little's party?`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Samuel Smith';
## Task Generate a SQL query to answer the following question: `What was the result of Samuel Smith's race?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result of Samuel Smith's race?`: ```sql
SELECT COUNT("result") FROM "united_states_house_of_representatives_e" WHERE "district"='North Carolina 9';
## Task Generate a SQL query to answer the following question: `Name the result for north carolina 9` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the result for north carolina 9`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Hutchins G. Burton';
## Task Generate a SQL query to answer the following question: `Name the party for hutchins g. burton` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the party for hutchins g. burton`: ```sql
SELECT COUNT("result") FROM "united_states_house_of_representatives_e" WHERE "candidates"='Thomas H. Hall (DR) 53.0% William Clarke (F) 47.0%';
## Task Generate a SQL query to answer the following question: `Name the result for thomas h. hall (dr) 53.0% william clarke (f) 47.0%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the result for thomas h. hall (dr) 53.0% william clarke (f) 47.0%`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Felix Walker';
## Task Generate a SQL query to answer the following question: `Name the candidates for felix walker` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the candidates for felix walker`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John Pegram';
## Task Generate a SQL query to answer the following question: `Who are the candidates when the incumbent is john pegram?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the candidates when the incumbent is john pegram?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Virginia 12';
## Task Generate a SQL query to answer the following question: `Who are the candidates for district virginia 12?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the candidates for district virginia 12?`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "candidates"='Alexander Smyth (DR) 100%';
## Task Generate a SQL query to answer the following question: `What is the result when the candidates are alexander smyth (dr) 100%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the result when the candidates are alexander smyth (dr) 100%`: ```sql
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "candidates"='Charles F. Mercer (F) 100%';
## Task Generate a SQL query to answer the following question: `How many times is the candidates charles f. mercer (f) 100%?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many times is the candidates charles f. mercer (f) 100%?`: ```sql
SELECT COUNT("party") FROM "table1_2668347_14" WHERE "incumbent"='John B. Yates';
## Task Generate a SQL query to answer the following question: `how many times was the incumbent is john b. yates?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `how many times was the incumbent is john b. yates?`: ```sql
SELECT "first_elected" FROM "table1_2668347_14" WHERE "candidates"='Thomas Lawyer (DR) 54.9% William Beekman (F) 45.1%';
## Task Generate a SQL query to answer the following question: `when was the first elected when the candidates is thomas lawyer (dr) 54.9% william beekman (f) 45.1%?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `when was the first elected when the candidates is thomas lawyer (dr) 54.9% william beekman (f) 45.1%?`: ```sql
SELECT "candidates" FROM "table1_2668347_14" WHERE "district"='New York 10';
## Task Generate a SQL query to answer the following question: `who are the candidates for district new york 10?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `who are the candidates for district new york 10?`: ```sql
SELECT COUNT("party") FROM "table1_2668347_14" WHERE "candidates"='Thomas H. Hubbard (DR) 51.5% Simeon Ford (F) 48.4%';
## Task Generate a SQL query to answer the following question: `how many times were the candidates thomas h. hubbard (dr) 51.5% simeon ford (f) 48.4%?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `how many times were the candidates thomas h. hubbard (dr) 51.5% simeon ford (f) 48.4%?`: ```sql
SELECT "district" FROM "table1_2668347_14" WHERE "party"='Federalist' AND "first_elected"='1814';
## Task Generate a SQL query to answer the following question: `what is the district when the party is federalist and first elected is 1814?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `what is the district when the party is federalist and first elected is 1814?`: ```sql
SELECT "candidates" FROM "table1_2668347_17" WHERE "district"='Pennsylvania 14';
## Task Generate a SQL query to answer the following question: `Name the candidates for pennsylvania 14` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_17" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the candidates for pennsylvania 14`: ```sql
SELECT "incumbent" FROM "table1_2668347_17" WHERE "candidates"='Jacob Spangler (DR) 67.1% Jacob Hay (F) 32.9%';
## Task Generate a SQL query to answer the following question: `Name the incumbent for jacob spangler (dr) 67.1% jacob hay (f) 32.9%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_17" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the incumbent for jacob spangler (dr) 67.1% jacob hay (f) 32.9%`: ```sql
SELECT MAX("first_elected") FROM "table1_2668347_17";
## Task Generate a SQL query to answer the following question: `Name the most first elected` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_17" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the most first elected`: ```sql
SELECT COUNT("candidates") FROM "table1_2668347_17" WHERE "incumbent"='Samuel D. Ingham';
## Task Generate a SQL query to answer the following question: `Name the number of candidates for samuel d. ingham` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668347_17" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the number of candidates for samuel d. ingham`: ```sql
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "candidates"='William A. Burwell (DR)';
## Task Generate a SQL query to answer the following question: `Which district did William A. Burwell (Dr) belong to? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which district did William A. Burwell (Dr) belong to? `: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Thomas R. Gold';
## Task Generate a SQL query to answer the following question: `What was the result in the district represented by Thomas R. Gold?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result in the district represented by Thomas R. Gold?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Kentucky 2';
## Task Generate a SQL query to answer the following question: `Who is every incumbent when Kentucky 2 is the district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who is every incumbent when Kentucky 2 is the district?`: ```sql
SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "district"='Kentucky 6';
## Task Generate a SQL query to answer the following question: `Who is first elected when Kentucky 6 is the district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who is first elected when Kentucky 6 is the district?`: ```sql
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Joseph Desha';
## Task Generate a SQL query to answer the following question: `What is every district for incumbent Joseph Desha?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What is every district for incumbent Joseph Desha?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "result"='Lost re-election Democratic-Republican hold';
## Task Generate a SQL query to answer the following question: `Which party experienced a result of lost re-election democratic-republican hold?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which party experienced a result of lost re-election democratic-republican hold?`: ```sql
SELECT COUNT("district") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John C. Calhoun';
## Task Generate a SQL query to answer the following question: `How many districts have John C. Calhoun as the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many districts have John C. Calhoun as the incumbent?`: ```sql
SELECT "incumbent" FROM "table1_2668367_7" WHERE "district"='Kentucky 8';
## Task Generate a SQL query to answer the following question: `Who was the incumbent in the Kentucky 8 district? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668367_7" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the incumbent in the Kentucky 8 district? `: ```sql
SELECT "result" FROM "table1_2668367_7" WHERE "district"='Kentucky 8';
## Task Generate a SQL query to answer the following question: `What was the result in the election in the Kentucky 8 district? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668367_7" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result in the election in the Kentucky 8 district? `: ```sql
SELECT "result" FROM "table1_2668367_7" WHERE "district"='Kentucky 1';
## Task Generate a SQL query to answer the following question: `What was the result in the election in the Kentucky 1 district? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668367_7" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result in the election in the Kentucky 1 district? `: ```sql
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John Smilie';
## Task Generate a SQL query to answer the following question: `What district had an election with incumbent john smilie?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What district had an election with incumbent john smilie?`: ```sql
SELECT COUNT("district") FROM "united_states_house_of_representatives_e" WHERE "first_elected"='1808' AND "incumbent"='George Smith';
## Task Generate a SQL query to answer the following question: `How many districts first elected someone in 1808 and had george smith as the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many districts first elected someone in 1808 and had george smith as the incumbent?`: ```sql
SELECT "incumbent" FROM "table1_2668374_18" WHERE "district"='Virginia 3';
## Task Generate a SQL query to answer the following question: `Who was the incumbent in Virginia 3?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668374_18" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the incumbent in Virginia 3?`: ```sql
SELECT "incumbent" FROM "table1_2668374_18" WHERE "party"='Federalist' AND "first_elected"='1803';
## Task Generate a SQL query to answer the following question: `What incumbent was a federalist that was first elected in 1803?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668374_18" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What incumbent was a federalist that was first elected in 1803?`: ```sql
SELECT COUNT("party") FROM "table1_2668374_18" WHERE "first_elected"='1805';
## Task Generate a SQL query to answer the following question: `How many parties were first elected in 1805?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668374_18" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many parties were first elected in 1805?`: ```sql
SELECT "district" FROM "table1_2668374_18" WHERE "incumbent"='John Dawson';
## Task Generate a SQL query to answer the following question: `What district was John Dawson from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668374_18" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What district was John Dawson from?`: ```sql
SELECT "candidates" FROM "table1_2668374_10" WHERE "incumbent"='Samuel Riker';
## Task Generate a SQL query to answer the following question: `Who were the running candidates when Samuel Riker was the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668374_10" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the running candidates when Samuel Riker was the incumbent?`: ```sql
SELECT "candidates" FROM "table1_2668367_14" WHERE "incumbent"='Nathaniel Macon';
## Task Generate a SQL query to answer the following question: `Who were the candidates in the district where the incumbent was Nathaniel Macon?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668367_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates in the district where the incumbent was Nathaniel Macon?`: ```sql
SELECT "party" FROM "table1_2668367_14" WHERE "incumbent"='Joseph Pearson';
## Task Generate a SQL query to answer the following question: `What party did the incumbent Joseph Pearson belong to?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_2668367_14" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did the incumbent Joseph Pearson belong to?`: ```sql
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "district"='Pennsylvania 5';
## Task Generate a SQL query to answer the following question: `How many incumbents are there in Pennsylvania 5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many incumbents are there in Pennsylvania 5?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "district"='Pennsylvania 8';
## Task Generate a SQL query to answer the following question: `What are the parties listed for Pennsylvania 8?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What are the parties listed for Pennsylvania 8?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "candidates"='Joseph Hiester (DR) 83.2% Roswell Wells (F) 16.8%';
## Task Generate a SQL query to answer the following question: `Name the incumbent for candidates Joseph Hiester (dr) 83.2% Roswell Wells (f) 16.8%.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the incumbent for candidates Joseph Hiester (dr) 83.2% Roswell Wells (f) 16.8%.`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Andrew Gregg';
## Task Generate a SQL query to answer the following question: `What was the result for Andrew Gregg?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result for Andrew Gregg?`: ```sql
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "district"='Pennsylvania 8';
## Task Generate a SQL query to answer the following question: `What was the result for Pennsylvania 8?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "united_states_house_of_representatives_e" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result for Pennsylvania 8?`: ```sql