output
stringlengths 27
479
| instruction
stringlengths 407
1.39k
|
|---|---|
SELECT MIN("first_elected") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Mark W. Hannaford';
|
## Task
Generate a SQL query to answer the following question:
`What year was incumbent mark w. hannaford elected?`
### 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 year was incumbent mark w. hannaford elected?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Richard Kelly';
|
## Task
Generate a SQL query to answer the following question:
`what is the district where the incumbent is richard kelly?`
### 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 where the incumbent is richard kelly?`:
```sql
|
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "candidates"='Robert L. F. Sikes (D) Unopposed';
|
## Task
Generate a SQL query to answer the following question:
`what is the result where the candidates is robert l. f. sikes (d) unopposed?`
### 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 result where the candidates is robert l. f. sikes (d) unopposed?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "candidates"='William V. Chappell, Jr. (D) Unopposed';
|
## Task
Generate a SQL query to answer the following question:
`who is the incumbent where the candidates is william v. chappell, jr. (d) unopposed?`
### 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 is the incumbent where the candidates is william v. chappell, jr. (d) unopposed?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='James A. Haley';
|
## Task
Generate a SQL query to answer the following question:
`what is the district where the incumbent is james a. haley?`
### 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 where the incumbent is james a. haley?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Richard Kelly';
|
## Task
Generate a SQL query to answer the following question:
`what is the district where the incumbent is richard kelly?`
### 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 where the incumbent is richard kelly?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Florida 8';
|
## Task
Generate a SQL query to answer the following question:
`who are the candidates where the district is florida 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `who are the candidates where the district is florida 8?`:
```sql
|
SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Sidney R. Yates';
|
## Task
Generate a SQL query to answer the following question:
`what year was the first elected incumbant Sidney R. Yates?`
### 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 year was the first elected incumbant Sidney R. Yates?`:
```sql
|
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "district"='Louisiana 5';
|
## Task
Generate a SQL query to answer the following question:
`How many incumbents are there in district Louisiana 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many incumbents are there in district Louisiana 5?`:
```sql
|
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "result"='Lost renomination Republican gain';
|
## Task
Generate a SQL query to answer the following question:
`How many incumbents resulted in a lost renomination republican 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many incumbents resulted in a lost renomination republican gain?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John Breaux';
|
## Task
Generate a SQL query to answer the following question:
`In which district is the incumbent John Breaux?`
### 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 `In which district is the incumbent John Breaux?`:
```sql
|
SELECT MAX("first_elected") FROM "united_states_house_of_representatives_e" WHERE "candidates"='Otto Passman (D) Unopposed';
|
## Task
Generate a SQL query to answer the following question:
`What year was Otto Passman (d) unopposed first elected?`
### 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 year was Otto Passman (d) unopposed first elected?`:
```sql
|
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='John Breaux';
|
## Task
Generate a SQL query to answer the following question:
`What were the results when the incumbent was John Breaux?`
### 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 were the results when the incumbent was John Breaux?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Texas 1';
|
## Task
Generate a SQL query to answer the following question:
`Name the candidates for texas 1`
### 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 candidates for texas 1`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Texas 12';
|
## Task
Generate a SQL query to answer the following question:
`Name the incumbent for district texas 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the incumbent for district texas 12`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Texas 20';
|
## Task
Generate a SQL query to answer the following question:
`Name the candidates for texas 20`
### 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 candidates for texas 20`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "candidates"='Edward Boland (D) Unopposed';
|
## Task
Generate a SQL query to answer the following question:
`what is the district with the candidates edward boland (d) unopposed?`
### 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 with the candidates edward boland (d) unopposed?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "candidates"='Edward Boland (D) Unopposed';
|
## Task
Generate a SQL query to answer the following question:
`what is the party where the candidates are edward boland (d) unopposed?`
### 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 party where the candidates are edward boland (d) unopposed?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Edward Boland';
|
## Task
Generate a SQL query to answer the following question:
`what is the party where the incumbent is edward boland?`
### 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 party where the incumbent is edward boland?`:
```sql
|
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "candidates"='Paul Tsongas (D) 60.6% Paul W. Cronin (R) 39.4%';
|
## Task
Generate a SQL query to answer the following question:
`How many times was the candidates paul tsongas (d) 60.6% paul w. cronin (r) 39.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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many times was the candidates paul tsongas (d) 60.6% paul w. cronin (r) 39.4%?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Goodloe Byron';
|
## Task
Generate a SQL query to answer the following question:
`List all candidates in elections where the incumbent politician is Goodloe Byron.`
### 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 `List all candidates in elections where the incumbent politician is Goodloe Byron.`:
```sql
|
SELECT COUNT("party") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Robert Bauman';
|
## Task
Generate a SQL query to answer the following question:
`How many instances are there of party in the situation where Robert Bauman is the incumbent politician?`
### 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 `How many instances are there of party in the situation where Robert Bauman is the incumbent politician?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Robert Bauman';
|
## Task
Generate a SQL query to answer the following question:
`What is the party of the election in which Robert Bauman 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 `What is the party of the election in which Robert Bauman is the incumbent?`:
```sql
|
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "district"='Maryland 7';
|
## Task
Generate a SQL query to answer the following question:
`List all results where the voting district is Maryland 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `List all results where the voting district is Maryland 7.`:
```sql
|
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Robert Bauman';
|
## Task
Generate a SQL query to answer the following question:
`What are all the results where Robert Bauman is the incumbent politician?`
### 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 are all the results where Robert Bauman is the incumbent politician?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Del Latta';
|
## Task
Generate a SQL query to answer the following question:
`Who were the candidates in the district won by the incumbent Del Latta?`
### 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 the candidates in the district won by the incumbent Del Latta?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1966;
|
## Task
Generate a SQL query to answer the following question:
`Who were the candidates in the districts that was first elected in 1966?`
### 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 the candidates in the districts that was first elected in 1966?`:
```sql
|
SELECT "candidates" FROM "table1_1341690_5" WHERE "district"='California 10';
|
## Task
Generate a SQL query to answer the following question:
`Who was running for office in the California 10 district?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341690_5" (
"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 running for office in the California 10 district?`:
```sql
|
SELECT COUNT("party") FROM "table1_1341690_5" WHERE "district"='California 23';
|
## Task
Generate a SQL query to answer the following question:
`How many parties won the election in the California 23 district?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341690_5" (
"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 parties won the election in the California 23 district?`:
```sql
|
SELECT MAX("first_elected") FROM "table1_1341690_5" WHERE "party"='Republican';
|
## Task
Generate a SQL query to answer the following question:
`What republican candidate was first elected most recently?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341690_5" (
"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 republican candidate was first elected most recently?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1952;
|
## Task
Generate a SQL query to answer the following question:
`Phillip Landrum was first elected in 1952 from the ninth district of Georgia.`
### 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 `Phillip Landrum was first elected in 1952 from the ninth district of Georgia.`:
```sql
|
SELECT "party" FROM "table1_1341707_15" WHERE "district"='Illinois 12';
|
## Task
Generate a SQL query to answer the following question:
`What party did the incumbent from the Illinois 12 district belong to? `
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341707_15" (
"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 from the Illinois 12 district belong to? `:
```sql
|
SELECT "incumbent" FROM "table1_1341707_15" WHERE "party"='Democratic' AND "result"='Re-elected' AND "district"='Illinois 11';
|
## Task
Generate a SQL query to answer the following question:
`Who was the democratic incumbent in the Illinois 11 district who was re-elected? `
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341707_15" (
"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 democratic incumbent in the Illinois 11 district who was re-elected? `:
```sql
|
SELECT "incumbent" FROM "table1_1341707_15" WHERE "first_elected"='1964';
|
## Task
Generate a SQL query to answer the following question:
`Which incumbent was first elected in 1964? `
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341707_15" (
"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 incumbent was first elected in 1964? `:
```sql
|
SELECT "party" FROM "table1_1341707_15" WHERE "district"='Illinois 1';
|
## Task
Generate a SQL query to answer the following question:
`What party did the incumbent from the Illinois 1 district belong to? `
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "table1_1341707_15" (
"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 from the Illinois 1 district belong to? `:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Don Fuqua';
|
## Task
Generate a SQL query to answer the following question:
`What candidates ran in the election with don fuqua?`
### 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 candidates ran in the election with don fuqua?`:
```sql
|
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "candidates"='Sam M. Gibbons (D) Unopposed';
|
## Task
Generate a SQL query to answer the following question:
`How many incumbent candidates in the election featuring sam m. gibbons (d) unopposed?`
### 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 `How many incumbent candidates in the election featuring sam m. gibbons (d) unopposed?`:
```sql
|
SELECT MAX("first_elected") FROM "united_states_house_of_representatives_e";
|
## Task
Generate a SQL query to answer the following question:
`What is the last year that someone is first elected?`
### 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 last year that someone is first elected?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1940;
|
## Task
Generate a SQL query to answer the following question:
`Who was the incumbent in 1940?`
### 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 was the incumbent in 1940?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Sidney R. Yates';
|
## Task
Generate a SQL query to answer the following question:
`what is the party when the incumbent is sidney r. yates?`
### 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 party when the incumbent is sidney r. yates?`:
```sql
|
SELECT MAX("first_elected") FROM "united_states_house_of_representatives_e" WHERE "district"='Illinois 7';
|
## Task
Generate a SQL query to answer the following question:
`what was the year first elected for district illinois 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `what was the year first elected for district illinois 7?`:
```sql
|
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "candidates"='Phil Crane (R) 58.0% Edward A. Warman (D) 42.0%';
|
## Task
Generate a SQL query to answer the following question:
`how many times was the candidates phil crane (r) 58.0% edward a. warman (d) 42.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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `how many times was the candidates phil crane (r) 58.0% edward a. warman (d) 42.0%?`:
```sql
|
SELECT COUNT("candidates") FROM "united_states_house_of_representatives_e" WHERE "district"='Illinois 18';
|
## Task
Generate a SQL query to answer the following question:
`how many times was it the district illinois 18?`
### 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 `how many times was it the district illinois 18?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Ed Derwinski';
|
## Task
Generate a SQL query to answer the following question:
`who were the candidates when the incumbent was ed derwinski?`
### 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 the candidates when the incumbent was ed derwinski?`:
```sql
|
SELECT MIN("first_elected") FROM "united_states_house_of_representatives_e" WHERE "party"='Republican' AND "candidates"='Robert H. Michel (R) 66.1% Rosa Lee Fox (D) 33.9%';
|
## Task
Generate a SQL query to answer the following question:
`When was the first elected when the party was republican and the candidate were robert h. michel (r) 66.1% rosa lee fox (d) 33.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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was the first elected when the party was republican and the candidate were robert h. michel (r) 66.1% rosa lee fox (d) 33.9%?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Texas 15';
|
## Task
Generate a SQL query to answer the following question:
`Who is the incumbent in district Texas 15?`
### 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 is the incumbent in district Texas 15?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Earle Cabell';
|
## Task
Generate a SQL query to answer the following question:
`Which district elected incumbent Earle Cabell?`
### 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 district elected incumbent Earle Cabell?`:
```sql
|
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Ray Roberts';
|
## Task
Generate a SQL query to answer the following question:
`What was the result when Ray Roberts was elected?`
### 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 was the result when Ray Roberts was elected?`:
```sql
|
SELECT MAX("first_elected") FROM "united_states_house_of_representatives_e";
|
## Task
Generate a SQL query to answer the following question:
`What is the highest year that a candidate was first elected?`
### 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 highest year that a candidate was first elected?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Bill Harsha';
|
## Task
Generate a SQL query to answer the following question:
`Incumbent Bill Harsha was the winner in an election in which the candidates were who?`
### 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 `Incumbent Bill Harsha was the winner in an election in which the candidates were who?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1954;
|
## Task
Generate a SQL query to answer the following question:
`What was the party of the first elected candidate in 1954?`
### 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 was the party of the first elected candidate in 1954?`:
```sql
|
SELECT COUNT("district") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Donald D. Clancy';
|
## Task
Generate a SQL query to answer the following question:
`How many districts does Donald D. Clancy 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many districts does Donald D. Clancy represent?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Lawrence H. Fountain';
|
## Task
Generate a SQL query to answer the following question:
`Which party is Lawrence H. Fountain part of?`
### 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 is Lawrence H. Fountain part of?`:
```sql
|
SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "district"='North Carolina 8';
|
## Task
Generate a SQL query to answer the following question:
`Who was the first person elected in North Carolina 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 `Who was the first person elected in North Carolina 8?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "first_elected"='1952' AND "party"='Democratic';
|
## Task
Generate a SQL query to answer the following question:
`who was the candidate elected to the democratic party in 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" text,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `who was the candidate elected to the democratic party in 1952?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Joe Waggonner';
|
## Task
Generate a SQL query to answer the following question:
`What district did Joe Waggonner 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 `What district did Joe Waggonner belong to?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1940;
|
## Task
Generate a SQL query to answer the following question:
`What is the name of the incumbent who was first eleccted in 1940?`
### 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 name of the incumbent who was first eleccted in 1940?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Edwin Reinecke';
|
## Task
Generate a SQL query to answer the following question:
`What party does incumbent edwin reinecke 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `What party does incumbent edwin reinecke represent?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Don Edwards';
|
## Task
Generate a SQL query to answer the following question:
`Who were the candidates in the election that featured incumbent don edwards?`
### 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 the candidates in the election that featured incumbent don edwards?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Indiana 4';
|
## Task
Generate a SQL query to answer the following question:
`Who's the incumbent of Indiana 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 `Who's the incumbent of Indiana 4 district?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "first_elected"='1950';
|
## Task
Generate a SQL query to answer the following question:
`Who's the incumbent of the district with first election held in 1950?`
### 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's the incumbent of the district with first election held in 1950?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Charles Edward Bennett Redistricted from 2nd';
|
## Task
Generate a SQL query to answer the following question:
`Who was featured in the election of charles edward bennett redistricted from 2nd?`
### 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 featured in the election of charles edward bennett redistricted from 2nd?`:
```sql
|
SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "party"='Republican';
|
## Task
Generate a SQL query to answer the following question:
`Name the first elected for the republican 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the first elected for the republican party`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Philip Philbin';
|
## Task
Generate a SQL query to answer the following question:
`Name the district with philip philbin`
### 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 district with philip philbin`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Edward Boland';
|
## Task
Generate a SQL query to answer the following question:
`Name the party with edward boland`
### 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 party with edward boland`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1966;
|
## Task
Generate a SQL query to answer the following question:
`What was the district who had their first elected in 1966?`
### 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 was the district who had their first elected in 1966?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Richard C. White';
|
## Task
Generate a SQL query to answer the following question:
`Who was the candidate when the incumbent was Richard C. White?`
### 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 was the candidate when the incumbent was Richard C. White?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Donald Ray Matthews';
|
## Task
Generate a SQL query to answer the following question:
`What district did Donald Ray Matthews 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 `What district did Donald Ray Matthews belong to?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Don Fuqua';
|
## Task
Generate a SQL query to answer the following question:
`What party did Don Fuqua 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 `What party did Don Fuqua belong to?`:
```sql
|
SELECT COUNT("party") FROM "united_states_house_of_representatives_e" WHERE "district"='Louisiana 5';
|
## Task
Generate a SQL query to answer the following question:
`How many parties won the election in the Louisiana 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many parties won the election in the Louisiana 5 district?`:
```sql
|
SELECT COUNT("first_elected") FROM "united_states_house_of_representatives_e" WHERE "district"='Louisiana 4';
|
## Task
Generate a SQL query to answer the following question:
`How many candidates were elected in the Louisiana 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many candidates were elected in the Louisiana 4 district?`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Louisiana 7';
|
## Task
Generate a SQL query to answer the following question:
`Who was the winner in the Louisiana 7 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the winner in the Louisiana 7 district?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "district"='Tennessee 3';
|
## Task
Generate a SQL query to answer the following question:
`what's party with district being tennessee 3`
### 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's party with district being tennessee 3`:
```sql
|
SELECT COUNT("party") FROM "united_states_house_of_representatives_e" WHERE "district"='Tennessee 1';
|
## Task
Generate a SQL query to answer the following question:
`how many party with district being tennessee 1`
### 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 `how many party with district being tennessee 1`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "district"='Tennessee 3';
|
## Task
Generate a SQL query to answer the following question:
`what's party with district being tennessee 3`
### 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's party with district being tennessee 3`:
```sql
|
SELECT COUNT("incumbent") FROM "united_states_house_of_representatives_e" WHERE "district"='Tennessee 5';
|
## Task
Generate a SQL query to answer the following question:
` how many incumbent with district being tennessee 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers ` how many incumbent with district being tennessee 5`:
```sql
|
SELECT "incumbent" FROM "united_states_house_of_representatives_e" WHERE "district"='Tennessee 5';
|
## Task
Generate a SQL query to answer the following question:
`what's incumbent with district being tennessee 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `what's incumbent with district being tennessee 5`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Jack Brooks';
|
## Task
Generate a SQL query to answer the following question:
`Who ran in the race for Jack Brooks' seat?`
### 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 ran in the race for Jack Brooks' seat?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Seymour Halpern';
|
## Task
Generate a SQL query to answer the following question:
`which section did seymour halpern run in`
### 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 section did seymour halpern run in`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Albert W. Johnson';
|
## Task
Generate a SQL query to answer the following question:
`What district is incumbent albert w. johnson from?`
### 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 district is incumbent albert w. johnson from?`:
```sql
|
SELECT COUNT("result") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Frank M. Clark';
|
## Task
Generate a SQL query to answer the following question:
`How many times was frank m. clark 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 `How many times was frank m. clark the incumbent?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Elmer J. Holland';
|
## Task
Generate a SQL query to answer the following question:
`What district is incumbent elmer j. holland from?`
### 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 district is incumbent elmer j. holland from?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Frank T. Bow';
|
## Task
Generate a SQL query to answer the following question:
`To which party does Frank T. Bow belong?`
### 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 `To which party does Frank T. Bow belong?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Carl W. Rich';
|
## Task
Generate a SQL query to answer the following question:
`Who ran in the race for the seat of incumbent Carl W. Rich?`
### 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 ran in the race for the seat of incumbent Carl W. Rich?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Carl W. Rich';
|
## Task
Generate a SQL query to answer the following question:
`In which district is the incumbent Carl W. Rich?`
### 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 `In which district is the incumbent Carl W. Rich?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Carl Vinson';
|
## Task
Generate a SQL query to answer the following question:
`Name the candidates where incumbent Carl Vinson is?`
### 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 candidates where incumbent Carl Vinson is?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Massachusetts 8';
|
## Task
Generate a SQL query to answer the following question:
`Name the candidates for massachusetts 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the candidates for massachusetts 8`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "result"='Re-elected' AND "party"='Republican';
|
## Task
Generate a SQL query to answer the following question:
`What candidates were in the election when a republican was re-elected?`
### 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 candidates were in the election when a republican was re-elected?`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Frank Chelf';
|
## Task
Generate a SQL query to answer the following question:
`What district is incumbent frank chelf from?`
### 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 district is incumbent frank chelf from?`:
```sql
|
SELECT COUNT("district") FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Edwin E. Willis';
|
## Task
Generate a SQL query to answer the following question:
`How many districts represented Edwin E. Willis?`
### 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 `How many districts represented Edwin E. Willis?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1961;
|
## Task
Generate a SQL query to answer the following question:
`Who were all the candidates when the first elected year was 1961?`
### 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 the first elected year was 1961?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Hale Boggs';
|
## Task
Generate a SQL query to answer the following question:
`What party did Hale Boggs 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 `What party did Hale Boggs belong to?`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "district"='Texas 12';
|
## Task
Generate a SQL query to answer the following question:
`what is the political affiliation of the texas 12 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the political affiliation of the texas 12 district`:
```sql
|
SELECT "first_elected" FROM "united_states_house_of_representatives_e" WHERE "district"='Texas 6';
|
## Task
Generate a SQL query to answer the following question:
`how many voted in the texas 6 section`
### 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 `how many voted in the texas 6 section`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "incumbent"='Ray Roberts';
|
## Task
Generate a SQL query to answer the following question:
`what is the political affiliation of ray roberts`
### 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 political affiliation of ray roberts`:
```sql
|
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "candidates"='James A. Byrne (D) 59.3% Joseph R. Burns (R) 40.7%';
|
## Task
Generate a SQL query to answer the following question:
`What district featured an election between james a. byrne (d) 59.3% joseph r. burns (r) 40.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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `What district featured an election between james a. byrne (d) 59.3% joseph r. burns (r) 40.7%?`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "district"='Massachusetts 6';
|
## Task
Generate a SQL query to answer the following question:
`Name the candidates for massachusetts 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" real,
"result" text,
"candidates" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the candidates for massachusetts 6`:
```sql
|
SELECT "result" FROM "united_states_house_of_representatives_e" WHERE "district"='Massachusetts 3';
|
## Task
Generate a SQL query to answer the following question:
`Name the result for massachusetts 3`
### 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 result for massachusetts 3`:
```sql
|
SELECT "candidates" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1942;
|
## Task
Generate a SQL query to answer the following question:
`Name the candidate first elected in 1942`
### 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 candidate first elected in 1942`:
```sql
|
SELECT "party" FROM "united_states_house_of_representatives_e" WHERE "district"='Massachusetts 3';
|
## Task
Generate a SQL query to answer the following question:
`Name the party for massachusetts 3`
### 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 party for massachusetts 3`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.