output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT "playoffs" FROM "year_by_year" WHERE "open_cup"='did not qualify' AND "regular_season"='3rd, south atlantic'; |
## Task
Generate a SQL query to answer the following question:
`What shows for Playoffs when the Open Cup shows as did not qualify, and a Regular Season was 3rd, south atlantic?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "year_by_year" (
"year" real,
"division" real,
"league" text,
"regular_season" text,
"playoffs" text,
"open_cup" text
);
### SQL
Given the database schema, here is the SQL query that answers `What shows for Playoffs when the Open Cup shows as did not qualify, and a Regular Season was 3rd, south atlantic?`:
```sql
|
SELECT MAX("points") FROM "grand_prix_motorcycle_racing_results" WHERE "year"=1962 AND "class"='125cc' AND "wins"<0; |
## Task
Generate a SQL query to answer the following question:
`What is the highest points value for 1962, in the 125cc class, and with 0 wins?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_prix_motorcycle_racing_results" (
"year" real,
"class" text,
"team" text,
"points" real,
"wins" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest points value for 1962, in the 125cc class, and with 0 wins?`:
```sql
|
SELECT MAX("points") FROM "grand_prix_motorcycle_racing_results" WHERE "class"='500cc' AND "year">1962 AND "wins"<0; |
## Task
Generate a SQL query to answer the following question:
`What is the highest points value for the 500cc class in years after 1962 with 0 wins?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_prix_motorcycle_racing_results" (
"year" real,
"class" text,
"team" text,
"points" real,
"wins" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest points value for the 500cc class in years after 1962 with 0 wins?`:
```sql
|
SELECT COUNT("points") FROM "grand_prix_motorcycle_racing_results" WHERE "team"='ajs' AND "wins"<0; |
## Task
Generate a SQL query to answer the following question:
`For Team AJS, what is the total number of points for drivers with 0 wins?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_prix_motorcycle_racing_results" (
"year" real,
"class" text,
"team" text,
"points" real,
"wins" real
);
### SQL
Given the database schema, here is the SQL query that answers `For Team AJS, what is the total number of points for drivers with 0 wins?`:
```sql
|
SELECT "year" FROM "complete_formula_one_results" WHERE "points"=0 AND "chassis"='ags jh23b'; |
## Task
Generate a SQL query to answer the following question:
`Which year had 0 points and an AGS JH23B chassis?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which year had 0 points and an AGS JH23B chassis?`:
```sql
|
SELECT "points" FROM "complete_formula_one_results" WHERE "year">1986 AND "chassis"='ags jh23b'; |
## Task
Generate a SQL query to answer the following question:
`How many points does the year after 1986 with a AGS JH23B chassis have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many points does the year after 1986 with a AGS JH23B chassis have?`:
```sql
|
SELECT "points" FROM "complete_formula_one_results" WHERE "entrant"='tyrrell racing organisation'; |
## Task
Generate a SQL query to answer the following question:
`How many points did the Tyrrell Racing Organisation have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_results" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many points did the Tyrrell Racing Organisation have?`:
```sql
|
SELECT "week" FROM "schedule" WHERE "date"='september 23, 1973'; |
## Task
Generate a SQL query to answer the following question:
`September 23, 1973 landed on which week of the season?`
### 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 `September 23, 1973 landed on which week of the season?`:
```sql
|
SELECT MIN("gold") FROM "medal_table" WHERE "rank">4 AND "total"<1; |
## Task
Generate a SQL query to answer the following question:
`What's the lowest Gold if the Rank is over 4 but the Total 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's the lowest Gold if the Rank is over 4 but the Total is less than 1?`:
```sql
|
SELECT MAX("bronze") FROM "medal_table" WHERE "rank"<1; |
## Task
Generate a SQL query to answer the following question:
`What's the highest bronze with a less than 1 Rank?`
### 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's the highest bronze with a less than 1 Rank?`:
```sql
|
SELECT AVG("total") FROM "medal_table" WHERE "bronze"=5 AND "silver"<4; |
## Task
Generate a SQL query to answer the following question:
`What's the average total if the Bronze is 5 and the Silver is less than 4?`
### 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's the average total if the Bronze is 5 and the Silver is less than 4?`:
```sql
|
SELECT "votes" FROM "106_seats" WHERE "residence"='halifax'; |
## Task
Generate a SQL query to answer the following question:
`How many Votes, when the Residence is Halifax?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "106_seats" (
"riding" text,
"candidate_s_name" text,
"gender" text,
"residence" text,
"occupation" text,
"votes" real,
"rank" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many Votes, when the Residence is Halifax?`:
```sql
|
SELECT "riding" FROM "106_seats" WHERE "rank"='4th'; |
## Task
Generate a SQL query to answer the following question:
`What is the Riding, when the Rank is 4th?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "106_seats" (
"riding" text,
"candidate_s_name" text,
"gender" text,
"residence" text,
"occupation" text,
"votes" real,
"rank" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Riding, when the Rank is 4th?`:
```sql
|
SELECT MIN("votes") FROM "106_seats" WHERE "candidate_s_name"='trevor ennis'; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest number of Votes, when the Candidate's Name is Trevor Ennis?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "106_seats" (
"riding" text,
"candidate_s_name" text,
"gender" text,
"residence" text,
"occupation" text,
"votes" real,
"rank" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest number of Votes, when the Candidate's Name is Trevor Ennis?`:
```sql
|
SELECT "candidate_s_name" FROM "106_seats" WHERE "votes"=513; |
## Task
Generate a SQL query to answer the following question:
`What is the Candidate's Name, when the Votes are 513?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "106_seats" (
"riding" text,
"candidate_s_name" text,
"gender" text,
"residence" text,
"occupation" text,
"votes" real,
"rank" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Candidate's Name, when the Votes are 513?`:
```sql
|
SELECT "occupation" FROM "106_seats" WHERE "candidate_s_name"='trevor ennis'; |
## Task
Generate a SQL query to answer the following question:
`What is the Occupation, when the Candidate's Name is Trevor Ennis?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "106_seats" (
"riding" text,
"candidate_s_name" text,
"gender" text,
"residence" text,
"occupation" text,
"votes" real,
"rank" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Occupation, when the Candidate's Name is Trevor Ennis?`:
```sql
|
SELECT MAX("cuts_made") FROM "summary" WHERE "top_25">4 AND "top_5"=1 AND "wins">0; |
## Task
Generate a SQL query to answer the following question:
`Name the most cuts made with top-25 more than 4 and top 5 of 1 with wins more than 0`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "summary" (
"tournament" text,
"wins" real,
"top_5" real,
"top_10" real,
"top_25" real,
"events" real,
"cuts_made" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the most cuts made with top-25 more than 4 and top 5 of 1 with wins more than 0`:
```sql
|
SELECT SUM("top_25") FROM "summary" WHERE "wins"<1 AND "events"=12; |
## Task
Generate a SQL query to answer the following question:
`Name the top-25 with wins less than 1 and events of 12`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "summary" (
"tournament" text,
"wins" real,
"top_5" real,
"top_10" real,
"top_25" real,
"events" real,
"cuts_made" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the top-25 with wins less than 1 and events of 12`:
```sql
|
SELECT "away_team" FROM "northern_section" WHERE "attendance"='7,891'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team when the attendance was 7,891?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "northern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team when the attendance was 7,891?`:
```sql
|
SELECT "score" FROM "northern_section" WHERE "attendance"='1,644'; |
## Task
Generate a SQL query to answer the following question:
`What was the score of the game when the attendance was 1,644?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "northern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score of the game when the attendance was 1,644?`:
```sql
|
SELECT "away_team" FROM "northern_section" WHERE "home_team"='lincoln city'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team when the home team was Lincoln City?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "northern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team when the home team was Lincoln City?`:
```sql
|
SELECT "score" FROM "northern_section" WHERE "home_team"='lincoln city'; |
## Task
Generate a SQL query to answer the following question:
`What was the score of the game when the home team was Lincoln City?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "northern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score of the game when the home team was Lincoln City?`:
```sql
|
SELECT "away_team" FROM "northern_section" WHERE "attendance"='7,891'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team when the attendance was 7,891?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "northern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team when the attendance was 7,891?`:
```sql
|
SELECT MAX("points") FROM "cart_results" WHERE "year"<1983; |
## Task
Generate a SQL query to answer the following question:
`What is the most amount of points for a team before 1983?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "cart_results" (
"year" real,
"team" text,
"chassis" text,
"engine" text,
"rank" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the most amount of points for a team before 1983?`:
```sql
|
SELECT "team" FROM "cart_results" WHERE "points"=4 AND "chassis"='march 82/83c'; |
## Task
Generate a SQL query to answer the following question:
`What team has 4 points and a Chassis of march 82/83c?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "cart_results" (
"year" real,
"team" text,
"chassis" text,
"engine" text,
"rank" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What team has 4 points and a Chassis of march 82/83c?`:
```sql
|
SELECT "engine" FROM "cart_results" WHERE "year">1982 AND "points"=11 AND "team"='curb motorsports'; |
## Task
Generate a SQL query to answer the following question:
`What engine was used by Curb Motorsports after 1982 that had 11 points?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "cart_results" (
"year" real,
"team" text,
"chassis" text,
"engine" text,
"rank" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What engine was used by Curb Motorsports after 1982 that had 11 points?`:
```sql
|
SELECT "engine" FROM "cart_results" WHERE "year"<1983; |
## Task
Generate a SQL query to answer the following question:
`What is the Engine used before 1983?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "cart_results" (
"year" real,
"team" text,
"chassis" text,
"engine" text,
"rank" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Engine used before 1983?`:
```sql
|
SELECT COUNT("average") FROM "best_average_in_a_career" WHERE "matches"<52 AND "runs"<4564 AND "wickets"<265; |
## Task
Generate a SQL query to answer the following question:
`Name the total number of average for wickets less than 265, runs less than 4564 and matches less than 52`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "best_average_in_a_career" (
"matches" real,
"wickets" real,
"runs" real,
"average" real,
"career" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the total number of average for wickets less than 265, runs less than 4564 and matches less than 52`:
```sql
|
SELECT COUNT("average") FROM "best_average_in_a_career" WHERE "wickets">537 AND "career"='1899/00-1925/26' AND "matches"<211; |
## Task
Generate a SQL query to answer the following question:
`Name the total number of average for wickets more than 537, career of 1899/00-1925/26 and matches less than 211`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "best_average_in_a_career" (
"matches" real,
"wickets" real,
"runs" real,
"average" real,
"career" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the total number of average for wickets more than 537, career of 1899/00-1925/26 and matches less than 211`:
```sql
|
SELECT MIN("average") FROM "best_average_in_a_career" WHERE "wickets">265 AND "career"='1888/89-1913/14' AND "matches">51; |
## Task
Generate a SQL query to answer the following question:
`Name the least average with wickets more than 265 and career of 1888/89-1913/14 and matches more than 51`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "best_average_in_a_career" (
"matches" real,
"wickets" real,
"runs" real,
"average" real,
"career" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the least average with wickets more than 265 and career of 1888/89-1913/14 and matches more than 51`:
```sql
|
SELECT COUNT("matches") FROM "best_average_in_a_career" WHERE "wickets"<537 AND "career"='1898/99-1919/20' AND "runs">4476; |
## Task
Generate a SQL query to answer the following question:
`Name the total number of matches with wickets less than 537 and career of 1898/99-1919/20 with runs more than 4476`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "best_average_in_a_career" (
"matches" real,
"wickets" real,
"runs" real,
"average" real,
"career" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the total number of matches with wickets less than 537 and career of 1898/99-1919/20 with runs more than 4476`:
```sql
|
SELECT "opponent" FROM "game_log" WHERE "series"='4-2'; |
## Task
Generate a SQL query to answer the following question:
`Can you tell me the Opponent that has the Series of 4-2?`
### 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,
"series" text
);
### SQL
Given the database schema, here is the SQL query that answers `Can you tell me the Opponent that has the Series of 4-2?`:
```sql
|
SELECT "to_par" FROM "final_leaderboard" WHERE "place"='t4' AND "score"='75-69-74-72=290'; |
## Task
Generate a SQL query to answer the following question:
`What is the to par of the player with a t4 place and a score of 75-69-74-72=290?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "final_leaderboard" (
"place" text,
"player" text,
"country" text,
"score" text,
"to_par" text,
"money" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the to par of the player with a t4 place and a score of 75-69-74-72=290?`:
```sql
|
SELECT "entrant" FROM "complete_formula_one_world_championship_" WHERE "points"<8 AND "chassis"='maserati'; |
## Task
Generate a SQL query to answer the following question:
`Which entrant scored less than 8 points and used a Maserati chassis?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which entrant scored less than 8 points and used a Maserati chassis?`:
```sql
|
SELECT "entrant" FROM "complete_formula_one_world_championship_" WHERE "engine"='offenhauser l4' AND "year"<1955 AND "chassis"='kurtis kraft kk500a' AND "points"=9; |
## Task
Generate a SQL query to answer the following question:
`Which entrant, with an Offenhauser L4 engine and a Kurtis Kraft KK500A chassis, scored 9 points before 1955?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which entrant, with an Offenhauser L4 engine and a Kurtis Kraft KK500A chassis, scored 9 points before 1955?`:
```sql
|
SELECT "engine" FROM "complete_formula_one_world_championship_" WHERE "entrant"='fuel injection'; |
## Task
Generate a SQL query to answer the following question:
`What type of engine did the Fuel Injection entrant use?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What type of engine did the Fuel Injection entrant use?`:
```sql
|
SELECT AVG("points") FROM "complete_formula_one_world_championship_" WHERE "engine"='offenhauser l4' AND "chassis"='trevis'; |
## Task
Generate a SQL query to answer the following question:
`What is the average number of points for an Offenhauser L4 engine with a Trevis chassis?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "complete_formula_one_world_championship_" (
"year" real,
"entrant" text,
"chassis" text,
"engine" text,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average number of points for an Offenhauser L4 engine with a Trevis chassis?`:
```sql
|
SELECT "poll_source" FROM "republican_primary" WHERE "steve_poizner"='37%'; |
## Task
Generate a SQL query to answer the following question:
`What poll had Steve Poizner at 37%?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "republican_primary" (
"poll_source" text,
"date_s_administered" text,
"tom_campbell" text,
"meg_whitman" text,
"steve_poizner" text,
"peter_foy" text
);
### SQL
Given the database schema, here is the SQL query that answers `What poll had Steve Poizner at 37%?`:
```sql
|
SELECT "date_s_administered" FROM "republican_primary" WHERE "meg_whitman"='60%'; |
## Task
Generate a SQL query to answer the following question:
`When did Meg Whitman get 60%?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "republican_primary" (
"poll_source" text,
"date_s_administered" text,
"tom_campbell" text,
"meg_whitman" text,
"steve_poizner" text,
"peter_foy" text
);
### SQL
Given the database schema, here is the SQL query that answers `When did Meg Whitman get 60%?`:
```sql
|
SELECT SUM("round") FROM "round_1" WHERE "team"='boston cannons'; |
## Task
Generate a SQL query to answer the following question:
`How many players were drafted from the Boston Cannons in the round?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"round" real,
"pick" real,
"player" text,
"position" text,
"nationality" text,
"team" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many players were drafted from the Boston Cannons in the round?`:
```sql
|
SELECT MAX("round") FROM "round_1" WHERE "team"='long island lizards'; |
## Task
Generate a SQL query to answer the following question:
`Which round was a player from the Long Island Lizards drafted in first?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"round" real,
"pick" real,
"player" text,
"position" text,
"nationality" text,
"team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which round was a player from the Long Island Lizards drafted in first?`:
```sql
|
SELECT "nationality" FROM "round_1" WHERE "player"='dave curry'; |
## Task
Generate a SQL query to answer the following question:
`Dave Curry has what Nationality?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"round" real,
"pick" real,
"player" text,
"position" text,
"nationality" text,
"team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Dave Curry has what Nationality?`:
```sql
|
SELECT "manufacturer" FROM "moto_gp_classification" WHERE "grid"=11; |
## Task
Generate a SQL query to answer the following question:
`Name the manufacturer with grid of 11`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "moto_gp_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the manufacturer with grid of 11`:
```sql
|
SELECT "manufacturer" FROM "moto_gp_classification" WHERE "grid">18 AND "laps">1 AND "time_retired"='+1 lap'; |
## Task
Generate a SQL query to answer the following question:
`Name the manufacturer for grid more than 18 and laps more than 1 with tired/retired of +1 lap`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "moto_gp_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the manufacturer for grid more than 18 and laps more than 1 with tired/retired of +1 lap`:
```sql
|
SELECT "laps" FROM "moto_gp_classification" WHERE "manufacturer"='suzuki' AND "time_retired"='+1:02.804'; |
## Task
Generate a SQL query to answer the following question:
`Name the laps for suzuki and time/retired of +1:02.804`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "moto_gp_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the laps for suzuki and time/retired of +1:02.804`:
```sql
|
SELECT SUM("laps") FROM "moto_gp_classification" WHERE "grid"=12; |
## Task
Generate a SQL query to answer the following question:
`Name the sum of laps for 12 grids`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "moto_gp_classification" (
"rider" text,
"manufacturer" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the sum of laps for 12 grids`:
```sql
|
SELECT MAX("num_of_total_votes") FROM "election_results_1945_2000" WHERE "pct_of_popular_vote"='32.41%' AND "num_of_seats_won">95; |
## Task
Generate a SQL query to answer the following question:
`Name the most # of total votes with % of popular vote of 32.41% and # of seats won more than 95`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "election_results_1945_2000" (
"election" real,
"num_of_candidates_nominated" real,
"num_of_seats_won" real,
"num_of_total_votes" real,
"pct_of_popular_vote" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the most # of total votes with % of popular vote of 32.41% and # of seats won more than 95`:
```sql
|
SELECT "finish" FROM "indy_500_results" WHERE "year"='1954'; |
## Task
Generate a SQL query to answer the following question:
`What was Jack McGrath's finish number in 1954?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_results" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was Jack McGrath's finish number in 1954?`:
```sql
|
SELECT "start" FROM "indy_500_results" WHERE "qual"='141.033'; |
## Task
Generate a SQL query to answer the following question:
`What place did Jack McGrath start in when he received a qual score of 141.033?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_results" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What place did Jack McGrath start in when he received a qual score of 141.033?`:
```sql
|
SELECT "rank" FROM "indy_500_results" WHERE "start"='3' AND "finish"='26' AND "year"='1955'; |
## Task
Generate a SQL query to answer the following question:
`What was Jack McGrath's rank in 1955 when he started at 3 and finished at 26?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_results" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was Jack McGrath's rank in 1955 when he started at 3 and finished at 26?`:
```sql
|
SELECT "pre_season" FROM "ranking_movement" WHERE "may_5"='21'; |
## Task
Generate a SQL query to answer the following question:
`Which pre-season has May 5 of 21?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "ranking_movement" (
"poll" text,
"pre_season" text,
"mar_3" text,
"may_5" text,
"may_12" text,
"may_19" text,
"may_26" text,
"final_poll" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which pre-season has May 5 of 21?`:
```sql
|
SELECT "mar_3" FROM "ranking_movement" WHERE "poll"='baseball america (top 25)'; |
## Task
Generate a SQL query to answer the following question:
`Which March 3 has a Poll of baseball america (top 25)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "ranking_movement" (
"poll" text,
"pre_season" text,
"mar_3" text,
"may_5" text,
"may_12" text,
"may_19" text,
"may_26" text,
"final_poll" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which March 3 has a Poll of baseball america (top 25)?`:
```sql
|
SELECT "pre_season" FROM "ranking_movement" WHERE "mar_3"='nr' AND "poll"='usa today/espn coaches'' poll (top 25)'; |
## Task
Generate a SQL query to answer the following question:
`Which pre-season has a Mar. 3 of nr, and a Poll of usa today/espn coaches' poll (top 25)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "ranking_movement" (
"poll" text,
"pre_season" text,
"mar_3" text,
"may_5" text,
"may_12" text,
"may_19" text,
"may_26" text,
"final_poll" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which pre-season has a Mar. 3 of nr, and a Poll of usa today/espn coaches' poll (top 25)?`:
```sql
|
SELECT "opponent" FROM "schedule" WHERE "date"='september 9, 1979'; |
## Task
Generate a SQL query to answer the following question:
`Who is the opponent on September 9, 1979?`
### 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 `Who is the opponent on September 9, 1979?`:
```sql
|
SELECT SUM("week") FROM "schedule" WHERE "opponent"='denver broncos'; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of the week for the Denver Broncos?`
### 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 sum of the week for the Denver Broncos?`:
```sql
|
SELECT SUM("attendance") FROM "schedule" WHERE "date"='december 2, 1979'; |
## Task
Generate a SQL query to answer the following question:
`What is the attendance number for December 2, 1979?`
### 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 number for December 2, 1979?`:
```sql
|
SELECT "term_in_office" FROM "see_also" WHERE "party"='liberal' AND "state"='sa' AND "member"='ian mclachlan'; |
## Task
Generate a SQL query to answer the following question:
`Name the term in office for liberal and state of sa for ian mclachlan`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"member" text,
"party" text,
"electorate" text,
"state" text,
"term_in_office" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the term in office for liberal and state of sa for ian mclachlan`:
```sql
|
SELECT "record" FROM "game_log" WHERE "date"='july 26'; |
## Task
Generate a SQL query to answer the following question:
`What was the record for July 26?`
### 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 was the record for July 26?`:
```sql
|
SELECT SUM("played") FROM "national_league_one_table" WHERE "points"=38 AND "b_p">5; |
## Task
Generate a SQL query to answer the following question:
`Played that has a Points of 38, and a B.P. larger than 5 has what sum?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "national_league_one_table" (
"position" real,
"club" text,
"played" real,
"drawn" real,
"lost" real,
"pts_for" real,
"pts_agst" real,
"b_p" real,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `Played that has a Points of 38, and a B.P. larger than 5 has what sum?`:
```sql
|
SELECT COUNT("played") FROM "national_league_one_table" WHERE "b_p"=0 AND "pts_agst"<247; |
## Task
Generate a SQL query to answer the following question:
`B.P. of 0, and a Pts Agst smaller than 247 has how many total number of played?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "national_league_one_table" (
"position" real,
"club" text,
"played" real,
"drawn" real,
"lost" real,
"pts_for" real,
"pts_agst" real,
"b_p" real,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `B.P. of 0, and a Pts Agst smaller than 247 has how many total number of played?`:
```sql
|
SELECT COUNT("position") FROM "national_league_one_table" WHERE "pts_agst"=572 AND "pts_for">346; |
## Task
Generate a SQL query to answer the following question:
`Pts Agst of 572, and a Pts For larger than 346 has what total number of position?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "national_league_one_table" (
"position" real,
"club" text,
"played" real,
"drawn" real,
"lost" real,
"pts_for" real,
"pts_agst" real,
"b_p" real,
"points" real
);
### SQL
Given the database schema, here is the SQL query that answers `Pts Agst of 572, and a Pts For larger than 346 has what total number of position?`:
```sql
|
SELECT MAX("rounds") FROM "part_time_teams" WHERE "truck_s"='chevrolet silverado' AND "team"='rbr enterprises'; |
## Task
Generate a SQL query to answer the following question:
`What is the most number of rounds that the Team from RBR Enterprises and having a Chevrolet Silverado ran?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "part_time_teams" (
"team" text,
"truck_s" text,
"driver_s" text,
"primary_sponsor_s" text,
"owner_s" text,
"crew_chief" text,
"rounds" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the most number of rounds that the Team from RBR Enterprises and having a Chevrolet Silverado ran?`:
```sql
|
SELECT "crew_chief" FROM "part_time_teams" WHERE "team"='make motorsports'; |
## Task
Generate a SQL query to answer the following question:
`Who was the crew chief for the team from Make Motorsports?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "part_time_teams" (
"team" text,
"truck_s" text,
"driver_s" text,
"primary_sponsor_s" text,
"owner_s" text,
"crew_chief" text,
"rounds" real
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the crew chief for the team from Make Motorsports?`:
```sql
|
SELECT "driver_s" FROM "part_time_teams" WHERE "crew_chief"='nick carlson'; |
## Task
Generate a SQL query to answer the following question:
`Who was the driver for crew chief Nick Carlson?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "part_time_teams" (
"team" text,
"truck_s" text,
"driver_s" text,
"primary_sponsor_s" text,
"owner_s" text,
"crew_chief" text,
"rounds" real
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the driver for crew chief Nick Carlson?`:
```sql
|
SELECT "truck_s" FROM "part_time_teams" WHERE "driver_s"='brett moffitt' AND "team"='hattori racing enterprises'; |
## Task
Generate a SQL query to answer the following question:
`What is the truck used by Brett Moffitt, from Hattori Racing Enterprises?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "part_time_teams" (
"team" text,
"truck_s" text,
"driver_s" text,
"primary_sponsor_s" text,
"owner_s" text,
"crew_chief" text,
"rounds" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the truck used by Brett Moffitt, from Hattori Racing Enterprises?`:
```sql
|
SELECT "pick" FROM "wildcats_in_the_nba" WHERE "height"='6''9\"' AND "weight_lbs"=215; |
## Task
Generate a SQL query to answer the following question:
`Who is the pick with the height of 6'9" and weighs (lbs) 215?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "wildcats_in_the_nba" (
"position" text,
"name" text,
"height" text,
"weight_lbs" real,
"hometown" text,
"draft_year" real,
"pick" text,
"all_stars" text,
"nba_championships" text,
"nba_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who is the pick with the height of 6'9" and weighs (lbs) 215?`:
```sql
|
SELECT "nba_team" FROM "wildcats_in_the_nba" WHERE "draft_year">2003 AND "height"='6''10\"' AND "hometown"='st. charles, mo'; |
## Task
Generate a SQL query to answer the following question:
`who is the NBA team for the draft year after 2003 with a height of 6'10" and home town of st. charles, mo?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "wildcats_in_the_nba" (
"position" text,
"name" text,
"height" text,
"weight_lbs" real,
"hometown" text,
"draft_year" real,
"pick" text,
"all_stars" text,
"nba_championships" text,
"nba_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `who is the NBA team for the draft year after 2003 with a height of 6'10" and home town of st. charles, mo?`:
```sql
|
SELECT "losing_bonus" FROM "2009_2010_table" WHERE "drawn"='1' AND "try_bonus"='10'; |
## Task
Generate a SQL query to answer the following question:
`What was the losing bonus that had 1 draw and a 10 try bonus?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_2010_table" (
"club" text,
"played" text,
"drawn" text,
"lost" text,
"points_for" text,
"points_against" text,
"tries_for" text,
"tries_against" text,
"try_bonus" text,
"losing_bonus" text,
"points" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the losing bonus that had 1 draw and a 10 try bonus?`:
```sql
|
SELECT "drawn" FROM "2009_2010_table" WHERE "tries_for"='34'; |
## Task
Generate a SQL query to answer the following question:
`How many resulted in draws with 34 tries for?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_2010_table" (
"club" text,
"played" text,
"drawn" text,
"lost" text,
"points_for" text,
"points_against" text,
"tries_for" text,
"tries_against" text,
"try_bonus" text,
"losing_bonus" text,
"points" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many resulted in draws with 34 tries for?`:
```sql
|
SELECT "tries_against" FROM "2009_2010_table" WHERE "points_against"='520'; |
## Task
Generate a SQL query to answer the following question:
`How many tries against were there with 520 points against?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_2010_table" (
"club" text,
"played" text,
"drawn" text,
"lost" text,
"points_for" text,
"points_against" text,
"tries_for" text,
"tries_against" text,
"try_bonus" text,
"losing_bonus" text,
"points" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many tries against were there with 520 points against?`:
```sql
|
SELECT "tries_for" FROM "2009_2010_table" WHERE "points_against"='479'; |
## Task
Generate a SQL query to answer the following question:
`How many tries for were there while having 479 points against?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_2010_table" (
"club" text,
"played" text,
"drawn" text,
"lost" text,
"points_for" text,
"points_against" text,
"tries_for" text,
"tries_against" text,
"try_bonus" text,
"losing_bonus" text,
"points" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many tries for were there while having 479 points against?`:
```sql
|
SELECT "lost" FROM "2009_2010_table" WHERE "points_against"='479'; |
## Task
Generate a SQL query to answer the following question:
`How many resulted in a loss with 479 points against?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_2010_table" (
"club" text,
"played" text,
"drawn" text,
"lost" text,
"points_for" text,
"points_against" text,
"tries_for" text,
"tries_against" text,
"try_bonus" text,
"losing_bonus" text,
"points" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many resulted in a loss with 479 points against?`:
```sql
|
SELECT "try_bonus" FROM "2009_2010_table" WHERE "points"='58'; |
## Task
Generate a SQL query to answer the following question:
`What is the try bonus when there were 58 points?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_2010_table" (
"club" text,
"played" text,
"drawn" text,
"lost" text,
"points_for" text,
"points_against" text,
"tries_for" text,
"tries_against" text,
"try_bonus" text,
"losing_bonus" text,
"points" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the try bonus when there were 58 points?`:
```sql
|
SELECT "opponent" FROM "game_log" WHERE "record"='44-28'; |
## Task
Generate a SQL query to answer the following question:
`Which opponent has a record of 44-28?`
### 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" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which opponent has a record of 44-28?`:
```sql
|
SELECT "opponent" FROM "game_log" WHERE "attendance"='40,560'; |
## Task
Generate a SQL query to answer the following question:
`Which opponent has an attendance of 40,560?`
### 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" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which opponent has an attendance of 40,560?`:
```sql
|
SELECT "loss" FROM "game_log" WHERE "date"='june 13'; |
## Task
Generate a SQL query to answer the following question:
`Which loss was on June 13?`
### 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" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which loss was on June 13?`:
```sql
|
SELECT "attendance" FROM "game_log" WHERE "record"='43-28'; |
## Task
Generate a SQL query to answer the following question:
`What is the attendance that has a record of 43-28?`
### 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" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the attendance that has a record of 43-28?`:
```sql
|
SELECT "date" FROM "game_log" WHERE "record"='43-28'; |
## Task
Generate a SQL query to answer the following question:
`What was the date of the record of 43-28?`
### 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" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the date of the record of 43-28?`:
```sql
|
SELECT AVG("goalsagainst") FROM "regular_season" WHERE "points"=108 AND "lost"<14; |
## Task
Generate a SQL query to answer the following question:
`Goalsagainst that has a Points of 108, and a Lost smaller than 14 has what average?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "regular_season" (
"season" text,
"games" real,
"lost" real,
"points" real,
"goalsfor" real,
"goalsagainst" real
);
### SQL
Given the database schema, here is the SQL query that answers `Goalsagainst that has a Points of 108, and a Lost smaller than 14 has what average?`:
```sql
|
SELECT COUNT("games") FROM "regular_season" WHERE "lost"=42 AND "goalsfor">195; |
## Task
Generate a SQL query to answer the following question:
`Lost of 42, and a Goalsfor larger than 195 contains how many number of games?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "regular_season" (
"season" text,
"games" real,
"lost" real,
"points" real,
"goalsfor" real,
"goalsagainst" real
);
### SQL
Given the database schema, here is the SQL query that answers `Lost of 42, and a Goalsfor larger than 195 contains how many number of games?`:
```sql
|
SELECT MIN("goalsfor") FROM "regular_season" WHERE "season"='2002–03' AND "lost">14; |
## Task
Generate a SQL query to answer the following question:
`Season of 2002–03, and a Lost larger than 14, what is the lowest goals?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "regular_season" (
"season" text,
"games" real,
"lost" real,
"points" real,
"goalsfor" real,
"goalsagainst" real
);
### SQL
Given the database schema, here is the SQL query that answers `Season of 2002–03, and a Lost larger than 14, what is the lowest goals?`:
```sql
|
SELECT AVG("points") FROM "regular_season" WHERE "goalsagainst"=285 AND "season"='2006–07' AND "games"<70; |
## Task
Generate a SQL query to answer the following question:
`Goalsagainst of 285, and a Season of 2006–07, and a Games smaller than 70 has what average points?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "regular_season" (
"season" text,
"games" real,
"lost" real,
"points" real,
"goalsfor" real,
"goalsagainst" real
);
### SQL
Given the database schema, here is the SQL query that answers `Goalsagainst of 285, and a Season of 2006–07, and a Games smaller than 70 has what average points?`:
```sql
|
SELECT MAX("goalsagainst") FROM "regular_season" WHERE "goalsfor"=288 AND "points"<85; |
## Task
Generate a SQL query to answer the following question:
`Goals for of 288, and Points smaller than 85 what is the highest goals against?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "regular_season" (
"season" text,
"games" real,
"lost" real,
"points" real,
"goalsfor" real,
"goalsagainst" real
);
### SQL
Given the database schema, here is the SQL query that answers `Goals for of 288, and Points smaller than 85 what is the highest goals against?`:
```sql
|
SELECT "player" FROM "signed_offer_sheets" WHERE "original_team"='los angeles kings'; |
## Task
Generate a SQL query to answer the following question:
`What player originally played for the Los Angeles Kings?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "signed_offer_sheets" (
"player" text,
"date" text,
"original_team" text,
"offer_team" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What player originally played for the Los Angeles Kings?`:
```sql
|
SELECT "offer_team" FROM "signed_offer_sheets" WHERE "date"='july 29, 1994'; |
## Task
Generate a SQL query to answer the following question:
`What Offer Team has a date of July 29, 1994?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "signed_offer_sheets" (
"player" text,
"date" text,
"original_team" text,
"offer_team" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What Offer Team has a date of July 29, 1994?`:
```sql
|
SELECT "result" FROM "signed_offer_sheets" WHERE "offer_team"='new york rangers' AND "player"='adam graves'; |
## Task
Generate a SQL query to answer the following question:
`What is the Result that has the New York Rangers as the Offer Team and Adam Graves as the Player?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "signed_offer_sheets" (
"player" text,
"date" text,
"original_team" text,
"offer_team" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Result that has the New York Rangers as the Offer Team and Adam Graves as the Player?`:
```sql
|
SELECT "date" FROM "signed_offer_sheets" WHERE "original_team"='vancouver canucks' AND "result"='matched' AND "player"='ryan kesler'; |
## Task
Generate a SQL query to answer the following question:
`What date has Vancouver Canucks as the original team, Ryan Kesler as the player, and matched as the Result?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "signed_offer_sheets" (
"player" text,
"date" text,
"original_team" text,
"offer_team" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What date has Vancouver Canucks as the original team, Ryan Kesler as the player, and matched as the Result?`:
```sql
|
SELECT "offer_team" FROM "signed_offer_sheets" WHERE "player"='david backes'; |
## Task
Generate a SQL query to answer the following question:
`What was David Backes' Offer Team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "signed_offer_sheets" (
"player" text,
"date" text,
"original_team" text,
"offer_team" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was David Backes' Offer Team?`:
```sql
|
SELECT "result" FROM "signed_offer_sheets" WHERE "offer_team"='philadelphia flyers' AND "player"='chris gratton'; |
## Task
Generate a SQL query to answer the following question:
`What is the result of Chris Gratton and Philadelphia Flyers as the Offer Team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "signed_offer_sheets" (
"player" text,
"date" text,
"original_team" text,
"offer_team" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the result of Chris Gratton and Philadelphia Flyers as the Offer Team?`:
```sql
|
SELECT AVG("game") FROM "pre_season" WHERE "venue"='away' AND "attendance"='5,000'; |
## Task
Generate a SQL query to answer the following question:
`Which game had an attendance of 5,000 and was away?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pre_season" (
"game" real,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which game had an attendance of 5,000 and was away?`:
```sql
|
SELECT "date" FROM "history" WHERE "year"=1786; |
## Task
Generate a SQL query to answer the following question:
`When was the date in 1786?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "history" (
"year" real,
"date" text,
"name" text,
"race" text,
"method" text,
"offense" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was the date in 1786?`:
```sql
|
SELECT MIN("attendance") FROM "game_log" WHERE "opponent"='devil rays' AND "date"='may 13'; |
## Task
Generate a SQL query to answer the following question:
`How low is the Attendance that has an Opponent of devil rays and a Date of may 13?`
### 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 `How low is the Attendance that has an Opponent of devil rays and a Date of may 13?`:
```sql
|
SELECT MAX("attendance") FROM "game_log" WHERE "record"='29-25'; |
## Task
Generate a SQL query to answer the following question:
`How high is the Attendance with a Record of 29-25?`
### 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 `How high is the Attendance with a Record of 29-25?`:
```sql
|
SELECT "opponent" FROM "game_log" WHERE "loss"='wells (6-2)'; |
## Task
Generate a SQL query to answer the following question:
`Which Opponent has a lost of wells (6-2)?`
### 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 `Which Opponent has a lost of wells (6-2)?`:
```sql
|
SELECT "team_2" FROM "relegation_playoffs" WHERE "2nd_leg"='0-0'; |
## Task
Generate a SQL query to answer the following question:
`What is the team 2 with a 0-0 2nd leg?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "relegation_playoffs" (
"team_1" text,
"agg" text,
"team_2" text,
"1st_leg" text,
"2nd_leg" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the team 2 with a 0-0 2nd leg?`:
```sql
|
SELECT "team_1" FROM "relegation_playoffs" WHERE "team_2"='(g14)morolo'; |
## Task
Generate a SQL query to answer the following question:
`What is the team 1 with a (g14)morolo team 2?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "relegation_playoffs" (
"team_1" text,
"agg" text,
"team_2" text,
"1st_leg" text,
"2nd_leg" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the team 1 with a (g14)morolo team 2?`:
```sql
|
SELECT AVG("total") FROM "medal_table" WHERE "silver"<1 AND "gold"=0 AND "nation"='switzerland' AND "bronze"<2; |
## Task
Generate a SQL query to answer the following question:
`What is the average Total, when the value for Silver is less than 1, when the value for Gold is 0, when the Nation is Switzerland, and when the value for Bronze is 2?`
### 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 average Total, when the value for Silver is less than 1, when the value for Gold is 0, when the Nation is Switzerland, and when the value for Bronze is 2?`:
```sql
|
SELECT AVG("total") FROM "medal_table" WHERE "nation"='sweden' AND "bronze"<3; |
## Task
Generate a SQL query to answer the following question:
`What is the average Total, when the Nation is Sweden, and when the value for Bronze is less than 3?`
### 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 average Total, when the Nation is Sweden, and when the value for Bronze is less than 3?`:
```sql
|
SELECT AVG("gold") FROM "medal_table" WHERE "silver">2 AND "nation"='west germany'; |
## Task
Generate a SQL query to answer the following question:
`What is the average value for Gold, when the value for Silver is greater than 2, and when the Nation is West Germany?`
### 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 average value for Gold, when the value for Silver is greater than 2, and when the Nation is West Germany?`:
```sql
|
SELECT COUNT("gold") FROM "medal_table" WHERE "bronze"<0; |
## Task
Generate a SQL query to answer the following question:
`What is the value for Gold, when the value for Bronze 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 value for Gold, when the value for Bronze is less than 0?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.