output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT "series" FROM "western_conference_final_vs_3" WHERE "home"='toronto' AND "date"='may 18'; |
## Task
Generate a SQL query to answer the following question:
`Which series is based in Toronto on may 18?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "western_conference_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 `Which series is based in Toronto on may 18?`:
```sql
|
SELECT SUM("attendance") FROM "western_conference_final_vs_3" WHERE "home"='vancouver' AND "date"='may 22'; |
## Task
Generate a SQL query to answer the following question:
`What is the combined crowd in Vancouver on may 22?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "western_conference_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 is the combined crowd in Vancouver on may 22?`:
```sql
|
SELECT "2012" FROM "qs_world_university_rankings_university_" WHERE "2005"='314'; |
## Task
Generate a SQL query to answer the following question:
`Tell me the 2012 when 2005 is 314`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "qs_world_university_rankings_university_" (
"2005" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
);
### SQL
Given the database schema, here is the SQL query that answers `Tell me the 2012 when 2005 is 314`:
```sql
|
SELECT "position" FROM "2007_rugby_world_cup_squads" WHERE "caps"=13; |
## Task
Generate a SQL query to answer the following question:
`What position does the player with 13 caps play?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_rugby_world_cup_squads" (
"player" text,
"position" text,
"date_of_birth_age" text,
"caps" real,
"club_province" text
);
### SQL
Given the database schema, here is the SQL query that answers `What position does the player with 13 caps play?`:
```sql
|
SELECT SUM("caps") FROM "2007_rugby_world_cup_squads" WHERE "player"='mike macdonald'; |
## Task
Generate a SQL query to answer the following question:
`How many caps for mike macdonald?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_rugby_world_cup_squads" (
"player" text,
"position" text,
"date_of_birth_age" text,
"caps" real,
"club_province" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many caps for mike macdonald?`:
```sql
|
SELECT "position" FROM "draft_picks" WHERE "round"<3; |
## Task
Generate a SQL query to answer the following question:
`Tell me the position for round less than 3`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "draft_picks" (
"round" real,
"player" text,
"position" text,
"nationality" text,
"college_junior_club_team_league" text
);
### SQL
Given the database schema, here is the SQL query that answers `Tell me the position for round less than 3`:
```sql
|
SELECT "nationality" FROM "draft_picks" WHERE "position"='d'; |
## Task
Generate a SQL query to answer the following question:
`Name the nationality for d`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "draft_picks" (
"round" real,
"player" text,
"position" text,
"nationality" text,
"college_junior_club_team_league" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the nationality for d`:
```sql
|
SELECT "fuel_trans" FROM "diesel_locomotives" WHERE "colour"='grey & red'; |
## Task
Generate a SQL query to answer the following question:
`What sort of Fuel/Trans does the Grey & Red locomotive have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "diesel_locomotives" (
"name" text,
"built" text,
"wheels" text,
"fuel_trans" text,
"status" text,
"colour" text
);
### SQL
Given the database schema, here is the SQL query that answers `What sort of Fuel/Trans does the Grey & Red locomotive have?`:
```sql
|
SELECT "status" FROM "diesel_locomotives" WHERE "name"='the cub/john'; |
## Task
Generate a SQL query to answer the following question:
`What is the status of the Cub/John locomotive?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "diesel_locomotives" (
"name" text,
"built" text,
"wheels" text,
"fuel_trans" text,
"status" text,
"colour" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the status of the Cub/John locomotive?`:
```sql
|
SELECT "built" FROM "diesel_locomotives" WHERE "fuel_trans"='diesel-electric'; |
## Task
Generate a SQL query to answer the following question:
`What is the manufacturer, found under the Built column, that made locomotives with a Fuel/Trans of diesel-electric?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "diesel_locomotives" (
"name" text,
"built" text,
"wheels" text,
"fuel_trans" text,
"status" text,
"colour" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the manufacturer, found under the Built column, that made locomotives with a Fuel/Trans of diesel-electric?`:
```sql
|
SELECT "built" FROM "diesel_locomotives" WHERE "wheels"='0-4-0' AND "status"='in service'; |
## Task
Generate a SQL query to answer the following question:
`What is found in the Built column of the locomotive with 0-4-0 wheels that is still in service?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "diesel_locomotives" (
"name" text,
"built" text,
"wheels" text,
"fuel_trans" text,
"status" text,
"colour" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is found in the Built column of the locomotive with 0-4-0 wheels that is still in service?`:
```sql
|
SELECT "colour" FROM "diesel_locomotives" WHERE "built"='minirail 1954'; |
## Task
Generate a SQL query to answer the following question:
`What is the color of the locomotive built by Minirail 1954?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "diesel_locomotives" (
"name" text,
"built" text,
"wheels" text,
"fuel_trans" text,
"status" text,
"colour" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the color of the locomotive built by Minirail 1954?`:
```sql
|
SELECT COUNT("round") FROM "mixed_martial_arts_record" WHERE "res"='win' AND "event"='sf 5: stadium'; |
## Task
Generate a SQL query to answer the following question:
`What's the total number of rounds with a win result at the sf 5: stadium event?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mixed_martial_arts_record" (
"res" text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"round" real,
"time" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `What's the total number of rounds with a win result at the sf 5: stadium event?`:
```sql
|
SELECT "location" FROM "mixed_martial_arts_record" WHERE "opponent"='fábio maldonado'; |
## Task
Generate a SQL query to answer the following question:
`What location was fábio maldonado the opponent at?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mixed_martial_arts_record" (
"res" text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"round" real,
"time" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `What location was fábio maldonado the opponent at?`:
```sql
|
SELECT COUNT("final_rank") FROM "program_details" WHERE "rank_in_fs"=3 AND "rank_in_sp">4; |
## Task
Generate a SQL query to answer the following question:
`How many skaters have a Rank in FS of 3, and a Rank in SP larger than 4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "program_details" (
"final_rank" real,
"skater" text,
"rank_in_sp" real,
"rank_in_fs" real,
"total_score" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many skaters have a Rank in FS of 3, and a Rank in SP larger than 4?`:
```sql
|
SELECT AVG("rank_in_sp") FROM "program_details" WHERE "rank_in_fs">2 AND "final_rank">5; |
## Task
Generate a SQL query to answer the following question:
`What is the average SP rank for skaters with a Rank in FS larger than 2, and a Final Rank larger than 5?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "program_details" (
"final_rank" real,
"skater" text,
"rank_in_sp" real,
"rank_in_fs" real,
"total_score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average SP rank for skaters with a Rank in FS larger than 2, and a Final Rank larger than 5?`:
```sql
|
SELECT "tournament" FROM "grand_slam_success" WHERE "1972"='a' AND "1975"='2r'; |
## Task
Generate a SQL query to answer the following question:
`What tournament is listed as A in 1972 and 2R in 1975?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_slam_success" (
"tournament" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"career_sr" text,
"career_w_l" text,
"career_win_pct" text
);
### SQL
Given the database schema, here is the SQL query that answers `What tournament is listed as A in 1972 and 2R in 1975?`:
```sql
|
SELECT "career_w_l" FROM "grand_slam_success" WHERE "1976"='a'; |
## Task
Generate a SQL query to answer the following question:
`What is theW-L of the tournament listed as A for 1976?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_slam_success" (
"tournament" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"career_sr" text,
"career_w_l" text,
"career_win_pct" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is theW-L of the tournament listed as A for 1976?`:
```sql
|
SELECT "1977" FROM "grand_slam_success" WHERE "tournament"='us open'; |
## Task
Generate a SQL query to answer the following question:
`What is the listing for the US Open in 1977?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_slam_success" (
"tournament" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"career_sr" text,
"career_w_l" text,
"career_win_pct" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the listing for the US Open in 1977?`:
```sql
|
SELECT "career_w_l" FROM "grand_slam_success" WHERE "1968"='a' AND "1974"='4r'; |
## Task
Generate a SQL query to answer the following question:
`What is the career W-L of the tournament that is listed as A in 1968 and 4R in 1974?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "grand_slam_success" (
"tournament" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"career_sr" text,
"career_w_l" text,
"career_win_pct" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the career W-L of the tournament that is listed as A in 1968 and 4R in 1974?`:
```sql
|
SELECT "combined_consumption" FROM "engines" WHERE "name"='1.6 16v'; |
## Task
Generate a SQL query to answer the following question:
`What is the combined consumption of 1.6 16v?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "engines" (
"name" text,
"code" text,
"capacity" text,
"type" text,
"power" text,
"torque" text,
"top_speed" text,
"combined_consumption" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the combined consumption of 1.6 16v?`:
```sql
|
SELECT "power" FROM "engines" WHERE "combined_consumption"='(gas/ethanol)' AND "code"='k7m hi-torque'; |
## Task
Generate a SQL query to answer the following question:
`What is the power of the engine with a combined consumption of (gas/ethanol) and the k7m hi-torque code?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "engines" (
"name" text,
"code" text,
"capacity" text,
"type" text,
"power" text,
"torque" text,
"top_speed" text,
"combined_consumption" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the power of the engine with a combined consumption of (gas/ethanol) and the k7m hi-torque code?`:
```sql
|
SELECT "combined_consumption" FROM "engines" WHERE "code"='k9k 796'; |
## Task
Generate a SQL query to answer the following question:
`What is the combined consumption of the engine with the code k9k 796?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "engines" (
"name" text,
"code" text,
"capacity" text,
"type" text,
"power" text,
"torque" text,
"top_speed" text,
"combined_consumption" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the combined consumption of the engine with the code k9k 796?`:
```sql
|
SELECT "torque" FROM "engines" WHERE "type"='16 valves dohc' AND "code"='k4m hi-flex'; |
## Task
Generate a SQL query to answer the following question:
`What is the torque of the engine with a type 16 valves dohc and a code k4m hi-flex?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "engines" (
"name" text,
"code" text,
"capacity" text,
"type" text,
"power" text,
"torque" text,
"top_speed" text,
"combined_consumption" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the torque of the engine with a type 16 valves dohc and a code k4m hi-flex?`:
```sql
|
SELECT "high_assists" FROM "game_log" WHERE "date"='november 13'; |
## Task
Generate a SQL query to answer the following question:
`Who had the highest assists on the November 13 game?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"game" real,
"date" text,
"team" text,
"score" text,
"high_points" text,
"high_rebounds" text,
"high_assists" text,
"location_attendance" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who had the highest assists on the November 13 game?`:
```sql
|
SELECT MAX("date") FROM "singles_finals_16_9_7" WHERE "score_in_the_final"='1–6, 4–6, 5–7'; |
## Task
Generate a SQL query to answer the following question:
`What is the most recent date for a singles final with the score of 1–6, 4–6, 5–7?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "singles_finals_16_9_7" (
"outcome" text,
"date" real,
"championship" text,
"surface" text,
"opponent_in_the_final" text,
"score_in_the_final" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the most recent date for a singles final with the score of 1–6, 4–6, 5–7?`:
```sql
|
SELECT "championship" FROM "singles_finals_16_9_7" WHERE "surface"='clay' AND "score_in_the_final"='6–2, 5–7, 6–4, 6–2'; |
## Task
Generate a SQL query to answer the following question:
`What was the championship that had final score of 6–2, 5–7, 6–4, 6–2 and was on a clay surface?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "singles_finals_16_9_7" (
"outcome" text,
"date" real,
"championship" text,
"surface" text,
"opponent_in_the_final" text,
"score_in_the_final" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the championship that had final score of 6–2, 5–7, 6–4, 6–2 and was on a clay surface?`:
```sql
|
SELECT "score_in_the_final" FROM "singles_finals_16_9_7" WHERE "date">1984 AND "outcome"='winner' AND "opponent_in_the_final"='víctor pecci'; |
## Task
Generate a SQL query to answer the following question:
`What was the score in the final, that Víctor Pecci was the opponent and winner after 1984?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "singles_finals_16_9_7" (
"outcome" text,
"date" real,
"championship" text,
"surface" text,
"opponent_in_the_final" text,
"score_in_the_final" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score in the final, that Víctor Pecci was the opponent and winner after 1984?`:
```sql
|
SELECT "championship" FROM "singles_finals_16_9_7" WHERE "score_in_the_final"='3–6, 6–4, 5–7'; |
## Task
Generate a SQL query to answer the following question:
`Which championship had a score in the final of 3–6, 6–4, 5–7?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "singles_finals_16_9_7" (
"outcome" text,
"date" real,
"championship" text,
"surface" text,
"opponent_in_the_final" text,
"score_in_the_final" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which championship had a score in the final of 3–6, 6–4, 5–7?`:
```sql
|
SELECT COUNT("grid") FROM "classification" WHERE "laps"=37; |
## Task
Generate a SQL query to answer the following question:
`What is the grid total when there are 37 laps?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification" (
"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 grid total when there are 37 laps?`:
```sql
|
SELECT "constructor" FROM "classification" WHERE "grid"<13 AND "laps"<9; |
## Task
Generate a SQL query to answer the following question:
`What constructor has a grid less than 13 with under 9 laps?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification" (
"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 has a grid less than 13 with under 9 laps?`:
```sql
|
SELECT AVG("year") FROM "competition_record" WHERE "competition"='world junior championships' AND "position"='20th (qf)'; |
## Task
Generate a SQL query to answer the following question:
`What year was the Competition of World Junior Championships with a 20th (qf) position?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What year was the Competition of World Junior Championships with a 20th (qf) position?`:
```sql
|
SELECT "notes" FROM "competition_record" WHERE "event"='400 m' AND "year"<2004 AND "position"='12th (h)'; |
## Task
Generate a SQL query to answer the following question:
`What was the notes of the 400 m event before 2004 with a position of 12th (h)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the notes of the 400 m event before 2004 with a position of 12th (h)?`:
```sql
|
SELECT "venue" FROM "competition_record" WHERE "year">2003 AND "notes"='3:34.88'; |
## Task
Generate a SQL query to answer the following question:
`Which venue had a note of 3:34.88 after 2003?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which venue had a note of 3:34.88 after 2003?`:
```sql
|
SELECT "notes" FROM "competition_record" WHERE "competition"='all-africa games' AND "year"<2007; |
## Task
Generate a SQL query to answer the following question:
`What were the notes of the All-Africa Games before 2007?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What were the notes of the All-Africa Games before 2007?`:
```sql
|
SELECT "event" FROM "competition_record" WHERE "year"=2007 AND "position"='5th'; |
## Task
Generate a SQL query to answer the following question:
`Which event in 2007 had a position of 5th?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "competition_record" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which event in 2007 had a position of 5th?`:
```sql
|
SELECT SUM("attendance") FROM "december" WHERE "leading_scorer"='stephen jackson' AND "date"='12/17'; |
## Task
Generate a SQL query to answer the following question:
`How many attended the game on 12/17 with stephen jackson as the leading scorer?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "december" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"leading_scorer" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many attended the game on 12/17 with stephen jackson as the leading scorer?`:
```sql
|
SELECT "score" FROM "singles_titles_92" WHERE "tournament"='sant cugat' AND "opponent_in_the_final"='jose checa-calvo'; |
## Task
Generate a SQL query to answer the following question:
`WHAT WAS THE SCORE IN THE FINAL PLAYED AGAINST JOSE CHECA-CALVO IN THE SANT CUGAT TOURNAMENT ?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "singles_titles_92" (
"date" text,
"tournament" text,
"surface" text,
"opponent_in_the_final" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT WAS THE SCORE IN THE FINAL PLAYED AGAINST JOSE CHECA-CALVO IN THE SANT CUGAT TOURNAMENT ?`:
```sql
|
SELECT "score" FROM "singles_titles_92" WHERE "opponent_in_the_final"='rabie chaki'; |
## Task
Generate a SQL query to answer the following question:
`WHAT WAS THE SCORE IN THE FINAL AGAINST RABIE CHAKI?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "singles_titles_92" (
"date" text,
"tournament" text,
"surface" text,
"opponent_in_the_final" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `WHAT WAS THE SCORE IN THE FINAL AGAINST RABIE CHAKI?`:
```sql
|
SELECT "away_team_score" FROM "round_9" WHERE "home_team"='collingwood'; |
## Task
Generate a SQL query to answer the following question:
`What was the away team's score when Collingwood was 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 was the away team's score when Collingwood was the home team?`:
```sql
|
SELECT "home_team" FROM "round_9" WHERE "venue"='victoria park'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team for the game played at Victoria 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 `Who was the home team for the game played at Victoria Park?`:
```sql
|
SELECT "home_team" FROM "round_9" WHERE "away_team"='fitzroy'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team when Fitzroy was the away 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 `Who was the home team when Fitzroy was the away team?`:
```sql
|
SELECT "home_team" FROM "round_9" WHERE "venue"='lake oval'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team for the game played at Lake 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 home team for the game played at Lake Oval?`:
```sql
|
SELECT "opponent_in_the_final" FROM "career_finals" WHERE "championship"='johannesburg, south africa'; |
## Task
Generate a SQL query to answer the following question:
`Who was the opponent in the championship in Johannesburg, South Africa?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "career_finals" (
"outcome" text,
"date" text,
"championship" text,
"opponent_in_the_final" text,
"score_in_the_final" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the opponent in the championship in Johannesburg, South Africa?`:
```sql
|
SELECT MIN("wins") FROM "managers_with_1_000_or_more_wins" WHERE "pct">0.526 AND "rank"<37 AND "losses"=947; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest amount of wins a manager with more than 0.526 pct., ranked higher than 37, and 947 losses has?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "managers_with_1_000_or_more_wins" (
"rank" real,
"name" text,
"wins" real,
"losses" real,
"pct" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest amount of wins a manager with more than 0.526 pct., ranked higher than 37, and 947 losses has?`:
```sql
|
SELECT COUNT("crowd") FROM "round_14" WHERE "home_team"='essendon'; |
## Task
Generate a SQL query to answer the following question:
`I want the total number of people in the crowd for essendon 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 `I want the total number of people in the crowd for essendon home team`:
```sql
|
SELECT COUNT("grid") FROM "classification" WHERE "laps">102 AND "time_retired"='+ 6.18'; |
## Task
Generate a SQL query to answer the following question:
`How many grids have 102 laps and a Time/Retired of + 6.18?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification" (
"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 grids have 102 laps and a Time/Retired of + 6.18?`:
```sql
|
SELECT SUM("laps") FROM "classification" WHERE "driver"='innes ireland' AND "grid">11; |
## Task
Generate a SQL query to answer the following question:
`How many laps did innes ireland drive with a grid higher than 11?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification" (
"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 did innes ireland drive with a grid higher than 11?`:
```sql
|
SELECT AVG("grid") FROM "classification" WHERE "constructor"='brm' AND "driver"='tony maggs' AND "laps">102; |
## Task
Generate a SQL query to answer the following question:
`What is the average grid that has a Constructor of brm, tony maggs, and a Laps larger than 102?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification" (
"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 average grid that has a Constructor of brm, tony maggs, and a Laps larger than 102?`:
```sql
|
SELECT "score" FROM "international_goals" WHERE "date"='23 july 1992'; |
## Task
Generate a SQL query to answer the following question:
`I want the score for 23 july 1992`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
### SQL
Given the database schema, here is the SQL query that answers `I want the score for 23 july 1992`:
```sql
|
SELECT "venue" FROM "international_goals" WHERE "date"='23 july 1992'; |
## Task
Generate a SQL query to answer the following question:
`I want the venue for 23 july 1992`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "international_goals" (
"date" text,
"venue" text,
"score" text,
"result" text,
"competition" text
);
### SQL
Given the database schema, here is the SQL query that answers `I want the venue for 23 july 1992`:
```sql
|
SELECT "time_retired" FROM "race" WHERE "grid"<8 AND "laps"=73 AND "constructor"='williams - bmw'; |
## Task
Generate a SQL query to answer the following question:
`What is the Time/Retired that has a Grid smaller than 8, 73 laps, and a Constructor of williams - bmw?`
### 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 that has a Grid smaller than 8, 73 laps, and a Constructor of williams - bmw?`:
```sql
|
SELECT "away_team" FROM "round_13" WHERE "home_team_score"='12.10 (82)'; |
## Task
Generate a SQL query to answer the following question:
`Which away team has a home team score of 12.10 (82)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_13" (
"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 has a home team score of 12.10 (82)?`:
```sql
|
SELECT "date" FROM "round_13" WHERE "away_team"='richmond'; |
## Task
Generate a SQL query to answer the following question:
`On what date was Richmond playing as an away team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_13" (
"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 `On what date was Richmond playing as an away team?`:
```sql
|
SELECT "crowd" FROM "round_5" WHERE "venue"='victoria park'; |
## Task
Generate a SQL query to answer the following question:
`What is the crowd size for Victoria park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_5" (
"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 crowd size for Victoria park?`:
```sql
|
SELECT AVG("crowd") FROM "round_5" WHERE "venue"='princes park'; |
## Task
Generate a SQL query to answer the following question:
`What is the average crowd size for princes park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_5" (
"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 princes park?`:
```sql
|
SELECT "home_team_score" FROM "round_5" WHERE "away_team_score"='17.18 (120)'; |
## Task
Generate a SQL query to answer the following question:
`What is the home team score when the away team score is 17.18 (120)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_5" (
"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 home team score when the away team score is 17.18 (120)?`:
```sql
|
SELECT AVG("crowd") FROM "round_5" WHERE "home_team_score"='12.21 (93)'; |
## Task
Generate a SQL query to answer the following question:
`When the home team scored 12.21 (93), what was the average crowd size?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_5" (
"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 the home team scored 12.21 (93), what was the average crowd size?`:
```sql
|
SELECT "transfer_window" FROM "out" WHERE "name"='giuly'; |
## Task
Generate a SQL query to answer the following question:
`Name the transfer wind for giuly`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "out" (
"name" text,
"country" text,
"status" text,
"moving_to" text,
"transfer_window" text,
"transfer_fee" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the transfer wind for giuly`:
```sql
|
SELECT "transfer_fee" FROM "out" WHERE "status"='transfer' AND "country"='fra'; |
## Task
Generate a SQL query to answer the following question:
`Name the transfer fee for transfer status for fra`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "out" (
"name" text,
"country" text,
"status" text,
"moving_to" text,
"transfer_window" text,
"transfer_fee" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the transfer fee for transfer status for fra`:
```sql
|
SELECT "status" FROM "out" WHERE "name"='belletti'; |
## Task
Generate a SQL query to answer the following question:
`Name the status for belletti`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "out" (
"name" text,
"country" text,
"status" text,
"moving_to" text,
"transfer_window" text,
"transfer_fee" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the status for belletti`:
```sql
|
SELECT "moving_to" FROM "out" WHERE "country"='fra'; |
## Task
Generate a SQL query to answer the following question:
`Name the moving to for fra`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "out" (
"name" text,
"country" text,
"status" text,
"moving_to" text,
"transfer_window" text,
"transfer_fee" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the moving to for fra`:
```sql
|
SELECT "transfer_window" FROM "out" WHERE "moving_to"='realmadrid'; |
## Task
Generate a SQL query to answer the following question:
`Name the transfer window of realmadrid`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "out" (
"name" text,
"country" text,
"status" text,
"moving_to" text,
"transfer_window" text,
"transfer_fee" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the transfer window of realmadrid`:
```sql
|
SELECT "country" FROM "out" WHERE "moving_to"='chelsea'; |
## Task
Generate a SQL query to answer the following question:
`Name the country moving to chelsea`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "out" (
"name" text,
"country" text,
"status" text,
"moving_to" text,
"transfer_window" text,
"transfer_fee" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the country moving to chelsea`:
```sql
|
SELECT "leading_scorer" FROM "february" WHERE "date"='20 february 2008'; |
## Task
Generate a SQL query to answer the following question:
`Who was the leading scorer of the game on 20 February 2008?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "february" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"leading_scorer" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the leading scorer of the game on 20 February 2008?`:
```sql
|
SELECT "visitor" FROM "february" WHERE "leading_scorer"='rudy gay (23)'; |
## Task
Generate a SQL query to answer the following question:
`What is the visitor team of the game with Rudy Gay (23) as the leading scorer?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "february" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"leading_scorer" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the visitor team of the game with Rudy Gay (23) as the leading scorer?`:
```sql
|
SELECT "home" FROM "february" WHERE "visitor"='grizzlies' AND "leading_scorer"='rudy gay (21)'; |
## Task
Generate a SQL query to answer the following question:
`What is the home team of the game where the Grizzlies were the visitor team and Rudy Gay (21) was the leading scorer?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "february" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"leading_scorer" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the home team of the game where the Grizzlies were the visitor team and Rudy Gay (21) was the leading scorer?`:
```sql
|
SELECT "record" FROM "february" WHERE "date"='5 february 2008'; |
## Task
Generate a SQL query to answer the following question:
`What is the record of the game on 5 February 2008?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "february" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"leading_scorer" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the record of the game on 5 February 2008?`:
```sql
|
SELECT "written_by" FROM "season_4" WHERE "production_code"='ad1d09'; |
## Task
Generate a SQL query to answer the following question:
`tell me the writer of production code ad1d09.`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "season_4" (
"title" text,
"directed_by" text,
"written_by" text,
"original_air_date" text,
"production_code" text
);
### SQL
Given the database schema, here is the SQL query that answers `tell me the writer of production code ad1d09.`:
```sql
|
SELECT "directed_by" FROM "season_4" WHERE "production_code"='ad1d02'; |
## Task
Generate a SQL query to answer the following question:
`tell me the director of the production code ad1d02.`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "season_4" (
"title" text,
"directed_by" text,
"written_by" text,
"original_air_date" text,
"production_code" text
);
### SQL
Given the database schema, here is the SQL query that answers `tell me the director of the production code ad1d02.`:
```sql
|
SELECT "team_league" FROM "list_of_vancouver_canucks_draft_picks" WHERE "reg_gp"=0 AND "pick_num"<136 AND "player"='regan darby'; |
## Task
Generate a SQL query to answer the following question:
`Which team has a Reg GP of 0, a pick number under 136 with a player named Regan Darby?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_vancouver_canucks_draft_picks" (
"rd_num" real,
"pick_num" real,
"player" text,
"team_league" text,
"reg_gp" real,
"pl_gp" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which team has a Reg GP of 0, a pick number under 136 with a player named Regan Darby?`:
```sql
|
SELECT "planet" FROM "planets" WHERE "orbital_period"='3.23 days'; |
## Task
Generate a SQL query to answer the following question:
`What planet orbits in 3.23 days?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "planets" (
"planet" text,
"planet_type" text,
"semimajor_axis_au" real,
"orbital_period" text,
"radial_velocity_m_s" real,
"detectable_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What planet orbits in 3.23 days?`:
```sql
|
SELECT "planet_type" FROM "planets" WHERE "radial_velocity_m_s">45.2; |
## Task
Generate a SQL query to answer the following question:
`What type of planet has a radial velocity of 45.2 m/s?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "planets" (
"planet" text,
"planet_type" text,
"semimajor_axis_au" real,
"orbital_period" text,
"radial_velocity_m_s" real,
"detectable_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What type of planet has a radial velocity of 45.2 m/s?`:
```sql
|
SELECT "planet_type" FROM "planets" WHERE "semimajor_axis_au"=0.07; |
## Task
Generate a SQL query to answer the following question:
`What type of planet has a semimajor axis of 0.07 AU?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "planets" (
"planet" text,
"planet_type" text,
"semimajor_axis_au" real,
"orbital_period" text,
"radial_velocity_m_s" real,
"detectable_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What type of planet has a semimajor axis of 0.07 AU?`:
```sql
|
SELECT "detectable_by" FROM "planets" WHERE "planet"='51 pegasi b'; |
## Task
Generate a SQL query to answer the following question:
`How can Planet, 51 pegasi b be detected?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "planets" (
"planet" text,
"planet_type" text,
"semimajor_axis_au" real,
"orbital_period" text,
"radial_velocity_m_s" real,
"detectable_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `How can Planet, 51 pegasi b be detected?`:
```sql
|
SELECT "city" FROM "venues" WHERE "stadium"='telstra dome'; |
## Task
Generate a SQL query to answer the following question:
`What is the city where the Telstra Dome is?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "venues" (
"stadium" text,
"games" real,
"city" text,
"state" text,
"capacity" real,
"best_crowd" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the city where the Telstra Dome is?`:
```sql
|
SELECT "d_41" FROM "before_the_elections" WHERE "d_46"='r 6'; |
## Task
Generate a SQL query to answer the following question:
`Name the D 41 which has a D 46 of r 6`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "before_the_elections" (
"d_41" text,
"d_42" text,
"d_43" text,
"d_44" text,
"d_45" text,
"d_46" text,
"r_54" text,
"r_53" text,
"r_52" text,
"r_51" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the D 41 which has a D 46 of r 6`:
```sql
|
SELECT "d_41" FROM "before_the_elections" WHERE "d_43"='r 18'; |
## Task
Generate a SQL query to answer the following question:
`Name the D 41 which has a D 43 of r 18`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "before_the_elections" (
"d_41" text,
"d_42" text,
"d_43" text,
"d_44" text,
"d_45" text,
"d_46" text,
"r_54" text,
"r_53" text,
"r_52" text,
"r_51" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the D 41 which has a D 43 of r 18`:
```sql
|
SELECT "r_52" FROM "before_the_elections" WHERE "d_44"='d 44'; |
## Task
Generate a SQL query to answer the following question:
`Name the R 52 which has a D 44 of d 44`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "before_the_elections" (
"d_41" text,
"d_42" text,
"d_43" text,
"d_44" text,
"d_45" text,
"d_46" text,
"r_54" text,
"r_53" text,
"r_52" text,
"r_51" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the R 52 which has a D 44 of d 44`:
```sql
|
SELECT "d_46" FROM "before_the_elections" WHERE "d_43"='majority→'; |
## Task
Generate a SQL query to answer the following question:
`Name the D 46 which has a D 43 of majority→`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "before_the_elections" (
"d_41" text,
"d_42" text,
"d_43" text,
"d_44" text,
"d_45" text,
"d_46" text,
"r_54" text,
"r_53" text,
"r_52" text,
"r_51" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the D 46 which has a D 43 of majority→`:
```sql
|
SELECT "d_42" FROM "before_the_elections" WHERE "d_46"='r 26'; |
## Task
Generate a SQL query to answer the following question:
`Name the D 42 which has a D 46 of r 26`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "before_the_elections" (
"d_41" text,
"d_42" text,
"d_43" text,
"d_44" text,
"d_45" text,
"d_46" text,
"r_54" text,
"r_53" text,
"r_52" text,
"r_51" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the D 42 which has a D 46 of r 26`:
```sql
|
SELECT "d_42" FROM "before_the_elections" WHERE "d_44"='d 44'; |
## Task
Generate a SQL query to answer the following question:
`Name the D 42 which has a D 44 of d 44`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "before_the_elections" (
"d_41" text,
"d_42" text,
"d_43" text,
"d_44" text,
"d_45" text,
"d_46" text,
"r_54" text,
"r_53" text,
"r_52" text,
"r_51" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the D 42 which has a D 44 of d 44`:
```sql
|
SELECT SUM("wins") FROM "final_table" WHERE "club"='sd eibar' AND "played"<38; |
## Task
Generate a SQL query to answer the following question:
`How many wins did SD Eibar, which played less than 38 games, have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many wins did SD Eibar, which played less than 38 games, have?`:
```sql
|
SELECT MAX("draws") FROM "final_table" WHERE "wins"<20 AND "points"<41 AND "goals_for"<27; |
## Task
Generate a SQL query to answer the following question:
`What is the highest number of draws a club with less than 20 wins, less than 41 points, and less than 27 goals have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest number of draws a club with less than 20 wins, less than 41 points, and less than 27 goals have?`:
```sql
|
SELECT MIN("goal_difference") FROM "final_table" WHERE "wins">13 AND "losses"<8 AND "draws"<11; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest goal difference a club with more than 13 wins, less than 8 losses, and less than 11 draws has?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest goal difference a club with more than 13 wins, less than 8 losses, and less than 11 draws has?`:
```sql
|
SELECT SUM("played") FROM "final_table" WHERE "points">71 AND "losses"<8; |
## Task
Generate a SQL query to answer the following question:
`What is the number of played games a club with more than 71 points and less than 8 losses has?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the number of played games a club with more than 71 points and less than 8 losses has?`:
```sql
|
SELECT MIN("goal_difference") FROM "final_table" WHERE "goals_against"=61 AND "draws"<11; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest goal difference a club with 61 goals against and less than 11 draws has?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "final_table" (
"position" real,
"club" text,
"played" real,
"points" real,
"wins" real,
"draws" real,
"losses" real,
"goals_for" real,
"goals_against" real,
"goal_difference" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest goal difference a club with 61 goals against and less than 11 draws has?`:
```sql
|
SELECT MIN("crowd") FROM "round_13" WHERE "venue"='princes park'; |
## Task
Generate a SQL query to answer the following question:
`Which Crowd has a Venue of princes park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_13" (
"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 Crowd has a Venue of princes park?`:
```sql
|
SELECT "date" FROM "round_13" WHERE "away_team_score"='16.13 (109)'; |
## Task
Generate a SQL query to answer the following question:
`Which Date has an Away team score of 16.13 (109)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_13" (
"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 Date has an Away team score of 16.13 (109)?`:
```sql
|
SELECT "away_team" FROM "round_13" WHERE "venue"='mcg'; |
## Task
Generate a SQL query to answer the following question:
`Which Away team has a Venue of mcg?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_13" (
"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 has a Venue of mcg?`:
```sql
|
SELECT AVG("crowd") FROM "round_13" WHERE "home_team"='essendon'; |
## Task
Generate a SQL query to answer the following question:
`Which average Crowd has a Home team of essendon?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_13" (
"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 average Crowd has a Home team of essendon?`:
```sql
|
SELECT AVG("pick") FROM "nfl_draft" WHERE "player"='terry cook'; |
## Task
Generate a SQL query to answer the following question:
`When was terry cook picked?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "nfl_draft" (
"pick" real,
"round" text,
"player" text,
"position" text,
"school" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was terry cook picked?`:
```sql
|
SELECT "position" FROM "nfl_draft" WHERE "player"='todd hammel'; |
## Task
Generate a SQL query to answer the following question:
`What position is todd hammel?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "nfl_draft" (
"pick" real,
"round" text,
"player" text,
"position" text,
"school" text
);
### SQL
Given the database schema, here is the SQL query that answers `What position is todd hammel?`:
```sql
|
SELECT "away_team_score" FROM "round_14" WHERE "home_team"='essendon'; |
## Task
Generate a SQL query to answer the following question:
`What is the score of the away team that played Essendon?`
### 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 is the score of the away team that played Essendon?`:
```sql
|
SELECT AVG("crowd") FROM "round_14" WHERE "home_team"='north melbourne'; |
## Task
Generate a SQL query to answer the following question:
`How many people attended the North Melbourne game?`
### 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 `How many people attended the North Melbourne game?`:
```sql
|
SELECT "venue" FROM "round_14" WHERE "away_team"='carlton'; |
## Task
Generate a SQL query to answer the following question:
`Where did Carlton play?`
### 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 `Where did Carlton play?`:
```sql
|
SELECT "home_team" FROM "round_14" WHERE "venue"='vfl park'; |
## Task
Generate a SQL query to answer the following question:
`Which team played at VFL 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 `Which team played at VFL Park?`:
```sql
|
SELECT "player" FROM "2007_boys_team" WHERE "college"='arizona'; |
## Task
Generate a SQL query to answer the following question:
`Which player has a College of arizona?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which player has a College of arizona?`:
```sql
|
SELECT "school" FROM "2007_boys_team" WHERE "hometown"='phoenix, az'; |
## Task
Generate a SQL query to answer the following question:
`Which school has a Hometown of phoenix, az?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which school has a Hometown of phoenix, az?`:
```sql
|
SELECT "nba_draft" FROM "2007_boys_team" WHERE "school"='huntington high school'; |
## Task
Generate a SQL query to answer the following question:
`Which NBA draft has a School of huntington high school?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2007_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which NBA draft has a School of huntington high school?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.