output
stringlengths
27
479
instruction
stringlengths
407
1.39k
SELECT "first_elected" FROM "texas" WHERE "district"='Texas 6';
## Task Generate a SQL query to answer the following question: `Name the first elected for texas 6 district` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "texas" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the first elected for texas 6 district`: ```sql
SELECT "incumbent" FROM "texas" WHERE "district"='Texas 22';
## Task Generate a SQL query to answer the following question: `Name the incumbent for texas 22 district` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "texas" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the incumbent for texas 22 district`: ```sql
SELECT "results" FROM "florida" WHERE "district"='Florida 14';
## Task Generate a SQL query to answer the following question: `How did the election in the Florida 14 district end?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How did the election in the Florida 14 district end?`: ```sql
SELECT "incumbent" FROM "florida" WHERE "district"='Florida 12';
## Task Generate a SQL query to answer the following question: `Who's the incumbent of Florida 12 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who's the incumbent of Florida 12 district?`: ```sql
SELECT "incumbent" FROM "florida" WHERE "district"='Florida 9';
## Task Generate a SQL query to answer the following question: `Who is the incumbent of Florida 9?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who is the incumbent of Florida 9?`: ```sql
SELECT "incumbent" FROM "florida" WHERE "district"='Florida 6';
## Task Generate a SQL query to answer the following question: `Who's the incumbent in Florida 6?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who's the incumbent in Florida 6?`: ```sql
SELECT "party" FROM "florida" WHERE "incumbent"='Bill McCollum';
## Task Generate a SQL query to answer the following question: `What party does Bill McCollum belong to?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party does Bill McCollum belong to?`: ```sql
SELECT "results" FROM "florida" WHERE "incumbent"='Peter Deutsch';
## Task Generate a SQL query to answer the following question: `What are the results in the county with Peter Deutsch as a candidate?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What are the results in the county with Peter Deutsch as a candidate?`: ```sql
SELECT "results" FROM "florida" WHERE "incumbent"='Robert Wexler';
## Task Generate a SQL query to answer the following question: `How did the election end for Robert Wexler?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How did the election end for Robert Wexler?`: ```sql
SELECT "party" FROM "maryland" WHERE "district"='Maryland 6';
## Task Generate a SQL query to answer the following question: `What party was the winner in the district Maryland 6?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "maryland" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party was the winner in the district Maryland 6?`: ```sql
SELECT "candidates" FROM "maryland" WHERE "district"='Maryland 3';
## Task Generate a SQL query to answer the following question: `Who run for office in district Maryland 3?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "maryland" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who run for office in district Maryland 3?`: ```sql
SELECT "candidates" FROM "maryland" WHERE "party"='Republican' AND "district"='Maryland 1';
## Task Generate a SQL query to answer the following question: `List the candidates in district Maryland 1 where the republican party won.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "maryland" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `List the candidates in district Maryland 1 where the republican party won.`: ```sql
SELECT MIN("first_elected") FROM "maryland" WHERE "district"='Maryland 2';
## Task Generate a SQL query to answer the following question: `When did the elections take place in district Maryland 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "maryland" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `When did the elections take place in district Maryland 2?`: ```sql
SELECT "party" FROM "new_jersey" WHERE "incumbent"='Frank LoBiondo';
## Task Generate a SQL query to answer the following question: `What party is Frank Lobiondo a member of?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_jersey" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party is Frank Lobiondo a member of?`: ```sql
SELECT "candidates" FROM "new_jersey" WHERE "incumbent"='Bill Pascrell';
## Task Generate a SQL query to answer the following question: `Who were the candidates in the district whose incumbent is Bill Pascrell?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_jersey" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates in the district whose incumbent is Bill Pascrell?`: ```sql
SELECT "party" FROM "new_jersey" WHERE "incumbent"='Jim Saxton';
## Task Generate a SQL query to answer the following question: `What is the party of the district incumbent Jim Saxton?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_jersey" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the party of the district incumbent Jim Saxton?`: ```sql
SELECT "party" FROM "new_york" WHERE "incumbent"='John McHugh';
## Task Generate a SQL query to answer the following question: `What party is John McHugh a member of?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party is John McHugh a member of?`: ```sql
SELECT "party" FROM "new_york" WHERE "first_elected"='1990';
## Task Generate a SQL query to answer the following question: `What's the party elected in the district that first elected in 1990?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the party elected in the district that first elected in 1990?`: ```sql
SELECT "first_elected" FROM "new_york" WHERE "incumbent"='Ed Towns';
## Task Generate a SQL query to answer the following question: `What's the first elected year of the district that Ed Towns is an incumbent of?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the first elected year of the district that Ed Towns is an incumbent of?`: ```sql
SELECT COUNT("party") FROM "new_york" WHERE "results"='Retired Democratic hold';
## Task Generate a SQL query to answer the following question: `How many elections have resulted in retired democratic hold?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many elections have resulted in retired democratic hold?`: ```sql
SELECT "candidates" FROM "new_york" WHERE "first_elected"='1980';
## Task Generate a SQL query to answer the following question: `What were the candidates in the district that first elected in 1980?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "district" text, "incumbent" text, "party" text, "first_elected" text, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What were the candidates in the district that first elected in 1980?`: ```sql
SELECT "first_elected" FROM "pennsylvania" WHERE "district"='Pennsylvania 2';
## Task Generate a SQL query to answer the following question: `When was Chaka Fattah first elected in the Pennsylvania 2 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, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `When was Chaka Fattah first elected in the Pennsylvania 2 district? `: ```sql
SELECT COUNT("incumbent") FROM "pennsylvania" WHERE "first_elected"='1984';
## Task Generate a SQL query to answer the following question: `How many incumbents were first elected in 1984? ` ### 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, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many incumbents were first elected in 1984? `: ```sql
SELECT "first_elected" FROM "pennsylvania" WHERE "incumbent"='Bud Shuster';
## Task Generate a SQL query to answer the following question: `When was incumbent Bud Shuster first elected? ` ### 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, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `When was incumbent Bud Shuster first elected? `: ```sql
SELECT COUNT("candidates") FROM "pennsylvania" WHERE "incumbent"='Mike Doyle';
## Task Generate a SQL query to answer the following question: `How many candidates ran in the election where Mike Doyle was the incumbent? ` ### 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, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many candidates ran in the election where Mike Doyle was the incumbent? `: ```sql
SELECT "party" FROM "pennsylvania" WHERE "incumbent"='Tim Holden';
## Task Generate a SQL query to answer the following question: `Incumbent Tim Holden belonged to what party? ` ### 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, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Incumbent Tim Holden belonged to what party? `: ```sql
SELECT "district" FROM "pennsylvania" WHERE "incumbent"='Tim Holden';
## Task Generate a SQL query to answer the following question: `In what district was Tim Holden the incumbent? ` ### 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, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `In what district was Tim Holden the incumbent? `: ```sql
SELECT "incumbent" FROM "tennessee" WHERE "first_elected"=1984;
## Task Generate a SQL query to answer the following question: `Which incumbent was first elected in 1984?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "tennessee" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which incumbent was first elected in 1984?`: ```sql
SELECT "first_elected" FROM "tennessee" WHERE "district"='Tennessee 4';
## Task Generate a SQL query to answer the following question: `When was the incumbent in the Tennessee 4 district first elected? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "tennessee" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `When was the incumbent in the Tennessee 4 district first elected? `: ```sql
SELECT "candidates" FROM "tennessee" WHERE "district"='Tennessee 3';
## Task Generate a SQL query to answer the following question: `Who are the candidates in the Tennessee 3 district election? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "tennessee" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the candidates in the Tennessee 3 district election? `: ```sql
SELECT MIN("first_elected") FROM "tennessee" WHERE "incumbent"='Bob Clement';
## Task Generate a SQL query to answer the following question: `What year was Bob Clement first elected? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "tennessee" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What year was Bob Clement first elected? `: ```sql
SELECT "candidates" FROM "florida" WHERE "incumbent"='Sam Gibbons';
## Task Generate a SQL query to answer the following question: `List all the candidates for the seat where the incumbent is Sam Gibbons?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "florida" ( "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 `List all the candidates for the seat where the incumbent is Sam Gibbons?`: ```sql
SELECT "candidates" FROM "wisconsin" WHERE "district"='Wisconsin 4';
## Task Generate a SQL query to answer the following question: `Who were the candidates in district Wisconsin 4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "wisconsin" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were the candidates in district Wisconsin 4?`: ```sql
SELECT "incumbent" FROM "wisconsin" WHERE "first_elected"=1969;
## Task Generate a SQL query to answer the following question: `Who's the incumbent in the district that first elected in 1969?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "wisconsin" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who's the incumbent in the district that first elected in 1969?`: ```sql
SELECT "incumbent" FROM "wisconsin" WHERE "district"='Wisconsin 5';
## Task Generate a SQL query to answer the following question: `Who's the incumbent of district Wisconsin 5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "wisconsin" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who's the incumbent of district Wisconsin 5?`: ```sql
SELECT COUNT("district") FROM "california" WHERE "incumbent"='Gary Condit';
## Task Generate a SQL query to answer the following question: `How many districts does gary condit represent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `How many districts does gary condit represent?`: ```sql
SELECT "party" FROM "california" WHERE "first_elected"=1974;
## Task Generate a SQL query to answer the following question: `What party was first elected in 1974?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What party was first elected in 1974?`: ```sql
SELECT "district" FROM "california" WHERE "incumbent"='Bill Thomas';
## Task Generate a SQL query to answer the following question: `What district is bill thomas from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What district is bill thomas from?`: ```sql
SELECT "district" FROM "california" WHERE "incumbent"='Bill Thomas';
## Task Generate a SQL query to answer the following question: `What district is bill thomas from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "results" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What district is bill thomas from?`: ```sql
SELECT "incumbent" FROM "georgia" WHERE "district"='Georgia 2';
## Task Generate a SQL query to answer the following question: `Who was the incumbent of district Georgia 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "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 was the incumbent of district Georgia 2?`: ```sql
SELECT "district" FROM "georgia" WHERE "incumbent"='Mac Collins';
## Task Generate a SQL query to answer the following question: `What district is Mac Collins an incumbent in?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "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 district is Mac Collins an incumbent in?`: ```sql
SELECT MAX("first_elected") FROM "georgia";
## Task Generate a SQL query to answer the following question: `What's the first elected year of the district who's been the last one to do so?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "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's the first elected year of the district who's been the last one to do so?`: ```sql
SELECT "candidates" FROM "georgia" WHERE "incumbent"='Charlie Norwood';
## Task Generate a SQL query to answer the following question: `Who were the candidates in the district where Charlie Norwood is the incumbent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "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 in the district where Charlie Norwood is the incumbent?`: ```sql
SELECT "result" FROM "louisiana" WHERE "party"='Republican' AND "incumbent"='Billy Tauzin';
## Task Generate a SQL query to answer the following question: `Which result did the Republican have with the incumbent, Billy Tauzin?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "louisiana" ( "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 `Which result did the Republican have with the incumbent, Billy Tauzin?`: ```sql
SELECT COUNT("district") FROM "louisiana" WHERE "incumbent"='Robert Livingston';
## Task Generate a SQL query to answer the following question: `How many districts was Robert Livingston incumbent in?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "louisiana" ( "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 districts was Robert Livingston incumbent in?`: ```sql
SELECT MIN("first_elected") FROM "louisiana";
## Task Generate a SQL query to answer the following question: `What is the first election year listed?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "louisiana" ( "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 is the first election year listed?`: ```sql
SELECT "result" FROM "louisiana" WHERE "incumbent"='Richard Baker';
## Task Generate a SQL query to answer the following question: `List all results in elections with Richard Baker as the incumbent.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "louisiana" ( "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 `List all results in elections with Richard Baker as the incumbent.`: ```sql
SELECT COUNT("party") FROM "washington" WHERE "district"='Washington 7';
## Task Generate a SQL query to answer the following question: ` how many party with district being washington 7` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "washington" ( "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 party with district being washington 7`: ```sql
SELECT MAX("first_elected") FROM "washington";
## Task Generate a SQL query to answer the following question: `what's the latest first elected year` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "washington" ( "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's the latest first elected year`: ```sql
SELECT "result" FROM "washington" WHERE "district"='Washington 7';
## Task Generate a SQL query to answer the following question: `what's the result with district being washington 7` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "washington" ( "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's the result with district being washington 7`: ```sql
SELECT MIN("first_elected") FROM "washington" WHERE "district"='Washington 7';
## Task Generate a SQL query to answer the following question: `what being the minimum first elected with district being washington 7` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "washington" ( "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 being the minimum first elected with district being washington 7`: ```sql
SELECT "result" FROM "illinois" WHERE "first_elected"='1948 , 1964';
## Task Generate a SQL query to answer the following question: `what's the result for first elected in 1948 , 1964` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "illinois" ( "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's the result for first elected in 1948 , 1964`: ```sql
SELECT "first_elected" FROM "illinois" WHERE "district"='Illinois 18';
## Task Generate a SQL query to answer the following question: `what's the first elected with district illinois 18` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "illinois" ( "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's the first elected with district illinois 18`: ```sql
SELECT "party" FROM "illinois" WHERE "candidates"='Jerry Weller (R) 51.77% Clem Balanoff (D) 48.23%';
## Task Generate a SQL query to answer the following question: `what's the party with candidates  jerry weller (r) 51.77% clem balanoff (d) 48.23%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "illinois" ( "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's the party with candidates  jerry weller (r) 51.77% clem balanoff (d) 48.23%`: ```sql
SELECT "party" FROM "illinois" WHERE "first_elected"='1980';
## Task Generate a SQL query to answer the following question: `what's the party for the first elected in 1980` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "illinois" ( "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's the party for the first elected in 1980`: ```sql
SELECT "result" FROM "illinois" WHERE "district"='Illinois 15';
## Task Generate a SQL query to answer the following question: `what's the result with district illinois 15` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "illinois" ( "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's the result with district illinois 15`: ```sql
SELECT COUNT("candidates") FROM "illinois" WHERE "first_elected"='1948 , 1964';
## Task Generate a SQL query to answer the following question: `what's the total number of candidates for first elected in 1948 , 1964` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "illinois" ( "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's the total number of candidates for first elected in 1948 , 1964`: ```sql
SELECT "district" FROM "new_york" WHERE "first_elected"=1994;
## Task Generate a SQL query to answer the following question: `Name thedistrict for 1994` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "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 thedistrict for 1994`: ```sql
SELECT "result" FROM "new_york" WHERE "district"='New York 11';
## Task Generate a SQL query to answer the following question: `Name the result for New York 11` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "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 result for New York 11`: ```sql
SELECT COUNT("first_elected") FROM "new_york" WHERE "district"='New York 11';
## Task Generate a SQL query to answer the following question: `Name the number of first elected for new york 11` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "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 first elected for new york 11`: ```sql
SELECT COUNT("first_elected") FROM "new_york" WHERE "district"='New York 1';
## Task Generate a SQL query to answer the following question: `Name the first elected for new york 1` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "new_york" ( "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 first elected for new york 1`: ```sql
SELECT "first_elected" FROM "texas" WHERE "incumbent"='Larry Combest';
## Task Generate a SQL query to answer the following question: `What year was Larry combest elected` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "texas" ( "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 year was Larry combest elected`: ```sql
SELECT "district" FROM "north_carolina" WHERE "incumbent"='Bill Hefner';
## Task Generate a SQL query to answer the following question: `To what district does Bill Hefner belong?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `To what district does Bill Hefner belong?`: ```sql
SELECT "opponent" FROM "north_carolina" WHERE "incumbent"='Bill Hefner';
## Task Generate a SQL query to answer the following question: `Who ran unsuccessfully against Bill Hefner?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who ran unsuccessfully against Bill Hefner?`: ```sql
SELECT COUNT("status") FROM "north_carolina" WHERE "incumbent"='Alex McMillan';
## Task Generate a SQL query to answer the following question: `How many districts are respresented by Alex McMillan?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `How many districts are respresented by Alex McMillan?`: ```sql
SELECT "party" FROM "georgia" WHERE "incumbent"='Sanford Bishop';
## Task Generate a SQL query to answer the following question: `What party is Sanford Bishop a member of?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What party is Sanford Bishop a member of?`: ```sql
SELECT "party" FROM "georgia" WHERE "district"='Georgia7';
## Task Generate a SQL query to answer the following question: `What party won in the district Georgia7?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What party won in the district Georgia7?`: ```sql
SELECT MAX("first_elected") FROM "georgia" WHERE "district"='Georgia5';
## Task Generate a SQL query to answer the following question: `What's Georgia5's first elected year?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "georgia" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What's Georgia5's first elected year?`: ```sql
SELECT "opponent" FROM "massachusetts" WHERE "incumbent"='Marty Meehan';
## Task Generate a SQL query to answer the following question: `Who opposed Marty Meehan in each election?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "massachusetts" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who opposed Marty Meehan in each election?`: ```sql
SELECT "opponent" FROM "massachusetts" WHERE "district"='Massachusetts5';
## Task Generate a SQL query to answer the following question: `Who are the opponents in Massachusetts5 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "massachusetts" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the opponents in Massachusetts5 district?`: ```sql
SELECT "party" FROM "massachusetts" WHERE "district"='Massachusetts4';
## Task Generate a SQL query to answer the following question: `What parties are represented in Massachusetts4 district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "massachusetts" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What parties are represented in Massachusetts4 district?`: ```sql
SELECT "incumbent" FROM "massachusetts" WHERE "district"='Massachusetts7';
## Task Generate a SQL query to answer the following question: `Who is the incumbent in district Massachusetts7?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "massachusetts" ( "district" text, "incumbent" text, "party" text, "first_elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who is the incumbent in district Massachusetts7?`: ```sql
SELECT COUNT("first_elected") FROM "table1_1341549_33" WHERE "district"='New York2';
## Task Generate a SQL query to answer the following question: ` how many first elected with district being new york2` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_1341549_33" ( "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 first elected with district being new york2`: ```sql
SELECT COUNT("district") FROM "table1_1341549_33" WHERE "candidates"='Eliot L. Engel (D) 85.2% Martin Richman (R) 14.8%';
## Task Generate a SQL query to answer the following question: ` how many district with candidates being eliot l. engel (d) 85.2% martin richman (r) 14.8%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_1341549_33" ( "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 district with candidates being eliot l. engel (d) 85.2% martin richman (r) 14.8%`: ```sql
SELECT COUNT("candidates") FROM "table1_1341549_33" WHERE "party"='Democratic' AND "district"='New York5';
## Task Generate a SQL query to answer the following question: ` how many candidates with party being democratic and dbeingtrict being new york5` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_1341549_33" ( "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 candidates with party being democratic and dbeingtrict being new york5`: ```sql
SELECT COUNT("first_elected") FROM "table1_1341549_33" WHERE "result"='Re-elected' AND "incumbent"='Gary Ackerman Redistricted from the 7th district';
## Task Generate a SQL query to answer the following question: ` how many first elected with result being re-elected and incumbent being gary ackerman redistricted from the 7th district` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "table1_1341549_33" ( "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 first elected with result being re-elected and incumbent being gary ackerman redistricted from the 7th district`: ```sql
SELECT "party" FROM "pennsylvania" WHERE "incumbent"='Ron Klink';
## Task Generate a SQL query to answer the following question: `What party does ron klink 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" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What party does ron klink represent?`: ```sql
SELECT "opponent" FROM "pennsylvania" WHERE "incumbent"='Bud Shuster';
## Task Generate a SQL query to answer the following question: `Who was in the election that was for incumbent bud shuster's seat?` ### 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" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was in the election that was for incumbent bud shuster's seat?`: ```sql
SELECT "district" FROM "pennsylvania" WHERE "first_elected"=1982;
## Task Generate a SQL query to answer the following question: `What district had someone first elected in 1982?` ### 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" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What district had someone first elected in 1982?`: ```sql
SELECT COUNT("incumbent") FROM "pennsylvania" WHERE "party"='Republican' AND "first_elected"=1974;
## Task Generate a SQL query to answer the following question: `How many republican incumbents first elected in 1974?` ### 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" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `How many republican incumbents first elected in 1974?`: ```sql
SELECT "status" FROM "pennsylvania" WHERE "incumbent"='William F. Goodling';
## Task Generate a SQL query to answer the following question: `What was the result of the election where william f. goodling was the incumbent?` ### 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" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result of the election where william f. goodling was the incumbent?`: ```sql
SELECT "party" FROM "north_carolina" WHERE "incumbent"='Howard Coble';
## Task Generate a SQL query to answer the following question: `What party did incumbent Howard Coble belong to?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did incumbent Howard Coble belong to?`: ```sql
SELECT "party" FROM "north_carolina" WHERE "incumbent"='Stephen L. Neal';
## Task Generate a SQL query to answer the following question: `What party did incumbent Stephen L. Neal belong to? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What party did incumbent Stephen L. Neal belong to? `: ```sql
SELECT COUNT("district") FROM "north_carolina" WHERE "party"='Democratic' AND "elected"=1974;
## Task Generate a SQL query to answer the following question: `In how many districts was the democratic incumbent elected in 1974? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `In how many districts was the democratic incumbent elected in 1974? `: ```sql
SELECT MIN("elected") FROM "north_carolina" WHERE "incumbent"='Martin Lancaster';
## Task Generate a SQL query to answer the following question: `What year was incumbent Martin Lancaster elected? ` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "north_carolina" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What year was incumbent Martin Lancaster elected? `: ```sql
SELECT "district" FROM "minnesota" WHERE "elected"=1980;
## Task Generate a SQL query to answer the following question: `What are the locations where the year of election is 1980?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minnesota" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What are the locations where the year of election is 1980?`: ```sql
SELECT "district" FROM "minnesota" WHERE "incumbent"='Vin Weber';
## Task Generate a SQL query to answer the following question: `What location is Vin Weber from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minnesota" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What location is Vin Weber from?`: ```sql
SELECT "district" FROM "texas" WHERE "incumbent"='Larry Combest';
## Task Generate a SQL query to answer the following question: `What is Larry Combest's district?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "texas" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What is Larry Combest's district?`: ```sql
SELECT "status" FROM "texas" WHERE "incumbent"='Charles Stenholm';
## Task Generate a SQL query to answer the following question: `What is the status of incumbent Charles Stenholm?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "texas" ( "district" text, "incumbent" text, "party" text, "elected" real, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the status of incumbent Charles Stenholm?`: ```sql
SELECT COUNT("incumbent") FROM "california" WHERE "district"='California 34';
## Task Generate a SQL query to answer the following question: `How many incumbents represent district California 34?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "elected" text, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `How many incumbents represent district California 34?`: ```sql
SELECT "status" FROM "california" WHERE "party"='Democratic' AND "elected"='1989';
## Task Generate a SQL query to answer the following question: `What is the elected status of the Democratic party in 1989?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "elected" text, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the elected status of the Democratic party in 1989?`: ```sql
SELECT "opponent" FROM "california" WHERE "district"='California 9';
## Task Generate a SQL query to answer the following question: `Who are the opponents in district California 9?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "elected" text, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the opponents in district California 9?`: ```sql
SELECT "incumbent" FROM "california" WHERE "elected"='1974';
## Task Generate a SQL query to answer the following question: `Who are the incumbents elected in 1974?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "california" ( "district" text, "incumbent" text, "party" text, "elected" text, "status" text, "opponent" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are the incumbents elected in 1974?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1958;
## Task Generate a SQL query to answer the following question: `Which incumbent was first elected in 1958?` ### 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which incumbent was first elected in 1958?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Ralph Regula';
## Task Generate a SQL query to answer the following question: `Who are all the candidates who ran in the district where Ralph Regula is 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who are all the candidates who ran in the district where Ralph Regula is the incumbent?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Del Latta';
## Task Generate a SQL query to answer the following question: `Which party does Del Latta 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which party does Del Latta belong to?`: ```sql
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Tom Luken';
## Task Generate a SQL query to answer the following question: `Which party does Tom Luken 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Which party does Tom Luken belong to?`: ```sql
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Tim Valentine';
## Task Generate a SQL query to answer the following question: `Who were all the candidates when incumbent was Tim Valentine?` ### 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Who were all the candidates when incumbent was Tim Valentine?`: ```sql
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1958;
## Task Generate a SQL query to answer the following question: `Name the incumbent for first elected 1958` ### 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the incumbent for first elected 1958`: ```sql
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1952;
## Task Generate a SQL query to answer the following question: `What is the district for 1952?` ### 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" real, "result" text, "candidates" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the district for 1952?`: ```sql