output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT "season" FROM "uefa_club_competitions_record" WHERE "result"='6–9'; |
## Task
Generate a SQL query to answer the following question:
`Which season has a Result of 6–9?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "uefa_club_competitions_record" (
"season" text,
"competition" text,
"round" text,
"opponent" text,
"result" text,
"venue" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which season has a Result of 6–9?`:
```sql
|
SELECT "round" FROM "uefa_club_competitions_record" WHERE "venue"='nicosia' AND "opponent"='levski sofia zapad'; |
## Task
Generate a SQL query to answer the following question:
`Which round has a Venue of nicosia, and a Opponent of levski sofia zapad?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "uefa_club_competitions_record" (
"season" text,
"competition" text,
"round" text,
"opponent" text,
"result" text,
"venue" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which round has a Venue of nicosia, and a Opponent of levski sofia zapad?`:
```sql
|
SELECT "result" FROM "2003_fixtures_and_results" WHERE "score"='22-21'; |
## Task
Generate a SQL query to answer the following question:
`What resulted in a score of 22-21?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2003_fixtures_and_results" (
"date" text,
"competition" text,
"venue" text,
"result" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What resulted in a score of 22-21?`:
```sql
|
SELECT "competition" FROM "2003_fixtures_and_results" WHERE "date"='6/7/03'; |
## Task
Generate a SQL query to answer the following question:
`What competition was held on the date 6/7/03`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2003_fixtures_and_results" (
"date" text,
"competition" text,
"venue" text,
"result" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What competition was held on the date 6/7/03`:
```sql
|
SELECT "score" FROM "2003_fixtures_and_results" WHERE "date"='15/6/03'; |
## Task
Generate a SQL query to answer the following question:
`What was the score for the date of 15/6/03`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2003_fixtures_and_results" (
"date" text,
"competition" text,
"venue" text,
"result" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the score for the date of 15/6/03`:
```sql
|
SELECT "venue" FROM "2003_fixtures_and_results" WHERE "date"='8/6/03'; |
## Task
Generate a SQL query to answer the following question:
`What venue is on the date of 8/6/03`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2003_fixtures_and_results" (
"date" text,
"competition" text,
"venue" text,
"result" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What venue is on the date of 8/6/03`:
```sql
|
SELECT "result" FROM "2003_fixtures_and_results" WHERE "score"='12-22'; |
## Task
Generate a SQL query to answer the following question:
`What outcome has a score of 12-22?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2003_fixtures_and_results" (
"date" text,
"competition" text,
"venue" text,
"result" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What outcome has a score of 12-22?`:
```sql
|
SELECT "date" FROM "2003_fixtures_and_results" WHERE "venue"='jjb stadium' AND "result"='w'; |
## Task
Generate a SQL query to answer the following question:
`What date is for Venue of jjb stadium, and a Result of w?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2003_fixtures_and_results" (
"date" text,
"competition" text,
"venue" text,
"result" text,
"score" text
);
### SQL
Given the database schema, here is the SQL query that answers `What date is for Venue of jjb stadium, and a Result of w?`:
```sql
|
SELECT MAX("laps") FROM "classification" WHERE "driver"='françois cevert'; |
## Task
Generate a SQL query to answer the following question:
`What is the high lap total for françois cevert?`
### 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 high lap total for françois cevert?`:
```sql
|
SELECT "constructor" FROM "classification" WHERE "driver"='rolf stommelen'; |
## Task
Generate a SQL query to answer the following question:
`Who constructed rolf stommelen's car?`
### 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 `Who constructed rolf stommelen's car?`:
```sql
|
SELECT "driver" FROM "classification" WHERE "time_retired"='engine' AND "grid"<9; |
## Task
Generate a SQL query to answer the following question:
`Who drive the car that retired due to engine failure and a grid of less than 9?`
### 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 `Who drive the car that retired due to engine failure and a grid of less than 9?`:
```sql
|
SELECT "date" FROM "track_records" WHERE "record"='izod indycar series'; |
## Task
Generate a SQL query to answer the following question:
`When was the race that set the record for the Izod Indycar Series?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "track_records" (
"record" text,
"date" text,
"driver" text,
"time" text,
"speed_avg_speed" text
);
### SQL
Given the database schema, here is the SQL query that answers `When was the race that set the record for the Izod Indycar Series?`:
```sql
|
SELECT "driver" FROM "track_records" WHERE "record"='qualifying' AND "time"='24.761'; |
## Task
Generate a SQL query to answer the following question:
`Which driver set the Qualifying record with a time of 24.761 seconds?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "track_records" (
"record" text,
"date" text,
"driver" text,
"time" text,
"speed_avg_speed" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which driver set the Qualifying record with a time of 24.761 seconds?`:
```sql
|
SELECT "player" FROM "f" WHERE "position"='guard' AND "school_club_team"='byu'; |
## Task
Generate a SQL query to answer the following question:
`What Utah Jazz guard, played at BYU?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "f" (
"player" text,
"nationality" text,
"position" text,
"years_for_jazz" text,
"school_club_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `What Utah Jazz guard, played at BYU?`:
```sql
|
SELECT "school_club_team" FROM "f" WHERE "player"='derek fisher'; |
## Task
Generate a SQL query to answer the following question:
`What college team did Derek Fisher play for?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "f" (
"player" text,
"nationality" text,
"position" text,
"years_for_jazz" text,
"school_club_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `What college team did Derek Fisher play for?`:
```sql
|
SELECT "nationality" FROM "f" WHERE "school_club_team"='utep'; |
## Task
Generate a SQL query to answer the following question:
`The Utah Jazz Player from UTEP was what nationality?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "f" (
"player" text,
"nationality" text,
"position" text,
"years_for_jazz" text,
"school_club_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `The Utah Jazz Player from UTEP was what nationality?`:
```sql
|
SELECT "venue" FROM "round_10" WHERE "home_team"='richmond'; |
## Task
Generate a SQL query to answer the following question:
`What is the name of the venue when the home team is Richmond?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_10" (
"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 name of the venue when the home team is Richmond?`:
```sql
|
SELECT "date" FROM "round_10" WHERE "away_team_score"='15.14 (104)'; |
## Task
Generate a SQL query to answer the following question:
`What is the date of the game when the away team score is 15.14 (104)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_10" (
"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 date of the game when the away team score is 15.14 (104)?`:
```sql
|
SELECT "away_team" FROM "round_10" WHERE "crowd">'21,122' AND "home_team_score"='13.7 (85)'; |
## Task
Generate a SQL query to answer the following question:
`Who is the away team when the crowd is larger than 21,122 and the home team score is 13.7 (85)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_10" (
"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 is the away team when the crowd is larger than 21,122 and the home team score is 13.7 (85)?`:
```sql
|
SELECT "home_team_score" FROM "round_10" WHERE "venue"='princes park'; |
## Task
Generate a SQL query to answer the following question:
`What is the home team score when the venue is Princes Park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_10" (
"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 venue is Princes Park?`:
```sql
|
SELECT SUM("wins") FROM "leaders" WHERE "player"='hale irwin' AND "earnings"<'20,592,965'; |
## Task
Generate a SQL query to answer the following question:
`How many wins did Hale Irwin get with earnings smaller than 20,592,965?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "leaders" (
"rank" real,
"player" text,
"country" text,
"earnings" real,
"wins" real
);
### SQL
Given the database schema, here is the SQL query that answers `How many wins did Hale Irwin get with earnings smaller than 20,592,965?`:
```sql
|
SELECT "actor" FROM "law_enforcement" WHERE "character"='glen cole'; |
## Task
Generate a SQL query to answer the following question:
`What actor plays glen cole?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "law_enforcement" (
"character" text,
"position" text,
"actor" text,
"first_episode" text,
"final_episode" text,
"duration" text,
"final_episode_count" real
);
### SQL
Given the database schema, here is the SQL query that answers `What actor plays glen cole?`:
```sql
|
SELECT AVG("final_episode_count") FROM "law_enforcement" WHERE "character"='maxine valera'; |
## Task
Generate a SQL query to answer the following question:
`What is the average number for a final episode featuring maxine valera?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "law_enforcement" (
"character" text,
"position" text,
"actor" text,
"first_episode" text,
"final_episode" text,
"duration" text,
"final_episode_count" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average number for a final episode featuring maxine valera?`:
```sql
|
SELECT SUM("laps") FROM "classification" WHERE "time_retired"='2:54:23.8'; |
## Task
Generate a SQL query to answer the following question:
`How many laps were driven in 2:54:23.8?`
### 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 were driven in 2:54:23.8?`:
```sql
|
SELECT "constructor" FROM "classification" WHERE "laps"<100 AND "time_retired"='+10 laps'; |
## Task
Generate a SQL query to answer the following question:
`Which constructor has laps less than 100 and a time/retired +10 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 `Which constructor has laps less than 100 and a time/retired +10 laps?`:
```sql
|
SELECT MAX("laps") FROM "classification" WHERE "grid"=8; |
## Task
Generate a SQL query to answer the following question:
`What are the highest number of laps for grid 8?`
### 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 are the highest number of laps for grid 8?`:
```sql
|
SELECT MAX("grid") FROM "classification" WHERE "time_retired"='+0.3'; |
## Task
Generate a SQL query to answer the following question:
`Which grid is the highest and has a time/retired of +0.3?`
### 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 `Which grid is the highest and has a time/retired of +0.3?`:
```sql
|
SELECT "driver" FROM "classification" WHERE "constructor"='maserati' AND "laps">23 AND "grid">7; |
## Task
Generate a SQL query to answer the following question:
`Which driver for Maserati has more laps than 23 and a grid greater than 7?`
### 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 `Which driver for Maserati has more laps than 23 and a grid greater than 7?`:
```sql
|
SELECT "points_classification" FROM "classification_leadership_by_stage" WHERE "general_classification"='bernard hinault' AND "trofeo_fast_team"='bianchi' AND "winner"='urs freuler' AND "stage"='4'; |
## Task
Generate a SQL query to answer the following question:
`Which points classification shares a general classification of Bernard Hinault, a Trofeo Fast Tem of Bianchi, was won by Urs Freuler, and was stage 4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification_leadership_by_stage" (
"stage" text,
"winner" text,
"general_classification" text,
"points_classification" text,
"trofeo_fast_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which points classification shares a general classification of Bernard Hinault, a Trofeo Fast Tem of Bianchi, was won by Urs Freuler, and was stage 4?`:
```sql
|
SELECT "winner" FROM "classification_leadership_by_stage" WHERE "points_classification"='giuseppe saronni' AND "trofeo_fast_team"='bianchi' AND "stage"='3'; |
## Task
Generate a SQL query to answer the following question:
`Who was the winner that had a Points Classification of Giuseppe Saronni, a Trofeo Fast Team of Bianchi, and was Stage 3?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification_leadership_by_stage" (
"stage" text,
"winner" text,
"general_classification" text,
"points_classification" text,
"trofeo_fast_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the winner that had a Points Classification of Giuseppe Saronni, a Trofeo Fast Team of Bianchi, and was Stage 3?`:
```sql
|
SELECT "stage" FROM "classification_leadership_by_stage" WHERE "points_classification"='francesco moser' AND "general_classification"='bernard hinault'; |
## Task
Generate a SQL query to answer the following question:
`Which stage had a Points Classification of Francesco Moser and a general classification of Bernard Hinault?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification_leadership_by_stage" (
"stage" text,
"winner" text,
"general_classification" text,
"points_classification" text,
"trofeo_fast_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which stage had a Points Classification of Francesco Moser and a general classification of Bernard Hinault?`:
```sql
|
SELECT "winner" FROM "classification_leadership_by_stage" WHERE "points_classification"='francesco moser' AND "stage"='12'; |
## Task
Generate a SQL query to answer the following question:
`Who was the winner of Stage 12 with a Points Classification of Francesco Moser?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification_leadership_by_stage" (
"stage" text,
"winner" text,
"general_classification" text,
"points_classification" text,
"trofeo_fast_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the winner of Stage 12 with a Points Classification of Francesco Moser?`:
```sql
|
SELECT "stage" FROM "classification_leadership_by_stage" WHERE "winner"='bernard hinault' AND "points_classification"='francesco moser'; |
## Task
Generate a SQL query to answer the following question:
`Which stage was won by Bernard Hinault and had a Points classification of Francesco Moser?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification_leadership_by_stage" (
"stage" text,
"winner" text,
"general_classification" text,
"points_classification" text,
"trofeo_fast_team" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which stage was won by Bernard Hinault and had a Points classification of Francesco Moser?`:
```sql
|
SELECT "loser" FROM "1970s_raiders_12_6_2" WHERE "date"='december 12' AND "year"=1971; |
## Task
Generate a SQL query to answer the following question:
`Who was the loser on December 12, 1971?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1970s_raiders_12_6_2" (
"year" real,
"date" text,
"winner" text,
"result" text,
"loser" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the loser on December 12, 1971?`:
```sql
|
SELECT "loser" FROM "1970s_raiders_12_6_2" WHERE "location"='municipal stadium' AND "year">1970; |
## Task
Generate a SQL query to answer the following question:
`Who was the loser at Municipal Stadium after 1970?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1970s_raiders_12_6_2" (
"year" real,
"date" text,
"winner" text,
"result" text,
"loser" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the loser at Municipal Stadium after 1970?`:
```sql
|
SELECT "date" FROM "1970s_raiders_12_6_2" WHERE "year"=1975 AND "winner"='oakland raiders'; |
## Task
Generate a SQL query to answer the following question:
`What is the date where the winner was the Oakland Raiders in 1975?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1970s_raiders_12_6_2" (
"year" real,
"date" text,
"winner" text,
"result" text,
"loser" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the date where the winner was the Oakland Raiders in 1975?`:
```sql
|
SELECT "result" FROM "1970s_raiders_12_6_2" WHERE "location"='arrowhead stadium' AND "loser"='kansas city chiefs'; |
## Task
Generate a SQL query to answer the following question:
`What is result of the game at Arrowhead Stadium where the loser was the Kansas City Chiefs?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1970s_raiders_12_6_2" (
"year" real,
"date" text,
"winner" text,
"result" text,
"loser" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is result of the game at Arrowhead Stadium where the loser was the Kansas City Chiefs?`:
```sql
|
SELECT SUM("draw") FROM "dora_1999_7_march_1999" WHERE "song"='\"ljubav jedne žene\"' AND "points"<153; |
## Task
Generate a SQL query to answer the following question:
`What draw for "ljubav jedne žene" with under 153 points?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "dora_1999_7_march_1999" (
"draw" real,
"artist" text,
"song" text,
"points" real,
"place" real
);
### SQL
Given the database schema, here is the SQL query that answers `What draw for "ljubav jedne žene" with under 153 points?`:
```sql
|
SELECT COUNT("place") FROM "dora_1999_7_march_1999" WHERE "song"='\"jednom u životu\"' AND "draw">18; |
## Task
Generate a SQL query to answer the following question:
`What place for "jednom u životu" with a draw larger than 18?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "dora_1999_7_march_1999" (
"draw" real,
"artist" text,
"song" text,
"points" real,
"place" real
);
### SQL
Given the database schema, here is the SQL query that answers `What place for "jednom u životu" with a draw larger than 18?`:
```sql
|
SELECT "work" FROM "awards" WHERE "category"='best movie'; |
## Task
Generate a SQL query to answer the following question:
`What was nominated for the Best Movie category?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "awards" (
"year" real,
"award" text,
"category" text,
"work" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was nominated for the Best Movie category?`:
```sql
|
SELECT "award" FROM "awards" WHERE "work"='scream' AND "year"=1997; |
## Task
Generate a SQL query to answer the following question:
`Which award did Scream receive a nomination and/or win for in 1997?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "awards" (
"year" real,
"award" text,
"category" text,
"work" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which award did Scream receive a nomination and/or win for in 1997?`:
```sql
|
SELECT "category" FROM "awards" WHERE "work"='scream' AND "award"='international horror guild'; |
## Task
Generate a SQL query to answer the following question:
`What category was Scream nominated for at the International Horror Guild?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "awards" (
"year" real,
"award" text,
"category" text,
"work" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What category was Scream nominated for at the International Horror Guild?`:
```sql
|
SELECT "time_retired" FROM "classification" WHERE "laps"<54 AND "driver"='mark donohue'; |
## Task
Generate a SQL query to answer the following question:
`what is the time/retired when the laps is less than 54 and the driver is mark donohue?`
### 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 time/retired when the laps is less than 54 and the driver is mark donohue?`:
```sql
|
SELECT MAX("grid") FROM "classification" WHERE "driver"='mario andretti' AND "laps"<54; |
## Task
Generate a SQL query to answer the following question:
`what is the grid when the driver is mario andretti and the laps is less than 54?`
### 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 when the driver is mario andretti and the laps is less than 54?`:
```sql
|
SELECT COUNT("laps") FROM "classification" WHERE "grid"=24; |
## Task
Generate a SQL query to answer the following question:
`how many laps were there when the grid was 24?`
### 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 were there when the grid was 24?`:
```sql
|
SELECT "time_retired" FROM "classification" WHERE "laps"=6 AND "grid"<18 AND "driver"='clay regazzoni'; |
## Task
Generate a SQL query to answer the following question:
`what is the time/retired when the laps is 6, the grid is less than 18 and the driver is clay regazzoni?`
### 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 time/retired when the laps is 6, the grid is less than 18 and the driver is clay regazzoni?`:
```sql
|
SELECT "class" FROM "barry_railway" WHERE "quantity"<5 AND "gwr_nos"='1322–1323'; |
## Task
Generate a SQL query to answer the following question:
`Which class is smaller than 5 and the GWR is 1322–1323?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "barry_railway" (
"class" text,
"type" text,
"quantity" real,
"barry_nos" text,
"gwr_nos" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which class is smaller than 5 and the GWR is 1322–1323?`:
```sql
|
SELECT "name" FROM "sources" WHERE "province"='central highlands' AND "term_expires"=1996; |
## Task
Generate a SQL query to answer the following question:
`Whose term expired in 1996 and was from the province of Central Highlands?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "sources" (
"name" text,
"party" text,
"province" text,
"term_expires" real,
"term_of_office" text
);
### SQL
Given the database schema, here is the SQL query that answers `Whose term expired in 1996 and was from the province of Central Highlands?`:
```sql
|
SELECT "province" FROM "sources" WHERE "party"='national' AND "name"='ken wright'; |
## Task
Generate a SQL query to answer the following question:
`Ken Wright of the National Party was from which province?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "sources" (
"name" text,
"party" text,
"province" text,
"term_expires" real,
"term_of_office" text
);
### SQL
Given the database schema, here is the SQL query that answers `Ken Wright of the National Party was from which province?`:
```sql
|
SELECT "venue" FROM "achievements" WHERE "year"=1967; |
## Task
Generate a SQL query to answer the following question:
`Which venue hosted a race in 1967?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"tournament" text,
"venue" text,
"result" text,
"event" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which venue hosted a race in 1967?`:
```sql
|
SELECT "tournament" FROM "achievements" WHERE "year">1966; |
## Task
Generate a SQL query to answer the following question:
`Which tournament was held after 1966?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"tournament" text,
"venue" text,
"result" text,
"event" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which tournament was held after 1966?`:
```sql
|
SELECT "venue" FROM "achievements" WHERE "year"=1965; |
## Task
Generate a SQL query to answer the following question:
`Which venue hosted a tournament in 1965?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"tournament" text,
"venue" text,
"result" text,
"event" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which venue hosted a tournament in 1965?`:
```sql
|
SELECT "result" FROM "original_london_production" WHERE "nominee"='best new musical'; |
## Task
Generate a SQL query to answer the following question:
`What is the result for the best new musical nominee?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "original_london_production" (
"year" real,
"award" text,
"category" text,
"nominee" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the result for the best new musical nominee?`:
```sql
|
SELECT COUNT("year") FROM "original_london_production" WHERE "nominee"='simon baker'; |
## Task
Generate a SQL query to answer the following question:
`How many years does simon baker appear as a nominee?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "original_london_production" (
"year" real,
"award" text,
"category" text,
"nominee" text,
"result" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many years does simon baker appear as a nominee?`:
```sql
|
SELECT "height_in_ft" FROM "f" WHERE "years_for_rockets"='2005-06'; |
## Task
Generate a SQL query to answer the following question:
`What is the Height for Years of Rockets of 2005-06?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "f" (
"player" text,
"no_s" text,
"height_in_ft" text,
"position" text,
"years_for_rockets" text,
"school_club_team_country" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Height for Years of Rockets of 2005-06?`:
```sql
|
SELECT "height_in_ft" FROM "f" WHERE "years_for_rockets"='2005-06'; |
## Task
Generate a SQL query to answer the following question:
`What is the Height for Years for Rockets of 2005-06?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "f" (
"player" text,
"no_s" text,
"height_in_ft" text,
"position" text,
"years_for_rockets" text,
"school_club_team_country" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Height for Years for Rockets of 2005-06?`:
```sql
|
SELECT "attendance" FROM "game_log" WHERE "date"='august 15'; |
## Task
Generate a SQL query to answer the following question:
`What is the Attendance on august 15?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"opponent" text,
"score" text,
"loss" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Attendance on august 15?`:
```sql
|
SELECT "constructor" FROM "season_review" WHERE "fastest_lap"='nigel mansell'; |
## Task
Generate a SQL query to answer the following question:
`What is the constructor for the race with Nigel Mansell as the fastest lap?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "season_review" (
"race" text,
"date" text,
"location" text,
"pole_position" text,
"fastest_lap" text,
"race_winner" text,
"constructor" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the constructor for the race with Nigel Mansell as the fastest lap?`:
```sql
|
SELECT "fastest_lap" FROM "season_review" WHERE "location"='estoril'; |
## Task
Generate a SQL query to answer the following question:
`What is the fastest lap at estoril?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "season_review" (
"race" text,
"date" text,
"location" text,
"pole_position" text,
"fastest_lap" text,
"race_winner" text,
"constructor" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the fastest lap at estoril?`:
```sql
|
SELECT "race" FROM "season_review" WHERE "fastest_lap"='keke rosberg' AND "location"='paul ricard'; |
## Task
Generate a SQL query to answer the following question:
`What is the race in Paul Ricard with Keke Rosberg as the fastest lap?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "season_review" (
"race" text,
"date" text,
"location" text,
"pole_position" text,
"fastest_lap" text,
"race_winner" text,
"constructor" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the race in Paul Ricard with Keke Rosberg as the fastest lap?`:
```sql
|
SELECT "race_winner" FROM "season_review" WHERE "location"='spa-francorchamps'; |
## Task
Generate a SQL query to answer the following question:
`Who was the winner at spa-francorchamps?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "season_review" (
"race" text,
"date" text,
"location" text,
"pole_position" text,
"fastest_lap" text,
"race_winner" text,
"constructor" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the winner at spa-francorchamps?`:
```sql
|
SELECT "venue" FROM "international_goals" WHERE "result"='7-2'; |
## Task
Generate a SQL query to answer the following question:
`Where was the game with result 7-2 played?`
### 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 `Where was the game with result 7-2 played?`:
```sql
|
SELECT "score" FROM "international_goals" WHERE "competition"='friendly' AND "result"='7-2'; |
## Task
Generate a SQL query to answer the following question:
`What was the score of the Friendly competition where the result was 7-2?`
### 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 `What was the score of the Friendly competition where the result was 7-2?`:
```sql
|
SELECT "score" FROM "international_goals" WHERE "date"='27 january 1996'; |
## Task
Generate a SQL query to answer the following question:
`What was the score of the game on 27 January 1996?`
### 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 `What was the score of the game on 27 January 1996?`:
```sql
|
SELECT "competition" FROM "international_goals" WHERE "result"='3-2'; |
## Task
Generate a SQL query to answer the following question:
`What is the event with a result of 3-2?`
### 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 `What is the event with a result of 3-2?`:
```sql
|
SELECT SUM("crowd") FROM "round_21" WHERE "venue"='junction oval'; |
## Task
Generate a SQL query to answer the following question:
`How big was the crowd size, at the Junction Oval venue?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_21" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `How big was the crowd size, at the Junction Oval venue?`:
```sql
|
SELECT "away_team_score" FROM "round_21" WHERE "away_team"='melbourne'; |
## Task
Generate a SQL query to answer the following question:
`What is the visiting team of Melbourne's score?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_21" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the visiting team of Melbourne's score?`:
```sql
|
SELECT AVG("crowd") FROM "round_21" WHERE "home_team"='fitzroy'; |
## Task
Generate a SQL query to answer the following question:
`What is the average crowd size of Fitzroy's home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_21" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average crowd size of Fitzroy's home team?`:
```sql
|
SELECT MIN("build_date") FROM "locomotives" WHERE "disposal"='scrapped 1941'; |
## Task
Generate a SQL query to answer the following question:
`Which railway had the earliest build date and a disposal of "Scrapped 1941?"`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives" (
"railway" text,
"loco_name" text,
"build_date" real,
"wheels" text,
"disposal" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which railway had the earliest build date and a disposal of "Scrapped 1941?"`:
```sql
|
SELECT "railway" FROM "locomotives" WHERE "build_date"=1911 AND "loco_name"='pyramus'; |
## Task
Generate a SQL query to answer the following question:
`Which railway had a loco name of Pyramus and a build date of 1911?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives" (
"railway" text,
"loco_name" text,
"build_date" real,
"wheels" text,
"disposal" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which railway had a loco name of Pyramus and a build date of 1911?`:
```sql
|
SELECT "build_date" FROM "locomotives" WHERE "wheels"='0-6-2 t'; |
## Task
Generate a SQL query to answer the following question:
`What was the build date of the railway(s) with 0-6-2 t wheels?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives" (
"railway" text,
"loco_name" text,
"build_date" real,
"wheels" text,
"disposal" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the build date of the railway(s) with 0-6-2 t wheels?`:
```sql
|
SELECT "disbanded" FROM "sports" WHERE "league"='ahl'; |
## Task
Generate a SQL query to answer the following question:
`Which disbanded is in the ahl league?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "sports" (
"club" text,
"league" text,
"sport" text,
"venue" text,
"established" real,
"disbanded" text,
"championships" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which disbanded is in the ahl league?`:
```sql
|
SELECT "championships" FROM "sports" WHERE "established">2005; |
## Task
Generate a SQL query to answer the following question:
`Which championship was established after 2005?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "sports" (
"club" text,
"league" text,
"sport" text,
"venue" text,
"established" real,
"disbanded" text,
"championships" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which championship was established after 2005?`:
```sql
|
SELECT "year" FROM "boys_basketball_players_and_coaches_of_t" WHERE "player"='j.r. reid'; |
## Task
Generate a SQL query to answer the following question:
`Which year had J.R. Reid as a player?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "boys_basketball_players_and_coaches_of_t" (
"year" text,
"player" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which year had J.R. Reid as a player?`:
```sql
|
SELECT "hometown" FROM "boys_basketball_players_and_coaches_of_t" WHERE "player"='dajuan wagner'; |
## Task
Generate a SQL query to answer the following question:
`Which hometown is the played Dajuan Wagner from?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "boys_basketball_players_and_coaches_of_t" (
"year" text,
"player" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which hometown is the played Dajuan Wagner from?`:
```sql
|
SELECT "crowd" FROM "round_1" WHERE "home_team"='carlton'; |
## Task
Generate a SQL query to answer the following question:
`When the home team was carlton how many people were in the crowd?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"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 was carlton how many people were in the crowd?`:
```sql
|
SELECT "away_team" FROM "round_1" WHERE "crowd">'23,000'; |
## Task
Generate a SQL query to answer the following question:
`Which away team had a crowd of over 23,000 people?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"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 had a crowd of over 23,000 people?`:
```sql
|
SELECT "home_team" FROM "round_1" WHERE "venue"='western oval'; |
## Task
Generate a SQL query to answer the following question:
`What's the home team for the western oval venue?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"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's the home team for the western oval venue?`:
```sql
|
SELECT "home_team_score" FROM "round_1" WHERE "venue"='junction oval'; |
## Task
Generate a SQL query to answer the following question:
`What's the home team for the junction oval venue?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"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's the home team for the junction oval venue?`:
```sql
|
SELECT "date" FROM "round_1" WHERE "away_team_score"='13.10 (88)'; |
## Task
Generate a SQL query to answer the following question:
`What date did the away team score 13.10 (88)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_1" (
"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 date did the away team score 13.10 (88)?`:
```sql
|
SELECT "result" FROM "uefa_cup" WHERE "opponent"='fenerbahçe'; |
## Task
Generate a SQL query to answer the following question:
`What was the result when the opponent was fenerbahçe?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "uefa_cup" (
"date_and_time" text,
"round" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the result when the opponent was fenerbahçe?`:
```sql
|
SELECT "apparent_magnitude" FROM "6001_6100" WHERE "ngc_number"='6027d'; |
## Task
Generate a SQL query to answer the following question:
`what is the apparent magnitude of NGC number 6027d?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "6001_6100" (
"ngc_number" text,
"object_type" text,
"constellation" text,
"right_ascension_j2000" text,
"declination_j2000" text,
"apparent_magnitude" real
);
### SQL
Given the database schema, here is the SQL query that answers `what is the apparent magnitude of NGC number 6027d?`:
```sql
|
SELECT "visitor" FROM "november" WHERE "home"='grizzlies' AND "date"='13 november 2007'; |
## Task
Generate a SQL query to answer the following question:
`What is the visiting team of the game with the home team Grizzlies on 13 November 2007?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "november" (
"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 visiting team of the game with the home team Grizzlies on 13 November 2007?`:
```sql
|
SELECT "date" FROM "november" WHERE "home"='mavericks'; |
## Task
Generate a SQL query to answer the following question:
`What is the date of the game when the Mavericks were the home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "november" (
"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 date of the game when the Mavericks were the home team?`:
```sql
|
SELECT MIN("year_made") FROM "locomotives_of_the_southern_railway" WHERE "wheel_arrangement"='0-4-2t'; |
## Task
Generate a SQL query to answer the following question:
`Which of the lowest years had a Wheel arrangement that was 0-4-2t?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives_of_the_southern_railway" (
"iwcr_no" text,
"name" text,
"wheel_arrangement" text,
"sr_no" text,
"year_made" real,
"year_withdrawn" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which of the lowest years had a Wheel arrangement that was 0-4-2t?`:
```sql
|
SELECT AVG("year_made") FROM "locomotives_of_the_southern_railway" WHERE "iwcr_no"='5' AND "year_withdrawn">1926; |
## Task
Generate a SQL query to answer the following question:
`What is the mean Year when the IWCR number was 5 and the Year withdrawn was bigger than 1926?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives_of_the_southern_railway" (
"iwcr_no" text,
"name" text,
"wheel_arrangement" text,
"sr_no" text,
"year_made" real,
"year_withdrawn" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the mean Year when the IWCR number was 5 and the Year withdrawn was bigger than 1926?`:
```sql
|
SELECT "sr_no" FROM "locomotives_of_the_southern_railway" WHERE "wheel_arrangement"='0-6-0t' AND "year_made">1874 AND "year_withdrawn"=1963; |
## Task
Generate a SQL query to answer the following question:
`Which SR number had a wheel arrangement of 0-6-0t, the year made was more recent than 1874, and the year withdrawn was 1963?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives_of_the_southern_railway" (
"iwcr_no" text,
"name" text,
"wheel_arrangement" text,
"sr_no" text,
"year_made" real,
"year_withdrawn" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which SR number had a wheel arrangement of 0-6-0t, the year made was more recent than 1874, and the year withdrawn was 1963?`:
```sql
|
SELECT COUNT("year_made") FROM "locomotives_of_the_southern_railway" WHERE "wheel_arrangement"='0-4-0t'; |
## Task
Generate a SQL query to answer the following question:
`What is the sum number of years where the wheel arrangement of 0-4-0t?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "locomotives_of_the_southern_railway" (
"iwcr_no" text,
"name" text,
"wheel_arrangement" text,
"sr_no" text,
"year_made" real,
"year_withdrawn" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum number of years where the wheel arrangement of 0-4-0t?`:
```sql
|
SELECT MAX("week") FROM "schedule" WHERE "attendance"='63,001'; |
## Task
Generate a SQL query to answer the following question:
`What was the latest week of a game that had an attendance of 63,001?`
### 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" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the latest week of a game that had an attendance of 63,001?`:
```sql
|
SELECT COUNT("total") FROM "medal_table" WHERE "nation"='austria' AND "rank">4; |
## Task
Generate a SQL query to answer the following question:
`What is the total medals Austria and those with larger than rank 4 have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the total medals Austria and those with larger than rank 4 have?`:
```sql
|
SELECT MAX("gold") FROM "medal_table" WHERE "rank"<6 AND "silver"=1 AND "total">4; |
## Task
Generate a SQL query to answer the following question:
`What is the most gold medals that a team ranked higher than 6, have 1 silver medal, and more than 4 total medals have?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" real,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the most gold medals that a team ranked higher than 6, have 1 silver medal, and more than 4 total medals have?`:
```sql
|
SELECT "country" FROM "list_of_operating_reverchon_roller_coast" WHERE "opened"=2002 AND "model"='spinning coaster' AND "park"='disney''s animal kingdom'; |
## Task
Generate a SQL query to answer the following question:
`Which country has a rollercoaster that opened in 2002, is a spinning coaster, and is located in Disney's Animal Kingdom?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_operating_reverchon_roller_coast" (
"name" text,
"model" text,
"park" text,
"country" text,
"opened" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which country has a rollercoaster that opened in 2002, is a spinning coaster, and is located in Disney's Animal Kingdom?`:
```sql
|
SELECT "name" FROM "list_of_operating_reverchon_roller_coast" WHERE "opened"=2000 AND "park"='brighton pier'; |
## Task
Generate a SQL query to answer the following question:
`What is the name of the roller coaster that opened in 2000 in Brighton Pier?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_operating_reverchon_roller_coast" (
"name" text,
"model" text,
"park" text,
"country" text,
"opened" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the name of the roller coaster that opened in 2000 in Brighton Pier?`:
```sql
|
SELECT COUNT("attendance") FROM "game_log" WHERE "date"='may 6'; |
## Task
Generate a SQL query to answer the following question:
`How many attended on may 6?`
### 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 many attended on may 6?`:
```sql
|
SELECT "opponent" FROM "game_log" WHERE "score"='3-17'; |
## Task
Generate a SQL query to answer the following question:
`Who did they lose to 3-17?`
### 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 `Who did they lose to 3-17?`:
```sql
|
SELECT "home_team" FROM "round_12" WHERE "away_team_score"='12.11 (83)'; |
## Task
Generate a SQL query to answer the following question:
`What team was the home team when the away team scored 12.11 (83)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What team was the home team when the away team scored 12.11 (83)?`:
```sql
|
SELECT "venue" FROM "round_12" WHERE "home_team"='richmond'; |
## Task
Generate a SQL query to answer the following question:
`What venue did Richmond play at as the home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What venue did Richmond play at as the home team?`:
```sql
|
SELECT "home_team" FROM "round_12" WHERE "away_team"='footscray'; |
## Task
Generate a SQL query to answer the following question:
`What home team played against Footscray as the away team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What home team played against Footscray as the away team?`:
```sql
|
SELECT "date" FROM "round_12" WHERE "away_team_score"='14.8 (92)'; |
## Task
Generate a SQL query to answer the following question:
`What date did the away team score 14.8 (92)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_12" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What date did the away team score 14.8 (92)?`:
```sql
|
SELECT "attendance" FROM "ties" WHERE "away_team"='boreham wood'; |
## Task
Generate a SQL query to answer the following question:
`what was the attendance when the away team was boreham wood?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "ties" (
"tie_no" real,
"home_team" text,
"score" text,
"away_team" text,
"attendance" real
);
### SQL
Given the database schema, here is the SQL query that answers `what was the attendance when the away team was boreham wood?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.