output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT "high_assists" FROM "game_log" WHERE "record"='33–15'; |
## Task
Generate a SQL query to answer the following question:
`Who had the high assists when the record was 33–15?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who had the high assists when the record was 33–15?`:
```sql
|
SELECT "date" FROM "game_log" WHERE "location_attendance"='at&t center 18,797' AND "game"<57; |
## Task
Generate a SQL query to answer the following question:
`What date was the location attendance at&t center 18,797, and a game earlier than 57?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What date was the location attendance at&t center 18,797, and a game earlier than 57?`:
```sql
|
SELECT "high_assists" FROM "game_log" WHERE "score"='l 107–112 (ot)'; |
## Task
Generate a SQL query to answer the following question:
`What player had the high assists when the Score was l 107–112 (ot)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What player had the high assists when the Score was l 107–112 (ot)?`:
```sql
|
SELECT "result" FROM "schedule" WHERE "attendance">'21,881' AND "opponent"='miami dolphins'; |
## Task
Generate a SQL query to answer the following question:
`What was the result when they played the Miami Dolphins with a crowd of 21,881?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule" (
"week" real,
"date" text,
"opponent" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the result when they played the Miami Dolphins with a crowd of 21,881?`:
```sql
|
SELECT "name" FROM "list" WHERE "market_value_bn"<5.59 AND "rank">39 AND "assets_bn">27.46; |
## Task
Generate a SQL query to answer the following question:
`Which company had a market value less than $5.59 billion, assets greater than $27.46 billion, and a rank above 39?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"rank" real,
"rank_forbes_2000" real,
"name" text,
"headquarters" text,
"revenue_bn" real,
"profit_bn" real,
"assets_bn" real,
"market_value_bn" real,
"industry" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which company had a market value less than $5.59 billion, assets greater than $27.46 billion, and a rank above 39?`:
```sql
|
SELECT COUNT("rank") FROM "list" WHERE "assets_bn"=70.74 AND "market_value_bn">11.29; |
## Task
Generate a SQL query to answer the following question:
`How many ranks have assets of $70.74 billion and market value greater than $11.29 billion?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"rank" real,
"rank_forbes_2000" real,
"name" text,
"headquarters" text,
"revenue_bn" real,
"profit_bn" real,
"assets_bn" real,
"market_value_bn" real,
"industry" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many ranks have assets of $70.74 billion and market value greater than $11.29 billion?`:
```sql
|
SELECT SUM("revenue_bn") FROM "list" WHERE "assets_bn"<3.46 AND "headquarters"='hong kong' AND "profit_bn">0.17 AND "rank">42; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of revenue in Hong Kong with a rank greater than 42, less than $3.46 billion in assets, and greater than $0.17 billion in profits?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"rank" real,
"rank_forbes_2000" real,
"name" text,
"headquarters" text,
"revenue_bn" real,
"profit_bn" real,
"assets_bn" real,
"market_value_bn" real,
"industry" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of revenue in Hong Kong with a rank greater than 42, less than $3.46 billion in assets, and greater than $0.17 billion in profits?`:
```sql
|
SELECT SUM("revenue_bn") FROM "list" WHERE "industry"='banking' AND "rank_forbes_2000"<53; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of revenue for the banking industry with a Forbes 2000 rank under 53?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"rank" real,
"rank_forbes_2000" real,
"name" text,
"headquarters" text,
"revenue_bn" real,
"profit_bn" real,
"assets_bn" real,
"market_value_bn" real,
"industry" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of revenue for the banking industry with a Forbes 2000 rank under 53?`:
```sql
|
SELECT MAX("gold") FROM "medal_table" WHERE "silver"<0; |
## Task
Generate a SQL query to answer the following question:
`What is the highest number of gold medals when the silver is less than 0?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" text,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest number of gold medals when the silver is less than 0?`:
```sql
|
SELECT MAX("nepalis_admitted") FROM "immigration" WHERE "sri_lankans_admitted">'5,520' AND "bangladeshis_admitted">'2,715' AND "pakistanis_admitted">'139,574'; |
## Task
Generate a SQL query to answer the following question:
`What was the most Nepalis admitted when the number of Sri Lankans was more than 5,520, Bangladeshis was more than 2,715, and Pakistanis more than 139,574?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "immigration" (
"year" text,
"indians_admitted" real,
"pakistanis_admitted" real,
"sri_lankans_admitted" real,
"bangladeshis_admitted" real,
"nepalis_admitted" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the most Nepalis admitted when the number of Sri Lankans was more than 5,520, Bangladeshis was more than 2,715, and Pakistanis more than 139,574?`:
```sql
|
SELECT MIN("sri_lankans_admitted") FROM "immigration" WHERE "bangladeshis_admitted">'4,270' AND "pakistanis_admitted">'4,986'; |
## Task
Generate a SQL query to answer the following question:
`What were the fewest number of Sri Lankans admitted when more than 4,270 Bangladeshis and more than 4,986 Pakistanis were admitted?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "immigration" (
"year" text,
"indians_admitted" real,
"pakistanis_admitted" real,
"sri_lankans_admitted" real,
"bangladeshis_admitted" real,
"nepalis_admitted" real
);
### SQL
Given the database schema, here is the SQL query that answers `What were the fewest number of Sri Lankans admitted when more than 4,270 Bangladeshis and more than 4,986 Pakistanis were admitted?`:
```sql
|
SELECT SUM("sri_lankans_admitted") FROM "immigration" WHERE "year"='2004' AND "nepalis_admitted">594; |
## Task
Generate a SQL query to answer the following question:
`How many Sri Lankans were admitted in 2004 when more than 594 Nepalis were admitted?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "immigration" (
"year" text,
"indians_admitted" real,
"pakistanis_admitted" real,
"sri_lankans_admitted" real,
"bangladeshis_admitted" real,
"nepalis_admitted" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many Sri Lankans were admitted in 2004 when more than 594 Nepalis were admitted?`:
```sql
|
SELECT AVG("bangladeshis_admitted") FROM "immigration" WHERE "nepalis_admitted"=714 AND "pakistanis_admitted">'13,575'; |
## Task
Generate a SQL query to answer the following question:
`How many Bangladeshis were admitted when 714 Nepalis and 13,575 Pakistanis were admitted?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "immigration" (
"year" text,
"indians_admitted" real,
"pakistanis_admitted" real,
"sri_lankans_admitted" real,
"bangladeshis_admitted" real,
"nepalis_admitted" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many Bangladeshis were admitted when 714 Nepalis and 13,575 Pakistanis were admitted?`:
```sql
|
SELECT MAX("nepalis_admitted") FROM "immigration" WHERE "bangladeshis_admitted"<'1,896'; |
## Task
Generate a SQL query to answer the following question:
`What was the most Nepalis admitted when fewer than 1,896 Bangladeshis were admitted?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "immigration" (
"year" text,
"indians_admitted" real,
"pakistanis_admitted" real,
"sri_lankans_admitted" real,
"bangladeshis_admitted" real,
"nepalis_admitted" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the most Nepalis admitted when fewer than 1,896 Bangladeshis were admitted?`:
```sql
|
SELECT "frequency" FROM "special_editions" WHERE "first_published"='april 27, 2010'; |
## Task
Generate a SQL query to answer the following question:
`What is the frequency that the magazine issues that was first published on april 27, 2010?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "special_editions" (
"title" text,
"parent_magazine" text,
"magazine_type" text,
"frequency" text,
"first_published" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the frequency that the magazine issues that was first published on april 27, 2010?`:
```sql
|
SELECT "magazine_type" FROM "special_editions" WHERE "title"='dengeki game appli'; |
## Task
Generate a SQL query to answer the following question:
`What was the type of the magazine that was named dengeki game appli?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "special_editions" (
"title" text,
"parent_magazine" text,
"magazine_type" text,
"frequency" text,
"first_published" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the type of the magazine that was named dengeki game appli?`:
```sql
|
SELECT "title" FROM "special_editions" WHERE "magazine_type"='video game' AND "frequency"='bimonthly'; |
## Task
Generate a SQL query to answer the following question:
`What is the name of the video game magazine that was issued bimonthly?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "special_editions" (
"title" text,
"parent_magazine" text,
"magazine_type" text,
"frequency" text,
"first_published" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the name of the video game magazine that was issued bimonthly?`:
```sql
|
SELECT "parent_magazine" FROM "special_editions" WHERE "frequency"='bimonthly' AND "magazine_type"='manga' AND "title"='dengeki moeoh'; |
## Task
Generate a SQL query to answer the following question:
`What was the parent magazine for the manga magazine, dengeki moeoh that was issued bimonthly?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "special_editions" (
"title" text,
"parent_magazine" text,
"magazine_type" text,
"frequency" text,
"first_published" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the parent magazine for the manga magazine, dengeki moeoh that was issued bimonthly?`:
```sql
|
SELECT "parent_magazine" FROM "special_editions" WHERE "first_published"='december 16, 2004'; |
## Task
Generate a SQL query to answer the following question:
`What was the parent magazine of the magazine that was first published on december 16, 2004?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "special_editions" (
"title" text,
"parent_magazine" text,
"magazine_type" text,
"frequency" text,
"first_published" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the parent magazine of the magazine that was first published on december 16, 2004?`:
```sql
|
SELECT AVG("overall") FROM "washington_redskins_draft_history" WHERE "pick"=22 AND "college"='rice' AND "round">10; |
## Task
Generate a SQL query to answer the following question:
`WHAT IS THE OVERALL AVERAGE WITH A 22 PICK, FROM RICE COLLEGE, AND ROUND BIGGER THAN 10?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "washington_redskins_draft_history" (
"round" real,
"pick" real,
"overall" real,
"name" text,
"position" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT IS THE OVERALL AVERAGE WITH A 22 PICK, FROM RICE COLLEGE, AND ROUND BIGGER THAN 10?`:
```sql
|
SELECT "position" FROM "washington_redskins_draft_history" WHERE "pick"=23; |
## Task
Generate a SQL query to answer the following question:
`WHAT POSITION HAS A 23 PICK?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "washington_redskins_draft_history" (
"round" real,
"pick" real,
"overall" real,
"name" text,
"position" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT POSITION HAS A 23 PICK?`:
```sql
|
SELECT AVG("overall") FROM "washington_redskins_draft_history" WHERE "round">9 AND "position"='rb'; |
## Task
Generate a SQL query to answer the following question:
`WHAT IS THE AVERAGE OVERALL WITH A ROUND LARGER THAN 9, AND RB POSITION?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "washington_redskins_draft_history" (
"round" real,
"pick" real,
"overall" real,
"name" text,
"position" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT IS THE AVERAGE OVERALL WITH A ROUND LARGER THAN 9, AND RB POSITION?`:
```sql
|
SELECT COUNT("overall") FROM "washington_redskins_draft_history" WHERE "round">7 AND "pick"=21; |
## Task
Generate a SQL query to answer the following question:
`WHAT IS THE TOTAL NUMBER WITH A ROUND BIGGER THAN 7 AND PICK OF 21?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "washington_redskins_draft_history" (
"round" real,
"pick" real,
"overall" real,
"name" text,
"position" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT IS THE TOTAL NUMBER WITH A ROUND BIGGER THAN 7 AND PICK OF 21?`:
```sql
|
SELECT "position" FROM "washington_redskins_draft_history" WHERE "overall"=273; |
## Task
Generate a SQL query to answer the following question:
`WHAT POSITION IS 273?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "washington_redskins_draft_history" (
"round" real,
"pick" real,
"overall" real,
"name" text,
"position" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT POSITION IS 273?`:
```sql
|
SELECT MIN("stls") FROM "college_statistics" WHERE "rebs">8.6; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest Stls, when Rebs is greater than 8.6?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "college_statistics" (
"year" text,
"rebs" real,
"asts" real,
"stls" real,
"blks" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest Stls, when Rebs is greater than 8.6?`:
```sql
|
SELECT SUM("blks") FROM "college_statistics" WHERE "stls"=1 AND "rebs">8.6; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "college_statistics" (
"year" text,
"rebs" real,
"asts" real,
"stls" real,
"blks" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6?`:
```sql
|
SELECT "opponent" FROM "schedule_and_results" WHERE "october"<18 AND "game"=3; |
## Task
Generate a SQL query to answer the following question:
`Which opponent played in game 3 before October 18?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule_and_results" (
"game" real,
"october" real,
"opponent" text,
"score" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which opponent played in game 3 before October 18?`:
```sql
|
SELECT "game" FROM "schedule_and_results" WHERE "october">24 AND "record"='6-2-1'; |
## Task
Generate a SQL query to answer the following question:
`Which game was after October 24 and had a record of 6-2-1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule_and_results" (
"game" real,
"october" real,
"opponent" text,
"score" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which game was after October 24 and had a record of 6-2-1?`:
```sql
|
SELECT MIN("pick") FROM "nfl_draft" WHERE "round">12 AND "position"='kicker'; |
## Task
Generate a SQL query to answer the following question:
`What was the lowest pick for the kicker after round 12?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "nfl_draft" (
"round" real,
"pick" real,
"player" text,
"position" text,
"school" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the lowest pick for the kicker after round 12?`:
```sql
|
SELECT SUM("pick") FROM "nfl_draft" WHERE "round"<11 AND "player"='charley casey'; |
## Task
Generate a SQL query to answer the following question:
`How many picks had less than 11 rounds and a player of Charley Casey?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "nfl_draft" (
"round" real,
"pick" real,
"player" text,
"position" text,
"school" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many picks had less than 11 rounds and a player of Charley Casey?`:
```sql
|
SELECT SUM("round") FROM "nfl_draft" WHERE "position"='kicker'; |
## Task
Generate a SQL query to answer the following question:
`How many rounds had a position of kicker?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "nfl_draft" (
"round" real,
"pick" real,
"player" text,
"position" text,
"school" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many rounds had a position of kicker?`:
```sql
|
SELECT "position" FROM "nfl_draft" WHERE "pick">80 AND "player"='walt mainer'; |
## Task
Generate a SQL query to answer the following question:
`Which position had a pick larger than 80 and Walt Mainer as a player?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "nfl_draft" (
"round" real,
"pick" real,
"player" text,
"position" text,
"school" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which position had a pick larger than 80 and Walt Mainer as a player?`:
```sql
|
SELECT "score" FROM "round_11" WHERE "away"='deportes savio'; |
## Task
Generate a SQL query to answer the following question:
`What is the score of the match with deportes savio as the away team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_11" (
"date" text,
"home" text,
"score" text,
"away" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the score of the match with deportes savio as the away team?`:
```sql
|
SELECT COUNT("attendance") FROM "round_11" WHERE "score"='1:2'; |
## Task
Generate a SQL query to answer the following question:
`What is the total attendance of the match with a 1:2 score?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_11" (
"date" text,
"home" text,
"score" text,
"away" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the total attendance of the match with a 1:2 score?`:
```sql
|
SELECT "home" FROM "round_11" WHERE "attendance"<2248 AND "score"='2:0' AND "date"='21 september 2008'; |
## Task
Generate a SQL query to answer the following question:
`What is the home team of the match on 21 September 2008 with an attendance less than 2248 and a 2:0 score?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_11" (
"date" text,
"home" text,
"score" text,
"away" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the home team of the match on 21 September 2008 with an attendance less than 2248 and a 2:0 score?`:
```sql
|
SELECT MAX("attendance") FROM "round_11" WHERE "score"='2:0' AND "away"='vida'; |
## Task
Generate a SQL query to answer the following question:
`What is the highest attendance of the match with a 2:0 score and vida as the away team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_11" (
"date" text,
"home" text,
"score" text,
"away" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest attendance of the match with a 2:0 score and vida as the away team?`:
```sql
|
SELECT "score" FROM "round_11" WHERE "home"='olimpia'; |
## Task
Generate a SQL query to answer the following question:
`What is the score of the home team olimpia?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_11" (
"date" text,
"home" text,
"score" text,
"away" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the score of the home team olimpia?`:
```sql
|
SELECT "score" FROM "round_11" WHERE "attendance"=2248; |
## Task
Generate a SQL query to answer the following question:
`What is the score of the match with an attendance of 2248?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_11" (
"date" text,
"home" text,
"score" text,
"away" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the score of the match with an attendance of 2248?`:
```sql
|
SELECT MAX("seats_up_for_election") FROM "results" WHERE "election_result">8 AND "staying_councillors"=24; |
## Task
Generate a SQL query to answer the following question:
`Which Seats up for election have an Election result larger than 8, and Staying councillors of 24?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "results" (
"party" text,
"previous_council" real,
"staying_councillors" real,
"seats_up_for_election" real,
"election_result" real,
"new_council" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which Seats up for election have an Election result larger than 8, and Staying councillors of 24?`:
```sql
|
SELECT AVG("new_council") FROM "results" WHERE "election_result">24; |
## Task
Generate a SQL query to answer the following question:
`Which New council has an Election result larger than 24?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "results" (
"party" text,
"previous_council" real,
"staying_councillors" real,
"seats_up_for_election" real,
"election_result" real,
"new_council" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which New council has an Election result larger than 24?`:
```sql
|
SELECT AVG("staying_councillors") FROM "results" WHERE "new_council"=7 AND "previous_council">8; |
## Task
Generate a SQL query to answer the following question:
`Which Staying councillors have a New council of 7, and a Previous council larger than 8?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "results" (
"party" text,
"previous_council" real,
"staying_councillors" real,
"seats_up_for_election" real,
"election_result" real,
"new_council" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which Staying councillors have a New council of 7, and a Previous council larger than 8?`:
```sql
|
SELECT "record" FROM "game_log" WHERE "game"<24 AND "location"='miami arena'; |
## Task
Generate a SQL query to answer the following question:
`What was the record when they played in the Miami Arena, before game 24?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"opponent" text,
"score" text,
"location" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the record when they played in the Miami Arena, before game 24?`:
```sql
|
SELECT "opponent" FROM "game_log" WHERE "game">26 AND "record"='23-4'; |
## Task
Generate a SQL query to answer the following question:
`Who was the opponent when they played after Game 26 and their record was 23-4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"opponent" text,
"score" text,
"location" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the opponent when they played after Game 26 and their record was 23-4?`:
```sql
|
SELECT "date" FROM "game_log" WHERE "location"='boston garden' AND "record"='22-4'; |
## Task
Generate a SQL query to answer the following question:
`On what date did they play in Boston Garden with a record of 22-4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"opponent" text,
"score" text,
"location" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `On what date did they play in Boston Garden with a record of 22-4?`:
```sql
|
SELECT "record" FROM "game_log" WHERE "location"='boston garden' AND "date"='wed. dec. 5'; |
## Task
Generate a SQL query to answer the following question:
`What was their record on Wed. Dec. 5, when they played in Boston Garden?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"opponent" text,
"score" text,
"location" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was their record on Wed. Dec. 5, when they played in Boston Garden?`:
```sql
|
SELECT "place" FROM "second_round" WHERE "player"='lon hinkle'; |
## Task
Generate a SQL query to answer the following question:
`What place in Lon Hinkle in?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "second_round" (
"place" text,
"player" text,
"country" text,
"score" text,
"to_par" text
);
### SQL
Given the database schema, here is the SQL query that answers `What place in Lon Hinkle in?`:
```sql
|
SELECT "country" FROM "second_round" WHERE "player"='mark hayes'; |
## Task
Generate a SQL query to answer the following question:
`What country does Mark Hayes play for?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "second_round" (
"place" text,
"player" text,
"country" text,
"score" text,
"to_par" text
);
### SQL
Given the database schema, here is the SQL query that answers `What country does Mark Hayes play for?`:
```sql
|
SELECT SUM("to_par") FROM "made_the_cut" WHERE "country"='united states' AND "year_s_won"='1973'; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of To Par, when Country is "United States", and when Year(s) Won is "1973"?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "made_the_cut" (
"player" text,
"country" text,
"year_s_won" text,
"total" real,
"to_par" real,
"finish" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of To Par, when Country is "United States", and when Year(s) Won is "1973"?`:
```sql
|
SELECT "player" FROM "made_the_cut" WHERE "total">288 AND "country"='south africa'; |
## Task
Generate a SQL query to answer the following question:
`What is Player, when Total is greater than 288, and when Country is "South Africa"?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "made_the_cut" (
"player" text,
"country" text,
"year_s_won" text,
"total" real,
"to_par" real,
"finish" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is Player, when Total is greater than 288, and when Country is "South Africa"?`:
```sql
|
SELECT "year_s_won" FROM "made_the_cut" WHERE "to_par">13; |
## Task
Generate a SQL query to answer the following question:
`What is Year(s) Won, when To Par is greater than 13?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "made_the_cut" (
"player" text,
"country" text,
"year_s_won" text,
"total" real,
"to_par" real,
"finish" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is Year(s) Won, when To Par is greater than 13?`:
```sql
|
SELECT "residence" FROM "members_of_the_georgia_state_house_of_re" WHERE "representative"='quincy murphy'; |
## Task
Generate a SQL query to answer the following question:
`What residence has representative Quincy Murphy?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "members_of_the_georgia_state_house_of_re" (
"district" real,
"representative" text,
"party" text,
"first_elected" real,
"residence" text
);
### SQL
Given the database schema, here is the SQL query that answers `What residence has representative Quincy Murphy?`:
```sql
|
SELECT "home_captain" FROM "test_matches" WHERE "venue"='adelaide oval'; |
## Task
Generate a SQL query to answer the following question:
`Who is the home captain when the venue is adelaide oval?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "test_matches" (
"date" text,
"home_captain" text,
"away_captain" text,
"venue" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who is the home captain when the venue is adelaide oval?`:
```sql
|
SELECT "score" FROM "pre_season" WHERE "date"='september 20'; |
## Task
Generate a SQL query to answer the following question:
`What was the score in the September 20 game?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pre_season" (
"date" text,
"time" text,
"opponent" text,
"location" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score in the September 20 game?`:
```sql
|
SELECT "location" FROM "pre_season" WHERE "date"='september 22'; |
## Task
Generate a SQL query to answer the following question:
`Where was the September 22 game played?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pre_season" (
"date" text,
"time" text,
"opponent" text,
"location" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `Where was the September 22 game played?`:
```sql
|
SELECT "score" FROM "pre_season" WHERE "date"='september 26'; |
## Task
Generate a SQL query to answer the following question:
`What was the score in the September 26 game?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pre_season" (
"date" text,
"time" text,
"opponent" text,
"location" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score in the September 26 game?`:
```sql
|
SELECT "opponent" FROM "pre_season" WHERE "time"='7:30pm'; |
## Task
Generate a SQL query to answer the following question:
`Who was the opposing team in the game(s) that started at 7:30pm?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pre_season" (
"date" text,
"time" text,
"opponent" text,
"location" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the opposing team in the game(s) that started at 7:30pm?`:
```sql
|
SELECT "score" FROM "pre_season" WHERE "time"='7:00pm' AND "location"='scotiabank place' AND "opponent"='philadelphia flyers'; |
## Task
Generate a SQL query to answer the following question:
`What was the score of the 7:00pm game at Scotiabank Place against the Philadelphia Flyers?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pre_season" (
"date" text,
"time" text,
"opponent" text,
"location" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score of the 7:00pm game at Scotiabank Place against the Philadelphia Flyers?`:
```sql
|
SELECT "attendance" FROM "schedule" WHERE "date"='october 26'; |
## Task
Generate a SQL query to answer the following question:
`What is the attendance of the match on October 26?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule" (
"date" text,
"opponentnum" text,
"rank_num" text,
"site" text,
"result" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the attendance of the match on October 26?`:
```sql
|
SELECT "opponentnum" FROM "schedule" WHERE "result"='w27-16'; |
## Task
Generate a SQL query to answer the following question:
`What is the opponent number of the match with a w27-16 result?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule" (
"date" text,
"opponentnum" text,
"rank_num" text,
"site" text,
"result" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the opponent number of the match with a w27-16 result?`:
```sql
|
SELECT "result" FROM "schedule" WHERE "attendance"='73,855'; |
## Task
Generate a SQL query to answer the following question:
`What is the result of the match with an attendance of 73,855?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule" (
"date" text,
"opponentnum" text,
"rank_num" text,
"site" text,
"result" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the result of the match with an attendance of 73,855?`:
```sql
|
SELECT "rank_num" FROM "schedule" WHERE "date"='october 19'; |
## Task
Generate a SQL query to answer the following question:
`What is the rank of the match on October 19?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule" (
"date" text,
"opponentnum" text,
"rank_num" text,
"site" text,
"result" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the rank of the match on October 19?`:
```sql
|
SELECT "scorers" FROM "league_cup" WHERE "opponent"='aberdeen'; |
## Task
Generate a SQL query to answer the following question:
`Who was the scorer when the opponent was aberdeen?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "league_cup" (
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real,
"scorers" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the scorer when the opponent was aberdeen?`:
```sql
|
SELECT "date" FROM "league_cup" WHERE "scorers"='mccoist (3), johnston, butcher, steven'; |
## Task
Generate a SQL query to answer the following question:
`When was the scorer mccoist (3), johnston, butcher, steven?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "league_cup" (
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real,
"scorers" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was the scorer mccoist (3), johnston, butcher, steven?`:
```sql
|
SELECT "score" FROM "game_log" WHERE "visitor"='pittsburgh' AND "points">18; |
## Task
Generate a SQL query to answer the following question:
`What is Score, when Visitor is "Pittsburgh", and when Points is greater than 18?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"attendance" real,
"record" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is Score, when Visitor is "Pittsburgh", and when Points is greater than 18?`:
```sql
|
SELECT SUM("points") FROM "game_log" WHERE "home"='pittsburgh' AND "date"='december 21' AND "attendance">'5,307'; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of Points, when Home is "Pittsburgh", when Date is "December 21", and when Attendance is greater than 5,307?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"attendance" real,
"record" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of Points, when Home is "Pittsburgh", when Date is "December 21", and when Attendance is greater than 5,307?`:
```sql
|
SELECT MIN("points") FROM "game_log" WHERE "home"='boston'; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest Points, when Home is "Boston"?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"attendance" real,
"record" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest Points, when Home is "Boston"?`:
```sql
|
SELECT "team" FROM "game_log" WHERE "high_points"='charlie villanueva (24)'; |
## Task
Generate a SQL query to answer the following question:
`what is the team when the high points is by charlie villanueva (24)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the team when the high points is by charlie villanueva (24)?`:
```sql
|
SELECT "location_attendance" FROM "game_log" WHERE "high_assists"='ramon sessions (8)' AND "date"='march 30'; |
## Task
Generate a SQL query to answer the following question:
`what is the location attendance when the high assists is by ramon sessions (8) on march 30?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the location attendance when the high assists is by ramon sessions (8) on march 30?`:
```sql
|
SELECT "high_rebounds" FROM "game_log" WHERE "score"='l 85–102 (ot)'; |
## Task
Generate a SQL query to answer the following question:
`Who had the high rebounds when the score was l 85–102 (ot)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who had the high rebounds when the score was l 85–102 (ot)?`:
```sql
|
SELECT "location_attendance" FROM "game_log" WHERE "score"='w 86–77 (ot)'; |
## Task
Generate a SQL query to answer the following question:
`what is the location attendance when the score is w 86–77 (ot)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the location attendance when the score is w 86–77 (ot)?`:
```sql
|
SELECT "date" FROM "game_log" WHERE "high_assists"='ramon sessions (8)' AND "high_points"='richard jefferson (29)' AND "score"='w 107–78 (ot)'; |
## Task
Generate a SQL query to answer the following question:
`what is the date when ramon sessions (8) had the high assists, richard jefferson (29) had the high points and the score was w 107–78 (ot)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the date when ramon sessions (8) had the high assists, richard jefferson (29) had the high points and the score was w 107–78 (ot)?`:
```sql
|
SELECT "high_rebounds" FROM "game_log" WHERE "team"='@ toronto'; |
## Task
Generate a SQL query to answer the following question:
`who had the high rebounds when the team was @ toronto?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `who had the high rebounds when the team was @ toronto?`:
```sql
|
SELECT MIN("pole") FROM "by_season" WHERE "f_lap">5 AND "race"<155; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest pole with a Flap larger than 5, and a before race 155?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "by_season" (
"season" text,
"race" real,
"podium" real,
"pole" real,
"f_lap" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest pole with a Flap larger than 5, and a before race 155?`:
```sql
|
SELECT COUNT("score") FROM "first_round" WHERE "player"='fred couples'; |
## Task
Generate a SQL query to answer the following question:
`What was Fred Couples' score?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "first_round" (
"place" text,
"player" text,
"country" text,
"score" real,
"to_par" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was Fred Couples' score?`:
```sql
|
SELECT "to_par" FROM "first_round" WHERE "country"='united states' AND "score">69 AND "player"='payne stewart'; |
## Task
Generate a SQL query to answer the following question:
`When Payne Stewart of the United States scored higher than 69, what was the To Par?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "first_round" (
"place" text,
"player" text,
"country" text,
"score" real,
"to_par" text
);
### SQL
Given the database schema, here is the SQL query that answers `When Payne Stewart of the United States scored higher than 69, what was the To Par?`:
```sql
|
SELECT SUM("population_2008") FROM "north_korea_dprk" WHERE "korean"='함흥'; |
## Task
Generate a SQL query to answer the following question:
`What is the 2008 population in 함흥 (Ham Hyung)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "north_korea_dprk" (
"city" text,
"korean" text,
"hancha" text,
"province" text,
"population_2008" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the 2008 population in 함흥 (Ham Hyung)?`:
```sql
|
SELECT "mountain_peak" FROM "the_200_most_topographically_prominent_m" WHERE "location"='53.1370°n 119.2667°w'; |
## Task
Generate a SQL query to answer the following question:
`what is the mountain peak when the location is 53.1370°n 119.2667°w?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "the_200_most_topographically_prominent_m" (
"rank" real,
"mountain_peak" text,
"region" text,
"mountain_range" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the mountain peak when the location is 53.1370°n 119.2667°w?`:
```sql
|
SELECT "region" FROM "the_200_most_topographically_prominent_m" WHERE "location"='49.7462°n 117.1419°w'; |
## Task
Generate a SQL query to answer the following question:
`what is the region when the location is 49.7462°n 117.1419°w?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "the_200_most_topographically_prominent_m" (
"rank" real,
"mountain_peak" text,
"region" text,
"mountain_range" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the region when the location is 49.7462°n 117.1419°w?`:
```sql
|
SELECT "rank" FROM "the_200_most_topographically_prominent_m" WHERE "mountain_peak"='isthmus peak'; |
## Task
Generate a SQL query to answer the following question:
`what is the rank when the mountain peak is isthmus peak?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "the_200_most_topographically_prominent_m" (
"rank" real,
"mountain_peak" text,
"region" text,
"mountain_range" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the rank when the mountain peak is isthmus peak?`:
```sql
|
SELECT "mountain_range" FROM "the_200_most_topographically_prominent_m" WHERE "region"='british columbia' AND "mountain_peak"='mount edziza'; |
## Task
Generate a SQL query to answer the following question:
`what is the mountain range when the region is british columbia and mountain pea is mount edziza?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "the_200_most_topographically_prominent_m" (
"rank" real,
"mountain_peak" text,
"region" text,
"mountain_range" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the mountain range when the region is british columbia and mountain pea is mount edziza?`:
```sql
|
SELECT "born_died" FROM "1914_1925" WHERE "name"='xhafer bej ypi'; |
## Task
Generate a SQL query to answer the following question:
`What is the Born-Died dates of Xhafer Bej Ypi?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1914_1925" (
"name" text,
"born_died" text,
"term_start" text,
"term_end" text,
"political_party" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Born-Died dates of Xhafer Bej Ypi?`:
```sql
|
SELECT "name" FROM "1914_1925" WHERE "born_died"='1873–1933'; |
## Task
Generate a SQL query to answer the following question:
`What is the Name of the Prime Minister with a Born-Died of 1873–1933?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1914_1925" (
"name" text,
"born_died" text,
"term_start" text,
"term_end" text,
"political_party" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Name of the Prime Minister with a Born-Died of 1873–1933?`:
```sql
|
SELECT "term_start" FROM "1914_1925" WHERE "political_party"='progressive party'; |
## Task
Generate a SQL query to answer the following question:
`What is the Term Start date of the Progressive Party Prime Minister?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1914_1925" (
"name" text,
"born_died" text,
"term_start" text,
"term_end" text,
"political_party" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Term Start date of the Progressive Party Prime Minister?`:
```sql
|
SELECT SUM("lead_margin") FROM "opinion_polling_for_the_united_states_gu" WHERE "democrat_brian_schweitzer"='55%' AND "libertarian_stan_jones"='2%'; |
## Task
Generate a SQL query to answer the following question:
`What was the lead margin when Schweitzer had 55% and Jones had 2%?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "opinion_polling_for_the_united_states_gu" (
"poll_source" text,
"dates_administered" text,
"democrat_brian_schweitzer" text,
"republican_roy_brown" text,
"libertarian_stan_jones" text,
"lead_margin" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the lead margin when Schweitzer had 55% and Jones had 2%?`:
```sql
|
SELECT "republican_roy_brown" FROM "opinion_polling_for_the_united_states_gu" WHERE "lead_margin"=26; |
## Task
Generate a SQL query to answer the following question:
`What is the percentage for Brown when the lead margin is 26?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "opinion_polling_for_the_united_states_gu" (
"poll_source" text,
"dates_administered" text,
"democrat_brian_schweitzer" text,
"republican_roy_brown" text,
"libertarian_stan_jones" text,
"lead_margin" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the percentage for Brown when the lead margin is 26?`:
```sql
|
SELECT "democrat_brian_schweitzer" FROM "opinion_polling_for_the_united_states_gu" WHERE "lead_margin"=29; |
## Task
Generate a SQL query to answer the following question:
`What is the percentage for Schweitzer when the lead margin is 29?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "opinion_polling_for_the_united_states_gu" (
"poll_source" text,
"dates_administered" text,
"democrat_brian_schweitzer" text,
"republican_roy_brown" text,
"libertarian_stan_jones" text,
"lead_margin" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the percentage for Schweitzer when the lead margin is 29?`:
```sql
|
SELECT MAX("lead_margin") FROM "opinion_polling_for_the_united_states_gu" WHERE "democrat_brian_schweitzer"='55%' AND "libertarian_stan_jones"='not an option'; |
## Task
Generate a SQL query to answer the following question:
`What is the largest lead margin when Schweitzer has 55% and Jones is not an option?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "opinion_polling_for_the_united_states_gu" (
"poll_source" text,
"dates_administered" text,
"democrat_brian_schweitzer" text,
"republican_roy_brown" text,
"libertarian_stan_jones" text,
"lead_margin" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the largest lead margin when Schweitzer has 55% and Jones is not an option?`:
```sql
|
SELECT "record" FROM "game_log" WHERE "date"='november 22'; |
## Task
Generate a SQL query to answer the following question:
`What is Record, when Date is "November 22"?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"decision" text,
"attendance" real,
"record" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is Record, when Date is "November 22"?`:
```sql
|
SELECT "date" FROM "game_log" WHERE "attendance">'20,066' AND "visitor"='boston bruins'; |
## Task
Generate a SQL query to answer the following question:
`What is Date, when Attendance is greater than 20,066, and when Visitor is "Boston Bruins"?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"decision" text,
"attendance" real,
"record" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is Date, when Attendance is greater than 20,066, and when Visitor is "Boston Bruins"?`:
```sql
|
SELECT COUNT("attendance") FROM "schedule" WHERE "week"<1; |
## Task
Generate a SQL query to answer the following question:
`What is the attendance before week 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "schedule" (
"week" real,
"date" text,
"opponent" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the attendance before week 1?`:
```sql
|
SELECT "date" FROM "lpga_tour_wins_13" WHERE "winning_score"='–7 (67-72-69-69=277)'; |
## Task
Generate a SQL query to answer the following question:
`What was the date of the match with a winning score of –7 (67-72-69-69=277)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "lpga_tour_wins_13" (
"date" text,
"tournament" text,
"winning_score" text,
"margin_of_victory" text,
"runner_s_up" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the date of the match with a winning score of –7 (67-72-69-69=277)?`:
```sql
|
SELECT "home_team" FROM "first_round_proper" WHERE "away_team"='millwall'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team in the match with an away team of Millwall?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "first_round_proper" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the home team in the match with an away team of Millwall?`:
```sql
|
SELECT "score" FROM "first_round_proper" WHERE "home_team"='kidderminster harriers'; |
## Task
Generate a SQL query to answer the following question:
`What is the score for the match that had a home team of Kidderminster Harriers?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "first_round_proper" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the score for the match that had a home team of Kidderminster Harriers?`:
```sql
|
SELECT "date" FROM "first_round_proper" WHERE "tie_no"='replay' AND "home_team"='huddersfield town'; |
## Task
Generate a SQL query to answer the following question:
`What is the date of the match with a home team of Huddersfield Town and was a replay tie?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "first_round_proper" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the date of the match with a home team of Huddersfield Town and was a replay tie?`:
```sql
|
SELECT "home_team" FROM "first_round_proper" WHERE "tie_no"='11'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team for tie number 11?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "first_round_proper" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the home team for tie number 11?`:
```sql
|
SELECT "rider" FROM "race_2_1000cc_superbike_race_final_stand" WHERE "speed"='120.953 mph'; |
## Task
Generate a SQL query to answer the following question:
`Who was the rider with 120.953 mph speed?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race_2_1000cc_superbike_race_final_stand" (
"rank" real,
"rider" text,
"team" text,
"time" text,
"speed" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the rider with 120.953 mph speed?`:
```sql
|
SELECT "time" FROM "race_2_1000cc_superbike_race_final_stand" WHERE "rider"='steve plater'; |
## Task
Generate a SQL query to answer the following question:
`What time did rider steve plater have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race_2_1000cc_superbike_race_final_stand" (
"rank" real,
"rider" text,
"team" text,
"time" text,
"speed" text
);
### SQL
Given the database schema, here is the SQL query that answers `What time did rider steve plater have?`:
```sql
|
SELECT "rank" FROM "race_2_1000cc_superbike_race_final_stand" WHERE "speed"='120.979 mph' AND "rider"='gary johnson'; |
## Task
Generate a SQL query to answer the following question:
`What is the rank of rider gary johnson, who had a speed of 120.979 mph?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race_2_1000cc_superbike_race_final_stand" (
"rank" real,
"rider" text,
"team" text,
"time" text,
"speed" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the rank of rider gary johnson, who had a speed of 120.979 mph?`:
```sql
|
SELECT "club" FROM "group_ii" WHERE "draws"<8 AND "points"=37 AND "goals_for"<71; |
## Task
Generate a SQL query to answer the following question:
`What club has less than 8 draws, 37 points, and less than 71 goals?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "group_ii" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `What club has less than 8 draws, 37 points, and less than 71 goals?`:
```sql
|
SELECT COUNT("goals_for") FROM "group_ii" WHERE "draws"=3 AND "losses">18 AND "played"<38; |
## Task
Generate a SQL query to answer the following question:
`What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "group_ii" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.