output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT "competition" FROM "competitions" WHERE "final_position_round"='2'; |
## Task
Generate a SQL query to answer the following question:
`Which competition had a final position/round of 2?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competitions" (
"competition" text,
"current_position_round" text,
"final_position_round" text,
"first_match" text,
"last_match" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which competition had a final position/round of 2?`:
```sql
|
SELECT "first_match" FROM "competitions" WHERE "final_position_round"='third qualifying round'; |
## Task
Generate a SQL query to answer the following question:
`Which first match had a final position/round in the third qualifying round?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competitions" (
"competition" text,
"current_position_round" text,
"final_position_round" text,
"first_match" text,
"last_match" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which first match had a final position/round in the third qualifying round?`:
```sql
|
SELECT MIN("bronze") FROM "multiple_asian_games_gold_medalists" WHERE "gold"=2 AND "total">6; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest number of bronze medals for nations with over 6 total and 2 golds?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "multiple_asian_games_gold_medalists" (
"athlete" text,
"sport" text,
"asian_games" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest number of bronze medals for nations with over 6 total and 2 golds?`:
```sql
|
SELECT COUNT("silver") FROM "multiple_asian_games_gold_medalists" WHERE "sport"='karate' AND "gold">2; |
## Task
Generate a SQL query to answer the following question:
`What is the total number of silver medals for karate athletes with over 2 golds?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "multiple_asian_games_gold_medalists" (
"athlete" text,
"sport" text,
"asian_games" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the total number of silver medals for karate athletes with over 2 golds?`:
```sql
|
SELECT "2009" FROM "doubles" WHERE "2010"='1r' AND "2011"='a'; |
## Task
Generate a SQL query to answer the following question:
`What is the 2009 value with a 1r in 2010 and A in 2011?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "doubles" (
"tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"career_win_loss" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the 2009 value with a 1r in 2010 and A in 2011?`:
```sql
|
SELECT "2009" FROM "doubles" WHERE "2010"='a'; |
## Task
Generate a SQL query to answer the following question:
`What is the 2009 value with a 2010 A value?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "doubles" (
"tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"career_win_loss" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the 2009 value with a 2010 A value?`:
```sql
|
SELECT "2010" FROM "doubles" WHERE "2008"='a' AND "2011"='a' AND "2012"='2r'; |
## Task
Generate a SQL query to answer the following question:
`What is the 2010 value with A in 2008, A in 2011, and 2r in 2012?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "doubles" (
"tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"career_win_loss" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the 2010 value with A in 2008, A in 2011, and 2r in 2012?`:
```sql
|
SELECT AVG("attendance") FROM "game_log" WHERE "date"='april 24'; |
## Task
Generate a SQL query to answer the following question:
`What is the average attendance on april 24?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"opponent" text,
"score" text,
"loss" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average attendance on april 24?`:
```sql
|
SELECT "away_team_score" FROM "round_12" WHERE "away_team"='richmond'; |
## Task
Generate a SQL query to answer the following question:
`What was the score of the away team when Richmond played?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score of the away team when Richmond played?`:
```sql
|
SELECT "constructor" FROM "race" WHERE "laps"=16 AND "grid"=9; |
## Task
Generate a SQL query to answer the following question:
`What company was Constructor when there were 16 laps and grid was 9?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What company was Constructor when there were 16 laps and grid was 9?`:
```sql
|
SELECT "time_retired" FROM "race" WHERE "constructor"='lotus - ford' AND "laps"<17; |
## Task
Generate a SQL query to answer the following question:
`What is the Time/Retired when lotus - ford was constructor and the laps were less than 17?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Time/Retired when lotus - ford was constructor and the laps were less than 17?`:
```sql
|
SELECT SUM("grid") FROM "race" WHERE "time_retired"='engine' AND "laps"<9; |
## Task
Generate a SQL query to answer the following question:
`What is the number of the grid when there was a Time/Retired of engine and less than 9 laps?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the number of the grid when there was a Time/Retired of engine and less than 9 laps?`:
```sql
|
SELECT AVG("attendance") FROM "2007_08_peterborough_united_f_c_season" WHERE "venue"='home' AND "result"='w 3-0'; |
## Task
Generate a SQL query to answer the following question:
`what was the attendance for a home venue and a w 3-0 result?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_08_peterborough_united_f_c_season" (
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `what was the attendance for a home venue and a w 3-0 result?`:
```sql
|
SELECT MAX("attendance") FROM "2007_08_peterborough_united_f_c_season" WHERE "venue"='home' AND "result"='w 3-1'; |
## Task
Generate a SQL query to answer the following question:
`what was the attendance at the home venue with result w 3-1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_08_peterborough_united_f_c_season" (
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `what was the attendance at the home venue with result w 3-1?`:
```sql
|
SELECT "venue" FROM "2007_08_peterborough_united_f_c_season" WHERE "opponent"='rochdale'; |
## Task
Generate a SQL query to answer the following question:
`where did rochdale play as opponent?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_08_peterborough_united_f_c_season" (
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `where did rochdale play as opponent?`:
```sql
|
SELECT "home_team" FROM "fixtures" WHERE "crowd">'18,345' AND "stadium"='adelaide oval'; |
## Task
Generate a SQL query to answer the following question:
`Which home team played in front of 18,345 people in Adelaide Oval?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "fixtures" (
"round" real,
"date" text,
"home_team" text,
"score" text,
"away_team" text,
"crowd" real,
"stadium" text,
"match_details" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which home team played in front of 18,345 people in Adelaide Oval?`:
```sql
|
SELECT "away_team" FROM "fixtures" WHERE "stadium"='adelaide oval'; |
## Task
Generate a SQL query to answer the following question:
`Which team was hosted at Adelaide Oval?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "fixtures" (
"round" real,
"date" text,
"home_team" text,
"score" text,
"away_team" text,
"crowd" real,
"stadium" text,
"match_details" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which team was hosted at Adelaide Oval?`:
```sql
|
SELECT "year" FROM "by_year" WHERE "report"='not held'; |
## Task
Generate a SQL query to answer the following question:
`When was a report not held?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "by_year" (
"year" text,
"driver" text,
"constructor" text,
"location" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was a report not held?`:
```sql
|
SELECT "visitor" FROM "game_log" WHERE "home"='vancouver'; |
## Task
Generate a SQL query to answer the following question:
`Who was the visitor when vancouver was at home?`
### 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
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the visitor when vancouver was at home?`:
```sql
|
SELECT "decision" FROM "game_log" WHERE "visitor"='new jersey'; |
## Task
Generate a SQL query to answer the following question:
`What is the decision when new jersey was away?`
### 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
);
### SQL
Given the database schema, here is the SQL query that answers `What is the decision when new jersey was away?`:
```sql
|
SELECT "scale" FROM "message_format" WHERE "name"='ura index'; |
## Task
Generate a SQL query to answer the following question:
`What is URA Index scale?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "message_format" (
"subframe_num" real,
"page_num" text,
"name" text,
"word_num" real,
"bits" text,
"scale" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is URA Index scale?`:
```sql
|
SELECT "scale" FROM "message_format" WHERE "word_num"<4 AND "name"='sv_health'; |
## Task
Generate a SQL query to answer the following question:
`What is the scale of sv_health with a word number smaller than 4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "message_format" (
"subframe_num" real,
"page_num" text,
"name" text,
"word_num" real,
"bits" text,
"scale" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the scale of sv_health with a word number smaller than 4?`:
```sql
|
SELECT "team" FROM "list_of_winners" WHERE "sport"='tennis' AND "nation_of_citizenship"='united states'; |
## Task
Generate a SQL query to answer the following question:
`Which tennis team is from the United States?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_winners" (
"year_of_award" real,
"athlete" text,
"nation_of_citizenship" text,
"team" text,
"competition_governing_body_or_league" text,
"sport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which tennis team is from the United States?`:
```sql
|
SELECT "nation_of_citizenship" FROM "list_of_winners" WHERE "year_of_award">2011; |
## Task
Generate a SQL query to answer the following question:
`What is the nation of citizenship for athletes later than 2011 year of award?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_winners" (
"year_of_award" real,
"athlete" text,
"nation_of_citizenship" text,
"team" text,
"competition_governing_body_or_league" text,
"sport" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the nation of citizenship for athletes later than 2011 year of award?`:
```sql
|
SELECT "constructor" FROM "race" WHERE "grid"<5 AND "driver"='michael schumacher'; |
## Task
Generate a SQL query to answer the following question:
`What Constructor did Michael Schumacher have with a Grid smaller than 5?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What Constructor did Michael Schumacher have with a Grid smaller than 5?`:
```sql
|
SELECT "driver" FROM "race" WHERE "time_retired"='+1 lap'; |
## Task
Generate a SQL query to answer the following question:
`Which driver has a Time/Retired of +1 lap?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which driver has a Time/Retired of +1 lap?`:
```sql
|
SELECT "apparatus" FROM "detailed_olympic_results" WHERE "score_final">17.75; |
## Task
Generate a SQL query to answer the following question:
`Which apparatus had a final score that was more than 17.75?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "detailed_olympic_results" (
"year" real,
"competition_description" text,
"location" text,
"apparatus" text,
"score_final" real,
"score_qualifying" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which apparatus had a final score that was more than 17.75?`:
```sql
|
SELECT "competition_description" FROM "detailed_olympic_results" WHERE "apparatus"='ribbon'; |
## Task
Generate a SQL query to answer the following question:
`Which competition description's apparatus was ribbon?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "detailed_olympic_results" (
"year" real,
"competition_description" text,
"location" text,
"apparatus" text,
"score_final" real,
"score_qualifying" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which competition description's apparatus was ribbon?`:
```sql
|
SELECT "score_qualifying" FROM "detailed_olympic_results" WHERE "apparatus"='hoop'; |
## Task
Generate a SQL query to answer the following question:
`Which Qualifying score had hoop as an apparatus?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "detailed_olympic_results" (
"year" real,
"competition_description" text,
"location" text,
"apparatus" text,
"score_final" real,
"score_qualifying" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which Qualifying score had hoop as an apparatus?`:
```sql
|
SELECT COUNT("score_qualifying") FROM "detailed_olympic_results" WHERE "score_final"=16.625; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of qualifying scores when the final score is 16.625?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "detailed_olympic_results" (
"year" real,
"competition_description" text,
"location" text,
"apparatus" text,
"score_final" real,
"score_qualifying" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of qualifying scores when the final score is 16.625?`:
```sql
|
SELECT "date" FROM "round_9" WHERE "venue"='princes park'; |
## Task
Generate a SQL query to answer the following question:
`When was the game played at Princes Park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was the game played at Princes Park?`:
```sql
|
SELECT "home_team_score" FROM "round_9" WHERE "home_team"='melbourne'; |
## Task
Generate a SQL query to answer the following question:
`What did Melbourne score as the home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What did Melbourne score as the home team?`:
```sql
|
SELECT "position" FROM "high_school_players_and_coaches_of_the_y" WHERE "high_school"='malvern prep'; |
## Task
Generate a SQL query to answer the following question:
`What position does the player from malvern prep play?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "high_school_players_and_coaches_of_the_y" (
"year" real,
"player" text,
"position" text,
"high_school" text,
"hometown" text,
"mlb_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `What position does the player from malvern prep play?`:
```sql
|
SELECT "team" FROM "points" WHERE "points">572 AND "games">29; |
## Task
Generate a SQL query to answer the following question:
`What team scored more than 572 points and had more than 29 games?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "points" (
"rank" real,
"name" text,
"team" text,
"games" real,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What team scored more than 572 points and had more than 29 games?`:
```sql
|
SELECT MIN("games") FROM "points" WHERE "rank">1 AND "name"='luis scola'; |
## Task
Generate a SQL query to answer the following question:
`What is the least amount of games for Luis scola with a rank greater than 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "points" (
"rank" real,
"name" text,
"team" text,
"games" real,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the least amount of games for Luis scola with a rank greater than 1?`:
```sql
|
SELECT "identity" FROM "steam_locomotives" WHERE "builder"='brighton works'; |
## Task
Generate a SQL query to answer the following question:
`What is the identity of the brighton works built train?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "steam_locomotives" (
"identity" text,
"builder" text,
"built" real,
"wheel_arrangement" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the identity of the brighton works built train?`:
```sql
|
SELECT "attendance" FROM "smythe_division_final_vs_3" WHERE "date"='may 13'; |
## Task
Generate a SQL query to answer the following question:
`What was the attendance on May 13?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "smythe_division_final_vs_3" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"decision" text,
"attendance" real,
"series" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the attendance on May 13?`:
```sql
|
SELECT MAX("quantity") FROM "locomotives_of_the_great_western_railway" WHERE "ptrd_nos"='3, 15'; |
## Task
Generate a SQL query to answer the following question:
`What is the highest Quantity for PTRD Nos. 3, 15?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives_of_the_great_western_railway" (
"manufacturer" text,
"type" text,
"quantity" real,
"ptrd_nos" text,
"gwr_nos" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest Quantity for PTRD Nos. 3, 15?`:
```sql
|
SELECT COUNT("hosted") FROM "match_attendance" WHERE "average"='27,638'; |
## Task
Generate a SQL query to answer the following question:
`How many were hosted whene the average attendance was 27,638?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "match_attendance" (
"team" text,
"hosted" real,
"average" real,
"highest" real,
"lowest" real,
"total" real,
"last_year" real,
"up_down" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many were hosted whene the average attendance was 27,638?`:
```sql
|
SELECT MIN("last_year") FROM "match_attendance" WHERE "hosted">176; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest attendance last year when more than 176 were hosted?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "match_attendance" (
"team" text,
"hosted" real,
"average" real,
"highest" real,
"lowest" real,
"total" real,
"last_year" real,
"up_down" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest attendance last year when more than 176 were hosted?`:
```sql
|
SELECT AVG("1970") FROM "population_growth_history" WHERE "2010_est"='171,750' AND "2000"<'131,714'; |
## Task
Generate a SQL query to answer the following question:
`Of 2010 est. with less than 171,750 and 2000 less than 131,714, what is the 1970 population average?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population_growth_history" (
"city" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2010_est" real
);
### SQL
Given the database schema, here is the SQL query that answers `Of 2010 est. with less than 171,750 and 2000 less than 131,714, what is the 1970 population average?`:
```sql
|
SELECT AVG("1980") FROM "population_growth_history" WHERE "1990">'19,988' AND "1970"<'10,522'; |
## Task
Generate a SQL query to answer the following question:
`With 1990 growth greater than 19,988 and 1970 growth less than 10,522, what is the 1980 average?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population_growth_history" (
"city" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2010_est" real
);
### SQL
Given the database schema, here is the SQL query that answers `With 1990 growth greater than 19,988 and 1970 growth less than 10,522, what is the 1980 average?`:
```sql
|
SELECT COUNT("1970") FROM "population_growth_history" WHERE "2000"<'32,093' AND "1980">'64,975'; |
## Task
Generate a SQL query to answer the following question:
`Of 2000 growth less than 32,093 and 1980 growth over 64,975, what is the 1970 total number?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population_growth_history" (
"city" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2010_est" real
);
### SQL
Given the database schema, here is the SQL query that answers `Of 2000 growth less than 32,093 and 1980 growth over 64,975, what is the 1970 total number?`:
```sql
|
SELECT COUNT("1990") FROM "population_growth_history" WHERE "1970"<'10,522'; |
## Task
Generate a SQL query to answer the following question:
`How many 1990 growth numbers had less than 10,522 in 1970?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population_growth_history" (
"city" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2010_est" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many 1990 growth numbers had less than 10,522 in 1970?`:
```sql
|
SELECT MIN("1980") FROM "population_growth_history" WHERE "1970"='2,610'; |
## Task
Generate a SQL query to answer the following question:
`Which is the lowest 1980 growth that had 2,610 in 1970?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population_growth_history" (
"city" text,
"1970" real,
"1980" real,
"1990" real,
"2000" real,
"2010_est" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which is the lowest 1980 growth that had 2,610 in 1970?`:
```sql
|
SELECT MAX("laps") FROM "race" WHERE "grid"<4 AND "time_retired"='+ 1 lap'; |
## Task
Generate a SQL query to answer the following question:
`What is the high lap total that has a grid of less than 4 and a Time/Retired of + 1 lap?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the high lap total that has a grid of less than 4 and a Time/Retired of + 1 lap?`:
```sql
|
SELECT COUNT("laps") FROM "race" WHERE "time_retired"='+ 1:25.475'; |
## Task
Generate a SQL query to answer the following question:
`How many laps associated with a Time/Retired of + 1:25.475?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many laps associated with a Time/Retired of + 1:25.475?`:
```sql
|
SELECT "venue" FROM "round_12" WHERE "away_team_score"='12.15 (87)'; |
## Task
Generate a SQL query to answer the following question:
`Where was the game played where the away team scored 12.15 (87)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Where was the game played where the away team scored 12.15 (87)?`:
```sql
|
SELECT "away_team" FROM "round_12" WHERE "home_team_score"='13.12 (90)'; |
## Task
Generate a SQL query to answer the following question:
`Which away team played a home team with the score of 13.12 (90)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which away team played a home team with the score of 13.12 (90)?`:
```sql
|
SELECT "away_team_score" FROM "round_12" WHERE "home_team_score"='19.17 (131)'; |
## Task
Generate a SQL query to answer the following question:
`What is the score for the away team when the home team scored 19.17 (131)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the score for the away team when the home team scored 19.17 (131)?`:
```sql
|
SELECT "home_team_score" FROM "round_14" WHERE "venue"='princes park'; |
## Task
Generate a SQL query to answer the following question:
`What was the home teams score when the VFL played Princes Park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_14" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the home teams score when the VFL played Princes Park?`:
```sql
|
SELECT "away_team_score" FROM "round_14" WHERE "home_team"='geelong'; |
## Task
Generate a SQL query to answer the following question:
`What was the opponents score when Geelong played as home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_14" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the opponents score when Geelong played as home team?`:
```sql
|
SELECT "home_team_score" FROM "round_14" WHERE "venue"='kardinia park'; |
## Task
Generate a SQL query to answer the following question:
`What was the home teams score when the VFL played at Kardinia Park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_14" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the home teams score when the VFL played at Kardinia Park?`:
```sql
|
SELECT "date" FROM "round_14" WHERE "away_team"='fitzroy'; |
## Task
Generate a SQL query to answer the following question:
`When did Fitzroy play as the away team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_14" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `When did Fitzroy play as the away team?`:
```sql
|
SELECT AVG("goals") FROM "all_time_top_scorers" WHERE "apps"=234 AND "rank"<8; |
## Task
Generate a SQL query to answer the following question:
`What is the average number of goals of the player with 234 apps and a rank above 8?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "all_time_top_scorers" (
"rank" real,
"player" text,
"goals" real,
"apps" real,
"avg_game" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average number of goals of the player with 234 apps and a rank above 8?`:
```sql
|
SELECT AVG("avg_game") FROM "all_time_top_scorers" WHERE "goals"=97 AND "rank"<7; |
## Task
Generate a SQL query to answer the following question:
`What is the average avg/game of the player with 97 goals and a rank above 7?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "all_time_top_scorers" (
"rank" real,
"player" text,
"goals" real,
"apps" real,
"avg_game" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average avg/game of the player with 97 goals and a rank above 7?`:
```sql
|
SELECT MAX("won_pg") FROM "clausura_2007_standings" WHERE "goals_conceded_gc"<21 AND "played_pj"<18; |
## Task
Generate a SQL query to answer the following question:
`What is the highest number of games won where less than 21 games were conceded and less than 18 games were actually played?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clausura_2007_standings" (
"place_posici_n" real,
"team_equipo" text,
"played_pj" real,
"won_pg" real,
"draw_pe" real,
"lost_pp" real,
"goals_scored_gf" real,
"goals_conceded_gc" real,
"dif" real,
"points_pts" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest number of games won where less than 21 games were conceded and less than 18 games were actually played?`:
```sql
|
SELECT AVG("goals_conceded_gc") FROM "clausura_2007_standings" WHERE "goals_scored_gf">19 AND "points_pts"=31 AND "draw_pe">7; |
## Task
Generate a SQL query to answer the following question:
`What is the average number of goals conceded where more than 19 goals were scored, the team had 31 points, and more than 7 draws?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clausura_2007_standings" (
"place_posici_n" real,
"team_equipo" text,
"played_pj" real,
"won_pg" real,
"draw_pe" real,
"lost_pp" real,
"goals_scored_gf" real,
"goals_conceded_gc" real,
"dif" real,
"points_pts" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average number of goals conceded where more than 19 goals were scored, the team had 31 points, and more than 7 draws?`:
```sql
|
SELECT "goals_conceded_gc" FROM "clausura_2007_standings" WHERE "lost_pp"=7 AND "team_equipo"='chepo f.c.'; |
## Task
Generate a SQL query to answer the following question:
`How many goals were conceded against the Chepo F.C. team where they lost 7 games?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clausura_2007_standings" (
"place_posici_n" real,
"team_equipo" text,
"played_pj" real,
"won_pg" real,
"draw_pe" real,
"lost_pp" real,
"goals_scored_gf" real,
"goals_conceded_gc" real,
"dif" real,
"points_pts" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many goals were conceded against the Chepo F.C. team where they lost 7 games?`:
```sql
|
SELECT MIN("crowd") FROM "round_15" WHERE "venue"='junction oval'; |
## Task
Generate a SQL query to answer the following question:
`What was the smallest crowd at junction oval?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_15" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the smallest crowd at junction oval?`:
```sql
|
SELECT "state" FROM "notes" WHERE "member"='richard foster'; |
## Task
Generate a SQL query to answer the following question:
`What state has Richard Foster as a member?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "notes" (
"member" text,
"party" text,
"electorate" text,
"state" text,
"first_elected" text
);
### SQL
Given the database schema, here is the SQL query that answers `What state has Richard Foster as a member?`:
```sql
|
SELECT "member" FROM "notes" WHERE "electorate"='cook'; |
## Task
Generate a SQL query to answer the following question:
`Which member has Cook as the electorate?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "notes" (
"member" text,
"party" text,
"electorate" text,
"state" text,
"first_elected" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which member has Cook as the electorate?`:
```sql
|
SELECT "driver" FROM "teams_and_drivers" WHERE "chassis"='625 553 500'; |
## Task
Generate a SQL query to answer the following question:
`Who was the driver with chassis 625 553 500?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"entrant" text,
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the driver with chassis 625 553 500?`:
```sql
|
SELECT "tyre" FROM "teams_and_drivers" WHERE "constructor"='cooper - bristol' AND "driver"='bob gerard'; |
## Task
Generate a SQL query to answer the following question:
`What was tyre that was made by cooper - bristol that was driven by bob gerard?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"entrant" text,
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was tyre that was made by cooper - bristol that was driven by bob gerard?`:
```sql
|
SELECT "constructor" FROM "teams_and_drivers" WHERE "entrant"='officine alfieri maserati' AND "driver"='sergio mantovani'; |
## Task
Generate a SQL query to answer the following question:
`Who was the constructor of the officine alfieri maserati that was driven by Sergio Mantovani?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"entrant" text,
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the constructor of the officine alfieri maserati that was driven by Sergio Mantovani?`:
```sql
|
SELECT "tyre" FROM "teams_and_drivers" WHERE "driver"='sergio mantovani'; |
## Task
Generate a SQL query to answer the following question:
`What tyre had Sergio Mantovani as a driver?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"entrant" text,
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `What tyre had Sergio Mantovani as a driver?`:
```sql
|
SELECT "entrant" FROM "teams_and_drivers" WHERE "constructor"='maserati' AND "tyre"='p' AND "chassis"='250f a6gcm' AND "driver"='luigi villoresi'; |
## Task
Generate a SQL query to answer the following question:
`Can you say what was the entrant of maserati built item with a Tyre of p with a chassis of 250f a6gcm that was driven by Luigi Villoresi?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"entrant" text,
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `Can you say what was the entrant of maserati built item with a Tyre of p with a chassis of 250f a6gcm that was driven by Luigi Villoresi?`:
```sql
|
SELECT "dutch" FROM "vocabulary_comparison" WHERE "english"='one'; |
## Task
Generate a SQL query to answer the following question:
`What is the dutch word for one?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "vocabulary_comparison" (
"english" text,
"scots" text,
"west_frisian" text,
"afrikaans" text,
"dutch" text,
"dutch_limburgish" text,
"low_german" text,
"low_german_groningen" text,
"middle_german_luxemburgish" text,
"german" text,
"yiddish" text,
"gothic" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the dutch word for one?`:
```sql
|
SELECT "middle_german_luxemburgish" FROM "vocabulary_comparison" WHERE "dutch_limburgish"='ein'; |
## Task
Generate a SQL query to answer the following question:
`What is the Middle German (Luxemburgish) word for ein?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "vocabulary_comparison" (
"english" text,
"scots" text,
"west_frisian" text,
"afrikaans" text,
"dutch" text,
"dutch_limburgish" text,
"low_german" text,
"low_german_groningen" text,
"middle_german_luxemburgish" text,
"german" text,
"yiddish" text,
"gothic" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Middle German (Luxemburgish) word for ein?`:
```sql
|
SELECT "middle_german_luxemburgish" FROM "vocabulary_comparison" WHERE "english"='stone'; |
## Task
Generate a SQL query to answer the following question:
`What is the Middle German (Luxemburgish) word for stone?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "vocabulary_comparison" (
"english" text,
"scots" text,
"west_frisian" text,
"afrikaans" text,
"dutch" text,
"dutch_limburgish" text,
"low_german" text,
"low_german_groningen" text,
"middle_german_luxemburgish" text,
"german" text,
"yiddish" text,
"gothic" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Middle German (Luxemburgish) word for stone?`:
```sql
|
SELECT "dutch" FROM "vocabulary_comparison" WHERE "low_german_groningen"='høvd / høvur'; |
## Task
Generate a SQL query to answer the following question:
`What is the Dutch waord for høvd / høvur?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "vocabulary_comparison" (
"english" text,
"scots" text,
"west_frisian" text,
"afrikaans" text,
"dutch" text,
"dutch_limburgish" text,
"low_german" text,
"low_german_groningen" text,
"middle_german_luxemburgish" text,
"german" text,
"yiddish" text,
"gothic" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Dutch waord for høvd / høvur?`:
```sql
|
SELECT "english" FROM "vocabulary_comparison" WHERE "dutch_limburgish"='twie'; |
## Task
Generate a SQL query to answer the following question:
`What is the English word for twie?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "vocabulary_comparison" (
"english" text,
"scots" text,
"west_frisian" text,
"afrikaans" text,
"dutch" text,
"dutch_limburgish" text,
"low_german" text,
"low_german_groningen" text,
"middle_german_luxemburgish" text,
"german" text,
"yiddish" text,
"gothic" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the English word for twie?`:
```sql
|
SELECT "constructor" FROM "teams_and_drivers" WHERE "rounds"='8' AND "chassis"='156 158 1512'; |
## Task
Generate a SQL query to answer the following question:
`What is the constructor on the team with 8 rounds and a chassis of 156 158 1512?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the constructor on the team with 8 rounds and a chassis of 156 158 1512?`:
```sql
|
SELECT "driver" FROM "teams_and_drivers" WHERE "tyre"='d' AND "chassis"='bt11' AND "rounds"='8'; |
## Task
Generate a SQL query to answer the following question:
`Who is the driver of the team with tyre d, bt11 chassis, and 8 rounds?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "teams_and_drivers" (
"constructor" text,
"chassis" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who is the driver of the team with tyre d, bt11 chassis, and 8 rounds?`:
```sql
|
SELECT AVG("bronze") FROM "medal_table" WHERE "silver"<1 AND "gold">0; |
## Task
Generate a SQL query to answer the following question:
`What is the number of bronze that silver is smaller than 1 and gold bigger than 0?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the number of bronze that silver is smaller than 1 and gold bigger than 0?`:
```sql
|
SELECT "name" FROM "leading_points_scorers" WHERE "nation"='france' AND "pts_game">3 AND "points"<33; |
## Task
Generate a SQL query to answer the following question:
`what is the name when the nation is France, the pts/game is more than 3 and points is less than 33?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "leading_points_scorers" (
"name" text,
"nation" text,
"points" real,
"games" real,
"pts_game" real
);
### SQL
Given the database schema, here is the SQL query that answers `what is the name when the nation is France, the pts/game is more than 3 and points is less than 33?`:
```sql
|
SELECT "pts_game" FROM "leading_points_scorers" WHERE "games"=5 AND "name"='charlotte barras'; |
## Task
Generate a SQL query to answer the following question:
`what is the pts/game for Charlotte barras and the games is 5?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "leading_points_scorers" (
"name" text,
"nation" text,
"points" real,
"games" real,
"pts_game" real
);
### SQL
Given the database schema, here is the SQL query that answers `what is the pts/game for Charlotte barras and the games is 5?`:
```sql
|
SELECT AVG("points") FROM "leading_points_scorers" WHERE "nation"='wales' AND "pts_game">5; |
## Task
Generate a SQL query to answer the following question:
`what is the average points when the nation is wales and the pts/game is more than 5?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "leading_points_scorers" (
"name" text,
"nation" text,
"points" real,
"games" real,
"pts_game" real
);
### SQL
Given the database schema, here is the SQL query that answers `what is the average points when the nation is wales and the pts/game is more than 5?`:
```sql
|
SELECT MIN("year") FROM "achievements" WHERE "venue"='barcelona, spain'; |
## Task
Generate a SQL query to answer the following question:
`When is the earliest year for it is in barcelona, spain?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text
);
### SQL
Given the database schema, here is the SQL query that answers `When is the earliest year for it is in barcelona, spain?`:
```sql
|
SELECT AVG("year") FROM "achievements" WHERE "position"='5th' AND "venue"='santiago, chile'; |
## Task
Generate a SQL query to answer the following question:
`What is the average year they finished 5th in santiago, chile?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average year they finished 5th in santiago, chile?`:
```sql
|
SELECT MIN("pick") FROM "round_1" WHERE "player"='michael holper'; |
## Task
Generate a SQL query to answer the following question:
`Which pick was MIchael Holper?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"pick" real,
"player" text,
"country_of_origin" text,
"pba_team" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which pick was MIchael Holper?`:
```sql
|
SELECT "country_of_origin" FROM "round_1" WHERE "player"='leo najorda'; |
## Task
Generate a SQL query to answer the following question:
`Which country is Leo Najorda from?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"pick" real,
"player" text,
"country_of_origin" text,
"pba_team" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which country is Leo Najorda from?`:
```sql
|
SELECT MIN("pick") FROM "round_1" WHERE "country_of_origin"='united states' AND "college"='hawaii-hilo'; |
## Task
Generate a SQL query to answer the following question:
`Which United States player from Hawaii-Hilo had the lowest pick?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"pick" real,
"player" text,
"country_of_origin" text,
"pba_team" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which United States player from Hawaii-Hilo had the lowest pick?`:
```sql
|
SELECT "player" FROM "round_1" WHERE "pick"<9 AND "country_of_origin"='united states' AND "pba_team"='air21 express'; |
## Task
Generate a SQL query to answer the following question:
`Which United States player for Air21 Express had a pick smaller than 9?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"pick" real,
"player" text,
"country_of_origin" text,
"pba_team" text,
"college" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which United States player for Air21 Express had a pick smaller than 9?`:
```sql
|
SELECT AVG("gold") FROM "medal_table" WHERE "nation"='russia (rus)' AND "silver"<2; |
## Task
Generate a SQL query to answer the following question:
`What is the average Gold where the Nation is Russia (rus) and the number of silver is less than 2?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" real,
"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 average Gold where the Nation is Russia (rus) and the number of silver is less than 2?`:
```sql
|
SELECT SUM("total") FROM "medal_table" WHERE "nation"='south africa (rsa)' AND "bronze"<1; |
## Task
Generate a SQL query to answer the following question:
`What is the total where the nation is South Africa (rsa) and bronze is less than 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" real,
"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 total where the nation is South Africa (rsa) and bronze is less than 1?`:
```sql
|
SELECT "nation" FROM "medal_table" WHERE "gold"=0 AND "rank">14 AND "total"=1 AND "silver"<1; |
## Task
Generate a SQL query to answer the following question:
`Which nation has 0 gold, a rank greater than 14, a total of 1, and silver less than 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which nation has 0 gold, a rank greater than 14, a total of 1, and silver less than 1?`:
```sql
|
SELECT "home_team" FROM "round_21" WHERE "venue"='vfl park'; |
## Task
Generate a SQL query to answer the following question:
`Tell me the home team for vfl park venue`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_21" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Tell me the home team for vfl park venue`:
```sql
|
SELECT "home_team" FROM "round_21" WHERE "venue"='mcg'; |
## Task
Generate a SQL query to answer the following question:
`Tell me the home team for venue of mcg`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_21" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Tell me the home team for venue of mcg`:
```sql
|
SELECT MAX("crowd") FROM "round_21" WHERE "venue"='arden street oval'; |
## Task
Generate a SQL query to answer the following question:
`Tell me the most crowd for arden street oval venue`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_21" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Tell me the most crowd for arden street oval venue`:
```sql
|
SELECT "away_team_score" FROM "round_7" WHERE "home_team"='south melbourne'; |
## Task
Generate a SQL query to answer the following question:
`What was the away team's score when South Melbourne was the home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_7" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the away team's score when South Melbourne was the home team?`:
```sql
|
SELECT "home_team" FROM "round_7" WHERE "home_team_score"='19.18 (132)'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team that scored 19.18 (132)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_7" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the home team that scored 19.18 (132)?`:
```sql
|
SELECT COUNT("placings") FROM "ice_dancing" WHERE "nation"='east germany'; |
## Task
Generate a SQL query to answer the following question:
`What was the placing of the nation of East Germany?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "ice_dancing" (
"rank" real,
"name" text,
"nation" text,
"total_points" real,
"placings" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the placing of the nation of East Germany?`:
```sql
|
SELECT MAX("level") FROM "club_career_stats" WHERE "team"='astana' AND "season">2007; |
## Task
Generate a SQL query to answer the following question:
`What's the highest level of team Astana since 2007?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "club_career_stats" (
"season" real,
"team" text,
"country" text,
"league" text,
"level" real,
"apps" real,
"goals" real
);
### SQL
Given the database schema, here is the SQL query that answers `What's the highest level of team Astana since 2007?`:
```sql
|
SELECT AVG("goals") FROM "most_points_for_the_club" WHERE "points"<882 AND "field_goals"<5 AND "player"='ty williams' AND "tries"<85; |
## Task
Generate a SQL query to answer the following question:
`What is the average amount of goals that has a points smaller of 882, less than 5 field goals, and less than 85 tries all by Ty Williams.`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "most_points_for_the_club" (
"points" real,
"player" text,
"tries" real,
"goals" real,
"field_goals" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average amount of goals that has a points smaller of 882, less than 5 field goals, and less than 85 tries all by Ty Williams.`:
```sql
|
SELECT "away_team" FROM "round_9" WHERE "venue"='western oval'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team at Western Oval?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team at Western Oval?`:
```sql
|
SELECT "home_team" FROM "round_9" WHERE "away_team"='collingwood'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team that played against Collingwood?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the home team that played against Collingwood?`:
```sql
|
SELECT AVG("crowd") FROM "round_9" WHERE "home_team"='richmond'; |
## Task
Generate a SQL query to answer the following question:
`What is the average crowd size for Richmond home games?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average crowd size for Richmond home games?`:
```sql
|
SELECT MAX("crowd") FROM "round_9" WHERE "home_team"='north melbourne'; |
## Task
Generate a SQL query to answer the following question:
`What is the largest crowd for North Melbourne home games?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the largest crowd for North Melbourne home games?`:
```sql
|
SELECT "venue" FROM "round_9" WHERE "home_team"='melbourne'; |
## Task
Generate a SQL query to answer the following question:
`In which venue does Melbourne play as the home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_9" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `In which venue does Melbourne play as the home team?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.