output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT MIN("year") FROM "achievements" WHERE "competition"='european championships'; |
## Task
Generate a SQL query to answer the following question:
`What is the first year of the European Championships competition?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the first year of the European Championships competition?`:
```sql
|
SELECT "position" FROM "achievements" WHERE "venue"='helsinki, finland'; |
## Task
Generate a SQL query to answer the following question:
`Which position has a venue of Helsinki, Finland?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which position has a venue of Helsinki, Finland?`:
```sql
|
SELECT "date" FROM "world_war_ii" WHERE "where_sunk"='east china sea' AND "ship_type"='hell ship'; |
## Task
Generate a SQL query to answer the following question:
`What is the date that a hell ship sunk in the East China Sea?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "world_war_ii" (
"estimate" text,
"name" text,
"nat" text,
"ship_type" text,
"where_sunk" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the date that a hell ship sunk in the East China Sea?`:
```sql
|
SELECT "nat" FROM "world_war_ii" WHERE "ship_type"='battlecruiser' AND "estimate"='513'; |
## Task
Generate a SQL query to answer the following question:
`Which nation had a battlecruiser with an estimate of 513?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "world_war_ii" (
"estimate" text,
"name" text,
"nat" text,
"ship_type" text,
"where_sunk" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which nation had a battlecruiser with an estimate of 513?`:
```sql
|
SELECT "date" FROM "world_war_ii" WHERE "where_sunk"='south atlantic'; |
## Task
Generate a SQL query to answer the following question:
`What is the date that a ship sank in the South Atlantic?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "world_war_ii" (
"estimate" text,
"name" text,
"nat" text,
"ship_type" text,
"where_sunk" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the date that a ship sank in the South Atlantic?`:
```sql
|
SELECT "ship_type" FROM "world_war_ii" WHERE "name"='shinano'; |
## Task
Generate a SQL query to answer the following question:
`What type of ship was the Shinano?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "world_war_ii" (
"estimate" text,
"name" text,
"nat" text,
"ship_type" text,
"where_sunk" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What type of ship was the Shinano?`:
```sql
|
SELECT "nat" FROM "world_war_ii" WHERE "name"='roma'; |
## Task
Generate a SQL query to answer the following question:
`What nation had a ship named Roma?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "world_war_ii" (
"estimate" text,
"name" text,
"nat" text,
"ship_type" text,
"where_sunk" text,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What nation had a ship named Roma?`:
```sql
|
SELECT "score" FROM "game_log" WHERE "opponent"='indians' AND "record"='21-19'; |
## Task
Generate a SQL query to answer the following question:
`What was score of the Blue Jays' game versus the Indians when their record was 21-19?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"opponent" text,
"score" text,
"loss" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was score of the Blue Jays' game versus the Indians when their record was 21-19?`:
```sql
|
SELECT "city" FROM "list" WHERE "capacity">'6,900' AND "division"='south' AND "home_arena"='cloetta center'; |
## Task
Generate a SQL query to answer the following question:
`What city has a team in south division with a home arena with a greater capacity than 6,900 and named cloetta center?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"division" text,
"team" text,
"city" text,
"home_arena" text,
"capacity" real,
"joined_nt_et" text
);
### SQL
Given the database schema, here is the SQL query that answers `What city has a team in south division with a home arena with a greater capacity than 6,900 and named cloetta center?`:
```sql
|
SELECT "years_as_tallest" FROM "timeline_of_tallest_buildings" WHERE "floors"<31 AND "street_address"='211 union street'; |
## Task
Generate a SQL query to answer the following question:
`During what years did the tallest building, located at 211 Union Street, have less than 31 floors?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "timeline_of_tallest_buildings" (
"name" text,
"street_address" text,
"years_as_tallest" text,
"height_ft_m" text,
"floors" real
);
### SQL
Given the database schema, here is the SQL query that answers `During what years did the tallest building, located at 211 Union Street, have less than 31 floors?`:
```sql
|
SELECT AVG("floors") FROM "timeline_of_tallest_buildings" WHERE "street_address"='170 fourth avenue north'; |
## Task
Generate a SQL query to answer the following question:
`What is the average number of floors at 170 Fourth Avenue North?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "timeline_of_tallest_buildings" (
"name" text,
"street_address" text,
"years_as_tallest" text,
"height_ft_m" text,
"floors" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average number of floors at 170 Fourth Avenue North?`:
```sql
|
SELECT "street_address" FROM "timeline_of_tallest_buildings" WHERE "name"='life & casualty tower'; |
## Task
Generate a SQL query to answer the following question:
`What is the address of the Life & Casualty Tower?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "timeline_of_tallest_buildings" (
"name" text,
"street_address" text,
"years_as_tallest" text,
"height_ft_m" text,
"floors" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the address of the Life & Casualty Tower?`:
```sql
|
SELECT "tie_no" FROM "southern_section" WHERE "home_team"='gillingham'; |
## Task
Generate a SQL query to answer the following question:
`What is listed as the Tie no for Home team of Gillingham?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "southern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is listed as the Tie no for Home team of Gillingham?`:
```sql
|
SELECT "tie_no" FROM "southern_section" WHERE "away_team"='barnet'; |
## Task
Generate a SQL query to answer the following question:
`What is the Tie no listed for the Away team of Barnet?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "southern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Tie no listed for the Away team of Barnet?`:
```sql
|
SELECT "attendance" FROM "southern_section" WHERE "tie_no"='5'; |
## Task
Generate a SQL query to answer the following question:
`What is listed for the Attendance that has a Tie no of 5?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "southern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is listed for the Attendance that has a Tie no of 5?`:
```sql
|
SELECT "away_team" FROM "southern_section" WHERE "tie_no"='4'; |
## Task
Generate a SQL query to answer the following question:
`Which Away team has a Tie no of 4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "southern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Away team has a Tie no of 4?`:
```sql
|
SELECT "home_team" FROM "southern_section" WHERE "attendance"='1,859'; |
## Task
Generate a SQL query to answer the following question:
`Which Home Team has an Attendance of 1,859?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "southern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Home Team has an Attendance of 1,859?`:
```sql
|
SELECT "away_team" FROM "southern_section" WHERE "home_team"='bristol rovers'; |
## Task
Generate a SQL query to answer the following question:
`What is listed as the Away team for the Home team of the Bristol Rovers?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "southern_section" (
"tie_no" text,
"home_team" text,
"score" text,
"away_team" text,
"attendance" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is listed as the Away team for the Home team of the Bristol Rovers?`:
```sql
|
SELECT SUM("first_season_of_current_spell_in_segunda_divisi_n") FROM "clubs" WHERE "city"='cañete'; |
## Task
Generate a SQL query to answer the following question:
`What is the total of the first season in Segunda División that has a City of cañete?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clubs" (
"team" text,
"city" text,
"founded" real,
"first_season_in_segunda_divisi_n" real,
"first_season_of_current_spell_in_segunda_divisi_n" real,
"stadium" text,
"capacity" real,
"field" text,
"top_division_titles" real,
"last_top_division_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the total of the first season in Segunda División that has a City of cañete?`:
```sql
|
SELECT "team" FROM "clubs" WHERE "top_division_titles">0 AND "founded">1927 AND "stadium"='miguel grau'; |
## Task
Generate a SQL query to answer the following question:
`Which team has Top division titles larger than 0, a Founded larger than 1927, and a Stadium of miguel grau?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clubs" (
"team" text,
"city" text,
"founded" real,
"first_season_in_segunda_divisi_n" real,
"first_season_of_current_spell_in_segunda_divisi_n" real,
"stadium" text,
"capacity" real,
"field" text,
"top_division_titles" real,
"last_top_division_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which team has Top division titles larger than 0, a Founded larger than 1927, and a Stadium of miguel grau?`:
```sql
|
SELECT "city" FROM "clubs" WHERE "first_season_of_current_spell_in_segunda_divisi_n"<2013; |
## Task
Generate a SQL query to answer the following question:
`Which city has a First season of current spell in Segunda División smaller than 2013?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clubs" (
"team" text,
"city" text,
"founded" real,
"first_season_in_segunda_divisi_n" real,
"first_season_of_current_spell_in_segunda_divisi_n" real,
"stadium" text,
"capacity" real,
"field" text,
"top_division_titles" real,
"last_top_division_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which city has a First season of current spell in Segunda División smaller than 2013?`:
```sql
|
SELECT MIN("capacity") FROM "clubs" WHERE "first_season_in_segunda_divisi_n"=2013 AND "top_division_titles">0; |
## Task
Generate a SQL query to answer the following question:
`What is the smallest capacity for a First season in Segunda División of 2013, and Top division titles larger than 0?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "clubs" (
"team" text,
"city" text,
"founded" real,
"first_season_in_segunda_divisi_n" real,
"first_season_of_current_spell_in_segunda_divisi_n" real,
"stadium" text,
"capacity" real,
"field" text,
"top_division_titles" real,
"last_top_division_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the smallest capacity for a First season in Segunda División of 2013, and Top division titles larger than 0?`:
```sql
|
SELECT COUNT("enrollment") FROM "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" WHERE "institution"='mcgill university' AND "capacity"<'25,012'; |
## Task
Generate a SQL query to answer the following question:
`What's the total enrollment ofr Mcgill University that has a capacity less than 25,012?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" (
"institution" text,
"team" text,
"city" text,
"province" text,
"first_season" real,
"head_coach" text,
"enrollment" real,
"football_stadium" text,
"capacity" real
);
### SQL
Given the database schema, here is the SQL query that answers `What's the total enrollment ofr Mcgill University that has a capacity less than 25,012?`:
```sql
|
SELECT MIN("first_season") FROM "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" WHERE "city"='montreal' AND "capacity">'5,100'; |
## Task
Generate a SQL query to answer the following question:
`What's the smallest season for Montreal that's greater than 5,100 for capacity?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" (
"institution" text,
"team" text,
"city" text,
"province" text,
"first_season" real,
"head_coach" text,
"enrollment" real,
"football_stadium" text,
"capacity" real
);
### SQL
Given the database schema, here is the SQL query that answers `What's the smallest season for Montreal that's greater than 5,100 for capacity?`:
```sql
|
SELECT "city" FROM "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" WHERE "first_season"=1996; |
## Task
Generate a SQL query to answer the following question:
`What's the name of the city whose first season was in 1996?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" (
"institution" text,
"team" text,
"city" text,
"province" text,
"first_season" real,
"head_coach" text,
"enrollment" real,
"football_stadium" text,
"capacity" real
);
### SQL
Given the database schema, here is the SQL query that answers `What's the name of the city whose first season was in 1996?`:
```sql
|
SELECT "institution" FROM "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" WHERE "enrollment">'37,591' AND "football_stadium"='concordia stadium'; |
## Task
Generate a SQL query to answer the following question:
`What's the name of the school that had an enrollment greater than 37,591 with the concordia stadium?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" (
"institution" text,
"team" text,
"city" text,
"province" text,
"first_season" real,
"head_coach" text,
"enrollment" real,
"football_stadium" text,
"capacity" real
);
### SQL
Given the database schema, here is the SQL query that answers `What's the name of the school that had an enrollment greater than 37,591 with the concordia stadium?`:
```sql
|
SELECT "football_stadium" FROM "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" WHERE "team"='carabins'; |
## Task
Generate a SQL query to answer the following question:
`What's the name of the carabins stadium?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "r_seau_du_sport_tudiant_du_qu_bec_dunsmo" (
"institution" text,
"team" text,
"city" text,
"province" text,
"first_season" real,
"head_coach" text,
"enrollment" real,
"football_stadium" text,
"capacity" real
);
### SQL
Given the database schema, here is the SQL query that answers `What's the name of the carabins stadium?`:
```sql
|
SELECT "best" FROM "qualifying_results" WHERE "qual_2"='1:44.050'; |
## Task
Generate a SQL query to answer the following question:
`what team has the qual 2 of 1:44.050?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "qualifying_results" (
"name" text,
"team" text,
"qual_1" text,
"qual_2" text,
"best" text
);
### SQL
Given the database schema, here is the SQL query that answers `what team has the qual 2 of 1:44.050?`:
```sql
|
SELECT "name" FROM "qualifying_results" WHERE "team"='forsythe racing' AND "qual_2"='1:47.132'; |
## Task
Generate a SQL query to answer the following question:
`what name goes along with the team of forsythe racing, and a Qual 2 of 1:47.132?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "qualifying_results" (
"name" text,
"team" text,
"qual_1" text,
"qual_2" text,
"best" text
);
### SQL
Given the database schema, here is the SQL query that answers `what name goes along with the team of forsythe racing, and a Qual 2 of 1:47.132?`:
```sql
|
SELECT "team" FROM "qualifying_results" WHERE "qual_2"='1:44.027'; |
## Task
Generate a SQL query to answer the following question:
`what team had the 1:44.027 qual 2?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "qualifying_results" (
"name" text,
"team" text,
"qual_1" text,
"qual_2" text,
"best" text
);
### SQL
Given the database schema, here is the SQL query that answers `what team had the 1:44.027 qual 2?`:
```sql
|
SELECT "qual_1" FROM "qualifying_results" WHERE "name"='alex tagliani'; |
## Task
Generate a SQL query to answer the following question:
`what is the qual 1 for alex tagliani?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "qualifying_results" (
"name" text,
"team" text,
"qual_1" text,
"qual_2" text,
"best" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the qual 1 for alex tagliani?`:
```sql
|
SELECT "team" FROM "qualifying_results" WHERE "best"='1:43.134'; |
## Task
Generate a SQL query to answer the following question:
`what is the team with the best of 1:43.134?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "qualifying_results" (
"name" text,
"team" text,
"qual_1" text,
"qual_2" text,
"best" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the team with the best of 1:43.134?`:
```sql
|
SELECT "women_s_doubles" FROM "winners" WHERE "year">2004 AND "women_s_singles"='line isberg'; |
## Task
Generate a SQL query to answer the following question:
`What Women's Doubles team played after 2004 and where Line Isberg played Women's Singles?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "winners" (
"year" real,
"men_s_singles" text,
"women_s_singles" text,
"men_s_doubles" text,
"women_s_doubles" text,
"mixed_doubles" text
);
### SQL
Given the database schema, here is the SQL query that answers `What Women's Doubles team played after 2004 and where Line Isberg played Women's Singles?`:
```sql
|
SELECT "men_s_doubles" FROM "winners" WHERE "year">1999 AND "men_s_singles"='kasper ipsen'; |
## Task
Generate a SQL query to answer the following question:
`After 1999, who played Men's Doubles when Kasper Ipsen played Men's Singles?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "winners" (
"year" real,
"men_s_singles" text,
"women_s_singles" text,
"men_s_doubles" text,
"women_s_doubles" text,
"mixed_doubles" text
);
### SQL
Given the database schema, here is the SQL query that answers `After 1999, who played Men's Doubles when Kasper Ipsen played Men's Singles?`:
```sql
|
SELECT "women_s_singles" FROM "winners" WHERE "year"=2010; |
## Task
Generate a SQL query to answer the following question:
`In 2010, who was the Women's Singles player?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "winners" (
"year" real,
"men_s_singles" text,
"women_s_singles" text,
"men_s_doubles" text,
"women_s_doubles" text,
"mixed_doubles" text
);
### SQL
Given the database schema, here is the SQL query that answers `In 2010, who was the Women's Singles player?`:
```sql
|
SELECT "visiting_team" FROM "1994" WHERE "stadium"='rca dome'; |
## Task
Generate a SQL query to answer the following question:
`Who was the visiting team at the matchup at the RCA Dome?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1994" (
"date" text,
"visiting_team" text,
"final_score" text,
"host_team" text,
"stadium" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the visiting team at the matchup at the RCA Dome?`:
```sql
|
SELECT "final_score" FROM "1994" WHERE "host_team"='detroit lions'; |
## Task
Generate a SQL query to answer the following question:
`What was the final score in the game in which the Detroit Lions were the home team?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1994" (
"date" text,
"visiting_team" text,
"final_score" text,
"host_team" text,
"stadium" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the final score in the game in which the Detroit Lions were the home team?`:
```sql
|
SELECT "stadium" FROM "1994" WHERE "date"='november 20'; |
## Task
Generate a SQL query to answer the following question:
`Which stadium hosted the November 20 game?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1994" (
"date" text,
"visiting_team" text,
"final_score" text,
"host_team" text,
"stadium" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which stadium hosted the November 20 game?`:
```sql
|
SELECT "visiting_team" FROM "1994" WHERE "host_team"='minnesota vikings'; |
## Task
Generate a SQL query to answer the following question:
`Who was the visiting team against the Minnesota Vikings?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1994" (
"date" text,
"visiting_team" text,
"final_score" text,
"host_team" text,
"stadium" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the visiting team against the Minnesota Vikings?`:
```sql
|
SELECT "host_team" FROM "1994" WHERE "stadium"='candlestick park'; |
## Task
Generate a SQL query to answer the following question:
`Who was the host team at Candlestick Park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1994" (
"date" text,
"visiting_team" text,
"final_score" text,
"host_team" text,
"stadium" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the host team at Candlestick Park?`:
```sql
|
SELECT "date" FROM "1994" WHERE "final_score"='20-27'; |
## Task
Generate a SQL query to answer the following question:
`Which date had a final score of 20-27?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1994" (
"date" text,
"visiting_team" text,
"final_score" text,
"host_team" text,
"stadium" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which date had a final score of 20-27?`:
```sql
|
SELECT COUNT("year") FROM "achievements" WHERE "position"='2nd'; |
## Task
Generate a SQL query to answer the following question:
`How many years have had the position of 2nd?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many years have had the position of 2nd?`:
```sql
|
SELECT "position" FROM "achievements" WHERE "notes"='20km' AND "year"<2002; |
## Task
Generate a SQL query to answer the following question:
`What position had notes of 20km and a year earlier than 2002?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What position had notes of 20km and a year earlier than 2002?`:
```sql
|
SELECT "venue" FROM "achievements" WHERE "year"<2006 AND "position"='10th'; |
## Task
Generate a SQL query to answer the following question:
`What was the venue before 2006, with the position of 10th?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the venue before 2006, with the position of 10th?`:
```sql
|
SELECT "notes" FROM "achievements" WHERE "venue"='turin, italy'; |
## Task
Generate a SQL query to answer the following question:
`What were the notes when the Venue was Turin, Italy?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "achievements" (
"year" real,
"competition" text,
"venue" text,
"position" text,
"notes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What were the notes when the Venue was Turin, Italy?`:
```sql
|
SELECT "secondary_military_speciality" FROM "characters" WHERE "real_name"='gareth morgan'; |
## Task
Generate a SQL query to answer the following question:
`What is Gareth Morgan's Secondary Military Specialty?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "characters" (
"code_name" text,
"function_figure" text,
"real_name" text,
"birthplace" text,
"serial_number" text,
"primary_military_speciality" text,
"secondary_military_speciality" text,
"equipment" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is Gareth Morgan's Secondary Military Specialty?`:
```sql
|
SELECT "code_name" FROM "characters" WHERE "birthplace"='hawaii'; |
## Task
Generate a SQL query to answer the following question:
`What is the Code Name of the figure born in Hawaii?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "characters" (
"code_name" text,
"function_figure" text,
"real_name" text,
"birthplace" text,
"serial_number" text,
"primary_military_speciality" text,
"secondary_military_speciality" text,
"equipment" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Code Name of the figure born in Hawaii?`:
```sql
|
SELECT "last_title" FROM "current_teams" WHERE "area_province"='greater buenos aires' AND "first_season"='1920'; |
## Task
Generate a SQL query to answer the following question:
`Name the last title for greater buenos aires and first season of 1920`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "current_teams" (
"club" text,
"district" text,
"area_province" text,
"stadium" text,
"first_season" text,
"last_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the last title for greater buenos aires and first season of 1920`:
```sql
|
SELECT "area_province" FROM "current_teams" WHERE "district"='córdoba'; |
## Task
Generate a SQL query to answer the following question:
`Name the area for District of córdoba`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "current_teams" (
"club" text,
"district" text,
"area_province" text,
"stadium" text,
"first_season" text,
"last_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the area for District of córdoba`:
```sql
|
SELECT "last_title" FROM "current_teams" WHERE "club"='quilmes'; |
## Task
Generate a SQL query to answer the following question:
`Name the last title for club of quilmes`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "current_teams" (
"club" text,
"district" text,
"area_province" text,
"stadium" text,
"first_season" text,
"last_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the last title for club of quilmes`:
```sql
|
SELECT "last_title" FROM "current_teams" WHERE "club"='newell''s old boys'; |
## Task
Generate a SQL query to answer the following question:
`Name the last time for club of newell's old boys`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "current_teams" (
"club" text,
"district" text,
"area_province" text,
"stadium" text,
"first_season" text,
"last_title" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the last time for club of newell's old boys`:
```sql
|
SELECT AVG("scored") FROM "international_career" WHERE "competition"='2011 long teng cup' AND "date"='2 october 2011'; |
## Task
Generate a SQL query to answer the following question:
`Name the averag scored for 2011 long teng cup and 2 october 2011`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "international_career" (
"date" text,
"venue" text,
"result" text,
"scored" real,
"competition" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the averag scored for 2011 long teng cup and 2 october 2011`:
```sql
|
SELECT "barrel_twist" FROM "le_series_models" WHERE "barrel_length"='11.5 in.'; |
## Task
Generate a SQL query to answer the following question:
`Can you tell me the Barrel twist that has the Barrel lenght of 11.5 in.?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "le_series_models" (
"colt_model_no" text,
"stock" text,
"fire_control" text,
"rear_sight" text,
"forward_assist" text,
"barrel_length" text,
"barrel_profile" text,
"barrel_twist" text,
"hand_guards" text,
"bayonet_lug" text,
"muzzle_device" text
);
### SQL
Given the database schema, here is the SQL query that answers `Can you tell me the Barrel twist that has the Barrel lenght of 11.5 in.?`:
```sql
|
SELECT SUM("region_total") FROM "population" WHERE "year"<1986 AND "waggamba"='2,732' AND "goondiwindi"<'3,576'; |
## Task
Generate a SQL query to answer the following question:
`What is the region total before 1986 with a Waggamba of 2,732, and a Goondiwindi less than 3,576?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population" (
"year" real,
"region_total" real,
"goondiwindi" real,
"waggamba" real,
"inglewood" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the region total before 1986 with a Waggamba of 2,732, and a Goondiwindi less than 3,576?`:
```sql
|
SELECT AVG("year") FROM "population" WHERE "inglewood"<'2,575'; |
## Task
Generate a SQL query to answer the following question:
`What is the average year that had a value less than 2,575 in Inglewood?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population" (
"year" real,
"region_total" real,
"goondiwindi" real,
"waggamba" real,
"inglewood" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average year that had a value less than 2,575 in Inglewood?`:
```sql
|
SELECT MAX("waggamba") FROM "population" WHERE "inglewood"='2,771' AND "goondiwindi"<'4,374'; |
## Task
Generate a SQL query to answer the following question:
`What is the highest value in Waggamba were Inglewwod had 2,771, but Goondiwindi had less than 4,374?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population" (
"year" real,
"region_total" real,
"goondiwindi" real,
"waggamba" real,
"inglewood" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest value in Waggamba were Inglewwod had 2,771, but Goondiwindi had less than 4,374?`:
```sql
|
SELECT MIN("goondiwindi") FROM "population" WHERE "inglewood">'2,586' AND "year">2001; |
## Task
Generate a SQL query to answer the following question:
`What is the lost amount in Goondiwindi after 2001, and Inglewood had more than 2,586?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population" (
"year" real,
"region_total" real,
"goondiwindi" real,
"waggamba" real,
"inglewood" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lost amount in Goondiwindi after 2001, and Inglewood had more than 2,586?`:
```sql
|
SELECT AVG("inglewood") FROM "population" WHERE "region_total">'9,114' AND "year"=1996 AND "goondiwindi">'4,374'; |
## Task
Generate a SQL query to answer the following question:
`In 1996, what was the value for Inglewood when Goondiwindi had more than 4,374, and there is a region total higher than 9,114?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population" (
"year" real,
"region_total" real,
"goondiwindi" real,
"waggamba" real,
"inglewood" real
);
### SQL
Given the database schema, here is the SQL query that answers `In 1996, what was the value for Inglewood when Goondiwindi had more than 4,374, and there is a region total higher than 9,114?`:
```sql
|
SELECT COUNT("region_total") FROM "population" WHERE "goondiwindi">'4,103' AND "inglewood"='2,613' AND "year">2001; |
## Task
Generate a SQL query to answer the following question:
`What is the region total after 2001 when Goondiwindi had more than 4,103 and Inglewood was at 2,613?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "population" (
"year" real,
"region_total" real,
"goondiwindi" real,
"waggamba" real,
"inglewood" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the region total after 2001 when Goondiwindi had more than 4,103 and Inglewood was at 2,613?`:
```sql
|
SELECT "nature_of_incident" FROM "2004" WHERE "location"='kabul' AND "date"='2004-01-28'; |
## Task
Generate a SQL query to answer the following question:
`What is the nature of the incident in Kabul on 2004-01-28?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2004" (
"date" text,
"location" text,
"nature_of_incident" text,
"circumstances" text,
"casualties" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the nature of the incident in Kabul on 2004-01-28?`:
```sql
|
SELECT "nature_of_incident" FROM "2004" WHERE "circumstances"='bomb attack'; |
## Task
Generate a SQL query to answer the following question:
`What is the nature of the incident that's a bomb attack?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2004" (
"date" text,
"location" text,
"nature_of_incident" text,
"circumstances" text,
"casualties" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the nature of the incident that's a bomb attack?`:
```sql
|
SELECT "nature_of_incident" FROM "2004" WHERE "casualties"='3 wia' AND "circumstances"='ied'; |
## Task
Generate a SQL query to answer the following question:
`What is the nature of the incident with Casualties of 3 wia, and Circumstances of ied?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2004" (
"date" text,
"location" text,
"nature_of_incident" text,
"circumstances" text,
"casualties" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the nature of the incident with Casualties of 3 wia, and Circumstances of ied?`:
```sql
|
SELECT "casualties" FROM "2004" WHERE "location"='kunduz' AND "circumstances"='suicide'; |
## Task
Generate a SQL query to answer the following question:
`Which Casualties have a Location of kunduz, and Circumstances of suicide?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2004" (
"date" text,
"location" text,
"nature_of_incident" text,
"circumstances" text,
"casualties" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Casualties have a Location of kunduz, and Circumstances of suicide?`:
```sql
|
SELECT "casualties" FROM "2004" WHERE "nature_of_incident"='hostile' AND "circumstances"='mortar attack'; |
## Task
Generate a SQL query to answer the following question:
`Which Casualties have a hostile Nature of incident and Circumstances of mortar attack?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2004" (
"date" text,
"location" text,
"nature_of_incident" text,
"circumstances" text,
"casualties" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Casualties have a hostile Nature of incident and Circumstances of mortar attack?`:
```sql
|
SELECT "born_in" FROM "delegates" WHERE "former_experience"='commissioner of health'; |
## Task
Generate a SQL query to answer the following question:
`When was the delegate who has previous experience as a commissioner of health born?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "delegates" (
"district" text,
"party" text,
"religion" text,
"former_experience" text,
"assumed_office" real,
"born_in" real
);
### SQL
Given the database schema, here is the SQL query that answers `When was the delegate who has previous experience as a commissioner of health born?`:
```sql
|
SELECT "airport" FROM "see_also" WHERE "city"='kota kinabalu'; |
## Task
Generate a SQL query to answer the following question:
`What is the name of the airport in the city of Kota Kinabalu?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the name of the airport in the city of Kota Kinabalu?`:
```sql
|
SELECT "iata" FROM "see_also" WHERE "city"='amsterdam'; |
## Task
Generate a SQL query to answer the following question:
`What is the IATA for the city of Amsterdam?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the IATA for the city of Amsterdam?`:
```sql
|
SELECT "country" FROM "see_also" WHERE "iata"='jfk'; |
## Task
Generate a SQL query to answer the following question:
`Which country has an IATA of JFK?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which country has an IATA of JFK?`:
```sql
|
SELECT "city" FROM "see_also" WHERE "iata"='auh'; |
## Task
Generate a SQL query to answer the following question:
`Which city has an IATA of AUH?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which city has an IATA of AUH?`:
```sql
|
SELECT "airport" FROM "see_also" WHERE "iata"='ams'; |
## Task
Generate a SQL query to answer the following question:
`Which airport has an IATA of AMS?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which airport has an IATA of AMS?`:
```sql
|
SELECT "city" FROM "see_also" WHERE "icao"='kiah'; |
## Task
Generate a SQL query to answer the following question:
`Which city has an ICAO of Kiah?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "see_also" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which city has an ICAO of Kiah?`:
```sql
|
SELECT "genre" FROM "actor" WHERE "directed_by"='sándor simó'; |
## Task
Generate a SQL query to answer the following question:
`What Genre did Sándor Simó direct?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "actor" (
"original_title" text,
"title_in_english" text,
"genre" text,
"role" text,
"directed_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What Genre did Sándor Simó direct?`:
```sql
|
SELECT "genre" FROM "actor" WHERE "original_title"='malina (ger.-aus.-fr.)'; |
## Task
Generate a SQL query to answer the following question:
`What is the Genre for Malina (ger.-aus.-fr.), an Original Title?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "actor" (
"original_title" text,
"title_in_english" text,
"genre" text,
"role" text,
"directed_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Genre for Malina (ger.-aus.-fr.), an Original Title?`:
```sql
|
SELECT "original_title" FROM "actor" WHERE "title_in_english"='the last metro'; |
## Task
Generate a SQL query to answer the following question:
`The Last Metro refers to which Original Title?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "actor" (
"original_title" text,
"title_in_english" text,
"genre" text,
"role" text,
"directed_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `The Last Metro refers to which Original Title?`:
```sql
|
SELECT "genre" FROM "actor" WHERE "role"='episode actor' AND "original_title"='franciska vasárnapjai (hungarian)'; |
## Task
Generate a SQL query to answer the following question:
`What original title, Franciska Vasárnapjai (hungarian), had an Episode Actor role which was Directed by Géza Bereményi?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "actor" (
"original_title" text,
"title_in_english" text,
"genre" text,
"role" text,
"directed_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What original title, Franciska Vasárnapjai (hungarian), had an Episode Actor role which was Directed by Géza Bereményi?`:
```sql
|
SELECT "original_title" FROM "actor" WHERE "role"='episode actor' AND "directed_by"='géza bereményi'; |
## Task
Generate a SQL query to answer the following question:
`What is the Original title for an Episode Actor role which was Directed by Géza Bereményi?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "actor" (
"original_title" text,
"title_in_english" text,
"genre" text,
"role" text,
"directed_by" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Original title for an Episode Actor role which was Directed by Géza Bereményi?`:
```sql
|
SELECT AVG("round") FROM "june_draft" WHERE "name"='bob randall'; |
## Task
Generate a SQL query to answer the following question:
`What is the round for bob randall?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "june_draft" (
"round" real,
"name" text,
"position" text,
"school" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the round for bob randall?`:
```sql
|
SELECT "position" FROM "june_draft" WHERE "signed"='yes' AND "round"<24 AND "name"='charlie hough'; |
## Task
Generate a SQL query to answer the following question:
`what is the position when signed is yes, round is less than 24 and name is charlie hough?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "june_draft" (
"round" real,
"name" text,
"position" text,
"school" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the position when signed is yes, round is less than 24 and name is charlie hough?`:
```sql
|
SELECT "school" FROM "june_draft" WHERE "signed"='no' AND "round"=50; |
## Task
Generate a SQL query to answer the following question:
`what is the school when signed is no and round is 50?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "june_draft" (
"round" real,
"name" text,
"position" text,
"school" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the school when signed is no and round is 50?`:
```sql
|
SELECT "school" FROM "june_draft" WHERE "round"=8; |
## Task
Generate a SQL query to answer the following question:
`what is the school for round 8?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "june_draft" (
"round" real,
"name" text,
"position" text,
"school" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the school for round 8?`:
```sql
|
SELECT "position" FROM "june_draft" WHERE "name"='robert johnson'; |
## Task
Generate a SQL query to answer the following question:
`what is the position for robert johnson?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "june_draft" (
"round" real,
"name" text,
"position" text,
"school" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the position for robert johnson?`:
```sql
|
SELECT "signed" FROM "june_draft" WHERE "position"='ss' AND "school"='carson city high school'; |
## Task
Generate a SQL query to answer the following question:
`Was position ss from carson city high school signed?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "june_draft" (
"round" real,
"name" text,
"position" text,
"school" text,
"signed" text
);
### SQL
Given the database schema, here is the SQL query that answers `Was position ss from carson city high school signed?`:
```sql
|
SELECT AVG("yards") FROM "statistics" WHERE "starts">12; |
## Task
Generate a SQL query to answer the following question:
`What was the average number of yards Michael Henig had in a year when he had more than 12 starts/`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "statistics" (
"year" text,
"class" text,
"games" real,
"starts" real,
"comp" real,
"yards" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the average number of yards Michael Henig had in a year when he had more than 12 starts/`:
```sql
|
SELECT AVG("starts") FROM "statistics" WHERE "yards">1201; |
## Task
Generate a SQL query to answer the following question:
`What was the average number of starts Michael Henig had in a year when he had more than 1201 yards?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "statistics" (
"year" text,
"class" text,
"games" real,
"starts" real,
"comp" real,
"yards" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the average number of starts Michael Henig had in a year when he had more than 1201 yards?`:
```sql
|
SELECT "airport" FROM "list" WHERE "iata"='cxb'; |
## Task
Generate a SQL query to answer the following question:
`Name the airport with IATA of cxb`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the airport with IATA of cxb`:
```sql
|
SELECT "airport" FROM "list" WHERE "iata"='dmk'; |
## Task
Generate a SQL query to answer the following question:
`Name the airport with IATA of dmk`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the airport with IATA of dmk`:
```sql
|
SELECT "city" FROM "list" WHERE "airport"='singapore changi airport'; |
## Task
Generate a SQL query to answer the following question:
`Name the city that has singapore changi airport`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the city that has singapore changi airport`:
```sql
|
SELECT "icao" FROM "list" WHERE "iata"='zyl'; |
## Task
Generate a SQL query to answer the following question:
`Name the ICAO for when IATA is zyl`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the ICAO for when IATA is zyl`:
```sql
|
SELECT "icao" FROM "list" WHERE "iata"='rgn'; |
## Task
Generate a SQL query to answer the following question:
`Name the ICAO for IATA of rgn`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the ICAO for IATA of rgn`:
```sql
|
SELECT "icao" FROM "list" WHERE "iata"='ccu'; |
## Task
Generate a SQL query to answer the following question:
`Name the ICAO for IATA of ccu`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list" (
"city" text,
"country" text,
"iata" text,
"icao" text,
"airport" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the ICAO for IATA of ccu`:
```sql
|
SELECT MAX("gold") FROM "medal_table" WHERE "total">16; |
## Task
Generate a SQL query to answer the following question:
`What is the largest gold with a Total larger than 16?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" text,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the largest gold with a Total larger than 16?`:
```sql
|
SELECT MAX("silver") FROM "medal_table" WHERE "total"<2 AND "bronze"<1 AND "nation"='yugoslavia'; |
## Task
Generate a SQL query to answer the following question:
`What is the largest silver with a Total smaller than 2, a Bronze smaller than 1, and a Nation of yugoslavia?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" text,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the largest silver with a Total smaller than 2, a Bronze smaller than 1, and a Nation of yugoslavia?`:
```sql
|
SELECT MIN("bronze") FROM "medal_table" WHERE "nation"='west germany' AND "gold">0; |
## Task
Generate a SQL query to answer the following question:
`What is the smallest bronze with a Nation of west germany, and a Gold larger than 0?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" text,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the smallest bronze with a Nation of west germany, and a Gold larger than 0?`:
```sql
|
SELECT "record" FROM "game_log" WHERE "date"='july 2'; |
## Task
Generate a SQL query to answer the following question:
`What was the record on July 2?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"opponent" text,
"score" text,
"loss" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the record on July 2?`:
```sql
|
SELECT MAX("silver") FROM "medal_table" WHERE "gold"<0; |
## Task
Generate a SQL query to answer the following question:
`What is the largest silver with less than 0 gold?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "medal_table" (
"rank" text,
"nation" text,
"gold" real,
"silver" real,
"bronze" real,
"total" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the largest silver with less than 0 gold?`:
```sql
|
SELECT AVG("total_viewers") FROM "series_1" WHERE "share"='17.6%'; |
## Task
Generate a SQL query to answer the following question:
`What's the average total viewers that has 17.6% Share?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "series_1" (
"episode_no" real,
"airdate" text,
"total_viewers" real,
"share" text,
"bbc_one_weekly_ranking" text
);
### SQL
Given the database schema, here is the SQL query that answers `What's the average total viewers that has 17.6% Share?`:
```sql
|
SELECT "share" FROM "series_1" WHERE "episode_no"=1; |
## Task
Generate a SQL query to answer the following question:
`What's the share of Episode 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "series_1" (
"episode_no" real,
"airdate" text,
"total_viewers" real,
"share" text,
"bbc_one_weekly_ranking" text
);
### SQL
Given the database schema, here is the SQL query that answers `What's the share of Episode 1?`:
```sql
|
SELECT "quantity_made" FROM "dublin_and_south_eastern_railway_1854_19" WHERE "withdrawn"='1913'; |
## Task
Generate a SQL query to answer the following question:
`How many locomotives were made that were withdrawn in 1913?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "dublin_and_south_eastern_railway_1854_19" (
"type" text,
"fleet_numbers" text,
"quantity_made" real,
"date_made" text,
"gsr_class" text,
"gsr_nos" text,
"withdrawn" text
);
### SQL
Given the database schema, here is the SQL query that answers `How many locomotives were made that were withdrawn in 1913?`:
```sql
|
SELECT "date_made" FROM "dublin_and_south_eastern_railway_1854_19" WHERE "type"='0-4-2'; |
## Task
Generate a SQL query to answer the following question:
`What is the date of creation for the locomotive having a type of 0-4-2`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "dublin_and_south_eastern_railway_1854_19" (
"type" text,
"fleet_numbers" text,
"quantity_made" real,
"date_made" text,
"gsr_class" text,
"gsr_nos" text,
"withdrawn" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the date of creation for the locomotive having a type of 0-4-2`:
```sql
|
SELECT "date_made" FROM "dublin_and_south_eastern_railway_1854_19" WHERE "type"='0-6-0' AND "gsr_class"='441'; |
## Task
Generate a SQL query to answer the following question:
`What is the date of creation of the locomotive of type 0-6-0 and GSR class of 441?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "dublin_and_south_eastern_railway_1854_19" (
"type" text,
"fleet_numbers" text,
"quantity_made" real,
"date_made" text,
"gsr_class" text,
"gsr_nos" text,
"withdrawn" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the date of creation of the locomotive of type 0-6-0 and GSR class of 441?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.