output stringlengths 27 479 | instruction stringlengths 407 1.39k |
|---|---|
SELECT COUNT("total") FROM "medal_table" WHERE "silver">0 AND "gold"<5 AND "bronze"<0; |
## Task
Generate a SQL query to answer the following question:
`If there are more than 0 Silver medals, less than 5 gold medals, and no bronze medals, what was the total number of medals?`
### 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 `If there are more than 0 Silver medals, less than 5 gold medals, and no bronze medals, what was the total number of medals?`:
```sql
|
SELECT SUM("ngc_number") FROM "6401_6500" WHERE "declination_j2000"='°15′55″' AND "apparent_magnitude">10; |
## Task
Generate a SQL query to answer the following question:
`What's the total number of NGC that has a Declination ( J2000 ) of °15′55″, and an Apparent magnitude greater than 10?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "6401_6500" (
"ngc_number" real,
"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's the total number of NGC that has a Declination ( J2000 ) of °15′55″, and an Apparent magnitude greater than 10?`:
```sql
|
SELECT "object_type" FROM "6401_6500" WHERE "apparent_magnitude">9.6 AND "right_ascension_j2000"='17h59m02.0s'; |
## Task
Generate a SQL query to answer the following question:
`Which object has an Apparent magnitude larger than 9.6, and a Right ascension ( J2000 ) of 17h59m02.0s?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "6401_6500" (
"ngc_number" real,
"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 `Which object has an Apparent magnitude larger than 9.6, and a Right ascension ( J2000 ) of 17h59m02.0s?`:
```sql
|
SELECT "strain" FROM "list_of_sequenced_bacterial_genomes" WHERE "genes"='5,566'; |
## Task
Generate a SQL query to answer the following question:
`Which species of bacteria has 5,566 genes?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_sequenced_bacterial_genomes" (
"species" text,
"strain" text,
"type" text,
"base_pairs" text,
"genes" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which species of bacteria has 5,566 genes?`:
```sql
|
SELECT "strain" FROM "list_of_sequenced_bacterial_genomes" WHERE "species"='thiomicrospira crunogena'; |
## Task
Generate a SQL query to answer the following question:
`What is the Strain name of Species Thiomicrospira crunogena?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "list_of_sequenced_bacterial_genomes" (
"species" text,
"strain" text,
"type" text,
"base_pairs" text,
"genes" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Strain name of Species Thiomicrospira crunogena?`:
```sql
|
SELECT "location" FROM "mixed_martial_arts_record" WHERE "record"='5-3'; |
## Task
Generate a SQL query to answer the following question:
`Name the location of record 5-3`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mixed_martial_arts_record" (
"res" text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"round" real,
"time" text,
"location" text
);
### SQL
Given the database schema, here is the SQL query that answers `Name the location of record 5-3`:
```sql
|
SELECT AVG("rank") FROM "current_standings" WHERE "percentage"='56%' AND "loss"<4; |
## Task
Generate a SQL query to answer the following question:
`What's the rank for a team that has a percentage of 56% and a loss smaller than 4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "current_standings" (
"rank" real,
"team" text,
"loss" real,
"sets_won" real,
"sets_lost" real,
"percentage" text
);
### SQL
Given the database schema, here is the SQL query that answers `What's the rank for a team that has a percentage of 56% and a loss smaller than 4?`:
```sql
|
SELECT AVG("avg") FROM "wide_receivers" WHERE "td_s"<3 AND "player"='devin wyman' AND "long">3; |
## Task
Generate a SQL query to answer the following question:
`Name the average avg for TD's less than 3 for devin wyman and long more than 3`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "wide_receivers" (
"player" text,
"rec" real,
"yards" real,
"avg" real,
"td_s" real,
"long" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the average avg for TD's less than 3 for devin wyman and long more than 3`:
```sql
|
SELECT MIN("yards") FROM "wide_receivers" WHERE "long"=34 AND "avg"<12.6; |
## Task
Generate a SQL query to answer the following question:
`Name the lowest yards for 34 long and avg less than 12.6`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "wide_receivers" (
"player" text,
"rec" real,
"yards" real,
"avg" real,
"td_s" real,
"long" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the lowest yards for 34 long and avg less than 12.6`:
```sql
|
SELECT "team" FROM "1983_nascar_winston_cup_series_drivers" WHERE "sponsor"='chameleon sunglasses'; |
## Task
Generate a SQL query to answer the following question:
`What team is sponsored by chameleon sunglasses?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1983_nascar_winston_cup_series_drivers" (
"team" text,
"make" text,
"driver" text,
"sponsor" text,
"car_owner" text
);
### SQL
Given the database schema, here is the SQL query that answers `What team is sponsored by chameleon sunglasses?`:
```sql
|
SELECT "team" FROM "1983_nascar_winston_cup_series_drivers" WHERE "make"='buick regal' AND "driver"='bobby hillin jr. (r)'; |
## Task
Generate a SQL query to answer the following question:
`What team does bobby hillin jr. (r) drive a buick regal for?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1983_nascar_winston_cup_series_drivers" (
"team" text,
"make" text,
"driver" text,
"sponsor" text,
"car_owner" text
);
### SQL
Given the database schema, here is the SQL query that answers `What team does bobby hillin jr. (r) drive a buick regal for?`:
```sql
|
SELECT "team" FROM "1983_nascar_winston_cup_series_drivers" WHERE "sponsor"='w.h. bolin'; |
## Task
Generate a SQL query to answer the following question:
`What team is sponsored by w.h. bolin?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1983_nascar_winston_cup_series_drivers" (
"team" text,
"make" text,
"driver" text,
"sponsor" text,
"car_owner" text
);
### SQL
Given the database schema, here is the SQL query that answers `What team is sponsored by w.h. bolin?`:
```sql
|
SELECT "driver" FROM "1983_nascar_winston_cup_series_drivers" WHERE "sponsor"='w.h. bolin'; |
## Task
Generate a SQL query to answer the following question:
`Who drives for the sponsor w.h. bolin?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1983_nascar_winston_cup_series_drivers" (
"team" text,
"make" text,
"driver" text,
"sponsor" text,
"car_owner" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who drives for the sponsor w.h. bolin?`:
```sql
|
SELECT "sponsor" FROM "1983_nascar_winston_cup_series_drivers" WHERE "driver"='neil bonnett'; |
## Task
Generate a SQL query to answer the following question:
`Who sponsors driver neil bonnett?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1983_nascar_winston_cup_series_drivers" (
"team" text,
"make" text,
"driver" text,
"sponsor" text,
"car_owner" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who sponsors driver neil bonnett?`:
```sql
|
SELECT "channel" FROM "analogue_terrestrial_television" WHERE "description"='public broadcaster'; |
## Task
Generate a SQL query to answer the following question:
`What channel has a description of the public broadcaster?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "analogue_terrestrial_television" (
"channel" text,
"description" text,
"financed_by" text,
"owned_by" text,
"launched" real
);
### SQL
Given the database schema, here is the SQL query that answers `What channel has a description of the public broadcaster?`:
```sql
|
SELECT "channel" FROM "analogue_terrestrial_television" WHERE "financed_by"='commercials'; |
## Task
Generate a SQL query to answer the following question:
`What was the channel that was financed by commercials?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "analogue_terrestrial_television" (
"channel" text,
"description" text,
"financed_by" text,
"owned_by" text,
"launched" real
);
### SQL
Given the database schema, here is the SQL query that answers `What was the channel that was financed by commercials?`:
```sql
|
SELECT MAX("laps") FROM "race" WHERE "constructor"='minardi - fondmetal' AND "driver"='marc gené' AND "grid">20; |
## Task
Generate a SQL query to answer the following question:
`Which entry has the highest laps of those with constructor Minardi - Fondmetal, driver Marc Gené, and a grid larger than 20?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which entry has the highest laps of those with constructor Minardi - Fondmetal, driver Marc Gené, and a grid larger than 20?`:
```sql
|
SELECT SUM("grid") FROM "race" WHERE "laps">66 AND "driver"='michael schumacher'; |
## Task
Generate a SQL query to answer the following question:
`What is the sum of grid values of driver Michael Schumacher with lap counts larger than 66?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the sum of grid values of driver Michael Schumacher with lap counts larger than 66?`:
```sql
|
SELECT "driver" FROM "race" WHERE "laps"=62; |
## Task
Generate a SQL query to answer the following question:
`Which driver has 62 laps?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Which driver has 62 laps?`:
```sql
|
SELECT MAX("grid") FROM "race" WHERE "constructor"='mclaren - mercedes' AND "driver"='david coulthard' AND "laps"<66; |
## Task
Generate a SQL query to answer the following question:
`What is the highest grid value with constructor Mclaren - Mercedes, driver David Coulthard, and has fewer than 66 laps?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest grid value with constructor Mclaren - Mercedes, driver David Coulthard, and has fewer than 66 laps?`:
```sql
|
SELECT MAX("laps") FROM "race" WHERE "grid"=17; |
## Task
Generate a SQL query to answer the following question:
`What is the highest number of laps for grid 17?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the highest number of laps for grid 17?`:
```sql
|
SELECT "rounds" FROM "championship_drivers_and_constructors" WHERE "driver"='roger williamson'; |
## Task
Generate a SQL query to answer the following question:
`None of the rounds has Roger Williamson as a driver.`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "championship_drivers_and_constructors" (
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `None of the rounds has Roger Williamson as a driver.`:
```sql
|
SELECT "time_retired" FROM "race" WHERE "driver"='alain prost'; |
## Task
Generate a SQL query to answer the following question:
`What is the time/retired for alain prost?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the time/retired for alain prost?`:
```sql
|
SELECT "time_retired" FROM "race" WHERE "grid"=9; |
## Task
Generate a SQL query to answer the following question:
`What is the time/retired for grid 9?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the time/retired for grid 9?`:
```sql
|
SELECT "driver" FROM "race" WHERE "time_retired"='suspension'; |
## Task
Generate a SQL query to answer the following question:
`Who had to retire due to suspension?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `Who had to retire due to suspension?`:
```sql
|
SELECT "class" FROM "sports" WHERE "sport"='volleyball' AND "year"=2000; |
## Task
Generate a SQL query to answer the following question:
`What class is volleyball in 2000?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "sports" (
"sport" text,
"year" real,
"class" text,
"coach" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What class is volleyball in 2000?`:
```sql
|
SELECT "record" FROM "sports" WHERE "class"='3a' AND "sport"='volleyball'; |
## Task
Generate a SQL query to answer the following question:
`What is the team's record in 3a volleyball?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "sports" (
"sport" text,
"year" real,
"class" text,
"coach" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the team's record in 3a volleyball?`:
```sql
|
SELECT "away_team" FROM "round_16" WHERE "home_team"='melbourne'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team at Melbourne's home game?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_16" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team at Melbourne's home game?`:
```sql
|
SELECT "away_team_score" FROM "round_16" WHERE "venue"='corio oval'; |
## Task
Generate a SQL query to answer the following question:
`What was the away team score at Corio Oval?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_16" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the away team score at Corio Oval?`:
```sql
|
SELECT "date" FROM "round_16" WHERE "away_team_score"='12.14 (86)'; |
## Task
Generate a SQL query to answer the following question:
`When did the away team score 12.14 (86)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_16" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `When did the away team score 12.14 (86)?`:
```sql
|
SELECT "call_sign" FROM "mi_g_credits" WHERE "tail_code"='oy' AND "weapon_systems_officer"='capt charles b. debellevue'; |
## Task
Generate a SQL query to answer the following question:
`Which Call Sign that has a Tail Code of oy belong to Weapon Systems Officer Capt Charles B. Debellevue?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mi_g_credits" (
"date" text,
"pilot" text,
"weapon_systems_officer" text,
"aircraft" text,
"tail_code" text,
"call_sign" text,
"kill" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Call Sign that has a Tail Code of oy belong to Weapon Systems Officer Capt Charles B. Debellevue?`:
```sql
|
SELECT "tail_code" FROM "mi_g_credits" WHERE "weapon_systems_officer"='capt charles b. debellevue'; |
## Task
Generate a SQL query to answer the following question:
`Which Tail Code belongs to Weapon Systems Officer Capt Charles B. Debellevue?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mi_g_credits" (
"date" text,
"pilot" text,
"weapon_systems_officer" text,
"aircraft" text,
"tail_code" text,
"call_sign" text,
"kill" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Tail Code belongs to Weapon Systems Officer Capt Charles B. Debellevue?`:
```sql
|
SELECT "aircraft" FROM "mi_g_credits" WHERE "call_sign"='paula 01'; |
## Task
Generate a SQL query to answer the following question:
`Which Aircraft has the Call Sign Paula 01?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mi_g_credits" (
"date" text,
"pilot" text,
"weapon_systems_officer" text,
"aircraft" text,
"tail_code" text,
"call_sign" text,
"kill" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Aircraft has the Call Sign Paula 01?`:
```sql
|
SELECT "call_sign" FROM "mi_g_credits" WHERE "tail_code"='ed'; |
## Task
Generate a SQL query to answer the following question:
`Which Call Sign that has Tail Code ed?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mi_g_credits" (
"date" text,
"pilot" text,
"weapon_systems_officer" text,
"aircraft" text,
"tail_code" text,
"call_sign" text,
"kill" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Call Sign that has Tail Code ed?`:
```sql
|
SELECT "aircraft" FROM "mi_g_credits" WHERE "weapon_systems_officer"='capt charles b. debellevue'; |
## Task
Generate a SQL query to answer the following question:
`Which aircraft Weapon Systems Officer Capt Charles B. Debellevue belongs on?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "mi_g_credits" (
"date" text,
"pilot" text,
"weapon_systems_officer" text,
"aircraft" text,
"tail_code" text,
"call_sign" text,
"kill" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which aircraft Weapon Systems Officer Capt Charles B. Debellevue belongs on?`:
```sql
|
SELECT MIN("wins") FROM "2008_ladder" WHERE "losses"=2; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest amount of wins of someone who has 2 losses?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2008_ladder" (
"mid_gippsland_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest amount of wins of someone who has 2 losses?`:
```sql
|
SELECT MAX("wins") FROM "2008_ladder" WHERE "against">1249 AND "losses"<17; |
## Task
Generate a SQL query to answer the following question:
`What is the largest amount of wins of someone who has an against score greater than 1249 and a number of losses less than 17?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2008_ladder" (
"mid_gippsland_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the largest amount of wins of someone who has an against score greater than 1249 and a number of losses less than 17?`:
```sql
|
SELECT "race_name" FROM "non_championship_race_results" WHERE "winning_driver"='stirling moss' AND "circuit"='oulton park'; |
## Task
Generate a SQL query to answer the following question:
`What is the name of race that has a winning driver of Stirling moss and a Circuit of oulton park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "non_championship_race_results" (
"race_name" text,
"circuit" text,
"date" text,
"winning_driver" text,
"constructor" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the name of race that has a winning driver of Stirling moss and a Circuit of oulton park?`:
```sql
|
SELECT "winning_driver" FROM "non_championship_race_results" WHERE "constructor"='brm'; |
## Task
Generate a SQL query to answer the following question:
`Who is the winning driver that has a construction of brm?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "non_championship_race_results" (
"race_name" text,
"circuit" text,
"date" text,
"winning_driver" text,
"constructor" text,
"report" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who is the winning driver that has a construction of brm?`:
```sql
|
SELECT MAX("bronze") FROM "titles_by_country" WHERE "rank"='12'; |
## Task
Generate a SQL query to answer the following question:
`What is the high bronze total for nations ranked 12?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "titles_by_country" (
"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 high bronze total for nations ranked 12?`:
```sql
|
SELECT "away_team" FROM "round_14" WHERE "home_team_score"='11.14 (80)'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team when Footscray scored 11.14 (80)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_14" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team when Footscray scored 11.14 (80)?`:
```sql
|
SELECT "winning_score" FROM "pga_tour_wins_13" WHERE "date"='may 3, 1998'; |
## Task
Generate a SQL query to answer the following question:
`What was the winning score on May 3, 1998?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pga_tour_wins_13" (
"date" text,
"tournament" text,
"winning_score" text,
"margin_of_victory" text,
"runner_s_up" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the winning score on May 3, 1998?`:
```sql
|
SELECT "role" FROM "helicopters" WHERE "registration"='s5-hpg s5-hpc'; |
## Task
Generate a SQL query to answer the following question:
`What is the role of the aircraft that has a registration of s5-hpg s5-hpc?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "helicopters" (
"aircraft" text,
"origin" text,
"role" text,
"registration" text,
"number" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the role of the aircraft that has a registration of s5-hpg s5-hpc?`:
```sql
|
SELECT "origin" FROM "helicopters" WHERE "registration"='s5-hpb'; |
## Task
Generate a SQL query to answer the following question:
`What is the country of origin of the aircraft with a registration s5-hpb?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "helicopters" (
"aircraft" text,
"origin" text,
"role" text,
"registration" text,
"number" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the country of origin of the aircraft with a registration s5-hpb?`:
```sql
|
SELECT "role" FROM "helicopters" WHERE "origin"='european union'; |
## Task
Generate a SQL query to answer the following question:
`What is the role of the aircraft that originates from the European Union?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "helicopters" (
"aircraft" text,
"origin" text,
"role" text,
"registration" text,
"number" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the role of the aircraft that originates from the European Union?`:
```sql
|
SELECT "role" FROM "helicopters" WHERE "registration"='s5-hpb'; |
## Task
Generate a SQL query to answer the following question:
`What is the role of the aircraft that has a registration of s5-hpb?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "helicopters" (
"aircraft" text,
"origin" text,
"role" text,
"registration" text,
"number" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the role of the aircraft that has a registration of s5-hpb?`:
```sql
|
SELECT "hometown" FROM "2010_boys_team" WHERE "height"='6-10'; |
## Task
Generate a SQL query to answer the following question:
`Which Hometown has a Height of 6-10?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2010_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Hometown has a Height of 6-10?`:
```sql
|
SELECT "nba_draft" FROM "2010_boys_team" WHERE "school"='bishop o''connell high school'; |
## Task
Generate a SQL query to answer the following question:
`What is the NBA Draft for the School Bishop O'Connell High School?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2010_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the NBA Draft for the School Bishop O'Connell High School?`:
```sql
|
SELECT "school" FROM "2010_boys_team" WHERE "hometown"='winter park, fl'; |
## Task
Generate a SQL query to answer the following question:
`Which School is located in Winter Park, FL (Hometown)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2010_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which School is located in Winter Park, FL (Hometown)?`:
```sql
|
SELECT "hometown" FROM "2010_boys_team" WHERE "school"='bishop luers high school'; |
## Task
Generate a SQL query to answer the following question:
`When the School is Bishop Luers High School, what is the Hometown?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2010_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `When the School is Bishop Luers High School, what is the Hometown?`:
```sql
|
SELECT "hometown" FROM "2010_boys_team" WHERE "college"='villanova'; |
## Task
Generate a SQL query to answer the following question:
`What is the Hometown for Villanova College?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2010_boys_team" (
"player" text,
"height" text,
"school" text,
"hometown" text,
"college" text,
"nba_draft" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Hometown for Villanova College?`:
```sql
|
SELECT "home" FROM "december" WHERE "record"='18–18–1'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team at the game when the Thrashers had a record of 18–18–1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "december" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"decision" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the home team at the game when the Thrashers had a record of 18–18–1?`:
```sql
|
SELECT "date" FROM "december" WHERE "decision"='lehtonen' AND "attendance">'17,731'; |
## Task
Generate a SQL query to answer the following question:
`What was the date of the game with a decision of Lehtonen and attended by more than 17,731 people?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "december" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"decision" text,
"attendance" real,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the date of the game with a decision of Lehtonen and attended by more than 17,731 people?`:
```sql
|
SELECT AVG("grid") FROM "classification" WHERE "time_retired"='+1 lap' AND "driver"='johnny herbert'; |
## Task
Generate a SQL query to answer the following question:
`What is the average grid for johnny herbert with a Time/Retired of +1 lap?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "classification" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the average grid for johnny herbert with a Time/Retired of +1 lap?`:
```sql
|
SELECT "away_team" FROM "round_2" WHERE "venue"='mcg'; |
## Task
Generate a SQL query to answer the following question:
`Who was the away team at mcg?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_2" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the away team at mcg?`:
```sql
|
SELECT "home_team" FROM "round_2" WHERE "venue"='princes park'; |
## Task
Generate a SQL query to answer the following question:
`Who was the home team at princes park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_2" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Who was the home team at princes park?`:
```sql
|
SELECT "object_type" FROM "2101_2200" WHERE "constellation"='orion' AND "ngc_number">2174 AND "declination_j2000"='°48′06″'; |
## Task
Generate a SQL query to answer the following question:
`Which Object type has a Constellation of orion, and an NGC number larger than 2174, and a Declination (J2000) of °48′06″?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2101_2200" (
"ngc_number" real,
"object_type" text,
"constellation" text,
"right_ascension_j2000" text,
"declination_j2000" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Object type has a Constellation of orion, and an NGC number larger than 2174, and a Declination (J2000) of °48′06″?`:
```sql
|
SELECT "right_ascension_j2000" FROM "2101_2200" WHERE "constellation"='mensa' AND "ngc_number">2171; |
## Task
Generate a SQL query to answer the following question:
`Which Right ascension (J2000) has a Constellation of mensa, and an NGC number larger than 2171?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2101_2200" (
"ngc_number" real,
"object_type" text,
"constellation" text,
"right_ascension_j2000" text,
"declination_j2000" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Right ascension (J2000) has a Constellation of mensa, and an NGC number larger than 2171?`:
```sql
|
SELECT MAX("ngc_number") FROM "2101_2200" WHERE "object_type"='open cluster' AND "right_ascension_j2000"='06h01m06s'; |
## Task
Generate a SQL query to answer the following question:
`Which NGC number has an Object type of open cluster, and a Right ascension (J2000) of 06h01m06s?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2101_2200" (
"ngc_number" real,
"object_type" text,
"constellation" text,
"right_ascension_j2000" text,
"declination_j2000" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which NGC number has an Object type of open cluster, and a Right ascension (J2000) of 06h01m06s?`:
```sql
|
SELECT "object_type" FROM "2101_2200" WHERE "ngc_number"=2171; |
## Task
Generate a SQL query to answer the following question:
`Which Object type has an NGC number of 2171?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2101_2200" (
"ngc_number" real,
"object_type" text,
"constellation" text,
"right_ascension_j2000" text,
"declination_j2000" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Object type has an NGC number of 2171?`:
```sql
|
SELECT "end_date" FROM "lieutenant_governors_of_illinois" WHERE "governor"='richard j. oglesby' AND "term"='1885–1889'; |
## Task
Generate a SQL query to answer the following question:
`What is the end date of the term for Governor of richard j. oglesby, and a Term of 1885–1889?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "lieutenant_governors_of_illinois" (
"lt_governor" text,
"commission_date" text,
"end_date" text,
"governor" text,
"party" text,
"term" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the end date of the term for Governor of richard j. oglesby, and a Term of 1885–1889?`:
```sql
|
SELECT "site" FROM "deep_space_rendezvous" WHERE "orbit"='leo' AND "decay_utc"='still in orbit' AND "function"='magnetosphere research'; |
## Task
Generate a SQL query to answer the following question:
`What site has an orbit of Leo, a decay (UTC) of still in orbit, and a magnetosphere research?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "deep_space_rendezvous" (
"date_and_time_utc" text,
"rocket" text,
"site" text,
"orbit" text,
"function" text,
"decay_utc" text
);
### SQL
Given the database schema, here is the SQL query that answers `What site has an orbit of Leo, a decay (UTC) of still in orbit, and a magnetosphere research?`:
```sql
|
SELECT "date_and_time_utc" FROM "deep_space_rendezvous" WHERE "orbit"='sub-orbital' AND "function"='aeronomy research' AND "rocket"='nike orion' AND "site"='poker flat'; |
## Task
Generate a SQL query to answer the following question:
`What date and time has a sub-orbital of orbit, a function of aeronomy research, and a Nike Orion rocket, as well as a Poker Flat site?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "deep_space_rendezvous" (
"date_and_time_utc" text,
"rocket" text,
"site" text,
"orbit" text,
"function" text,
"decay_utc" text
);
### SQL
Given the database schema, here is the SQL query that answers `What date and time has a sub-orbital of orbit, a function of aeronomy research, and a Nike Orion rocket, as well as a Poker Flat site?`:
```sql
|
SELECT "tournament" FROM "pga_tour_wins_5" WHERE "winning_score"='2 and 1'; |
## Task
Generate a SQL query to answer the following question:
`what is the tournament when the winning score is 2 and 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pga_tour_wins_5" (
"date" text,
"tournament" text,
"winning_score" text,
"margin_of_victory" text,
"runner_up" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the tournament when the winning score is 2 and 1?`:
```sql
|
SELECT "margin_of_victory" FROM "pga_tour_wins_5" WHERE "tournament"='travelers championship'; |
## Task
Generate a SQL query to answer the following question:
`what is the margin of victory for the tournament travelers championship?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pga_tour_wins_5" (
"date" text,
"tournament" text,
"winning_score" text,
"margin_of_victory" text,
"runner_up" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the margin of victory for the tournament travelers championship?`:
```sql
|
SELECT "margin_of_victory" FROM "pga_tour_wins_5" WHERE "tournament"='waste management phoenix open'; |
## Task
Generate a SQL query to answer the following question:
`what is the margin of victory for the waste management phoenix open tournament?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pga_tour_wins_5" (
"date" text,
"tournament" text,
"winning_score" text,
"margin_of_victory" text,
"runner_up" text
);
### SQL
Given the database schema, here is the SQL query that answers `what is the margin of victory for the waste management phoenix open tournament?`:
```sql
|
SELECT "runner_up" FROM "pga_tour_wins_5" WHERE "winning_score"='−16 (68-70-65-65=268)'; |
## Task
Generate a SQL query to answer the following question:
`who is the runner-up when the winning score is −16 (68-70-65-65=268)?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "pga_tour_wins_5" (
"date" text,
"tournament" text,
"winning_score" text,
"margin_of_victory" text,
"runner_up" text
);
### SQL
Given the database schema, here is the SQL query that answers `who is the runner-up when the winning score is −16 (68-70-65-65=268)?`:
```sql
|
SELECT "game_4" FROM "1987_series" WHERE "position"='wing' AND "game_1"='michael o''connor'; |
## Task
Generate a SQL query to answer the following question:
`For which Game 4 did Michael O'Connor play wing position?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1987_series" (
"position" text,
"game_1" text,
"game_2" text,
"game_3" text,
"game_4" text
);
### SQL
Given the database schema, here is the SQL query that answers `For which Game 4 did Michael O'Connor play wing position?`:
```sql
|
SELECT "game_4" FROM "1987_series" WHERE "game_3"='david boyle'; |
## Task
Generate a SQL query to answer the following question:
`For which Game 4, did David Boyle play in Game 3?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1987_series" (
"position" text,
"game_1" text,
"game_2" text,
"game_3" text,
"game_4" text
);
### SQL
Given the database schema, here is the SQL query that answers `For which Game 4, did David Boyle play in Game 3?`:
```sql
|
SELECT "game_1" FROM "1987_series" WHERE "position"='fullback'; |
## Task
Generate a SQL query to answer the following question:
`Which Game 1 has a fullback?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1987_series" (
"position" text,
"game_1" text,
"game_2" text,
"game_3" text,
"game_4" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Game 1 has a fullback?`:
```sql
|
SELECT "game_4" FROM "1987_series" WHERE "game_1"='michael o''connor'; |
## Task
Generate a SQL query to answer the following question:
`For which Game 4 did Michael O'Connor play during Game 1?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1987_series" (
"position" text,
"game_1" text,
"game_2" text,
"game_3" text,
"game_4" text
);
### SQL
Given the database schema, here is the SQL query that answers `For which Game 4 did Michael O'Connor play during Game 1?`:
```sql
|
SELECT "position" FROM "1987_series" WHERE "game_2"='andrew farrar'; |
## Task
Generate a SQL query to answer the following question:
`During Game 2, which position did Andrew Farrar play?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1987_series" (
"position" text,
"game_1" text,
"game_2" text,
"game_3" text,
"game_4" text
);
### SQL
Given the database schema, here is the SQL query that answers `During Game 2, which position did Andrew Farrar play?`:
```sql
|
SELECT "game_4" FROM "1987_series" WHERE "game_2"='brett kenny'; |
## Task
Generate a SQL query to answer the following question:
`During which Game 4, did Brett Kenny play Game 2?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "1987_series" (
"position" text,
"game_1" text,
"game_2" text,
"game_3" text,
"game_4" text
);
### SQL
Given the database schema, here is the SQL query that answers `During which Game 4, did Brett Kenny play Game 2?`:
```sql
|
SELECT "location" FROM "former_members" WHERE "left"=1975 AND "type"='private' AND "founded"=1891; |
## Task
Generate a SQL query to answer the following question:
`Where was the former private member that was founded in 1891 and left in 1975?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "former_members" (
"institution" text,
"location" text,
"founded" real,
"type" text,
"enrollment" real,
"nickname" text,
"joined" real,
"left" real,
"current_conference" text
);
### SQL
Given the database schema, here is the SQL query that answers `Where was the former private member that was founded in 1891 and left in 1975?`:
```sql
|
SELECT SUM("places") FROM "men" WHERE "nation"='soviet union' AND "rank">11; |
## Task
Generate a SQL query to answer the following question:
`what is the places when for the soviet union with a rank more than 11?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "men" (
"rank" real,
"name" text,
"nation" text,
"sp_fs" real,
"points" real,
"places" real
);
### SQL
Given the database schema, here is the SQL query that answers `what is the places when for the soviet union with a rank more than 11?`:
```sql
|
SELECT "name" FROM "men" WHERE "nation"='soviet union' AND "points"=185; |
## Task
Generate a SQL query to answer the following question:
`what is the name when the nation is soviet union and the points is 185?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "men" (
"rank" real,
"name" text,
"nation" text,
"sp_fs" real,
"points" real,
"places" real
);
### SQL
Given the database schema, here is the SQL query that answers `what is the name when the nation is soviet union and the points is 185?`:
```sql
|
SELECT "constructor" FROM "race" WHERE "laps"<3 AND "grid"=15; |
## Task
Generate a SQL query to answer the following question:
`What constructor has less than 3 laps and grid 15?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "race" (
"driver" text,
"constructor" text,
"laps" real,
"time_retired" text,
"grid" real
);
### SQL
Given the database schema, here is the SQL query that answers `What constructor has less than 3 laps and grid 15?`:
```sql
|
SELECT "home_team" FROM "round_7" WHERE "away_team"='collingwood'; |
## Task
Generate a SQL query to answer the following question:
`Which Home team has an Away team of collingwood?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "round_7" (
"home_team" text,
"home_team_score" text,
"away_team" text,
"away_team_score" text,
"venue" text,
"crowd" real,
"date" text
);
### SQL
Given the database schema, here is the SQL query that answers `Which Home team has an Away team of collingwood?`:
```sql
|
SELECT MIN("against") FROM "2009_ladder" WHERE "losses"=4 AND "draws"=0 AND "wins">14; |
## Task
Generate a SQL query to answer the following question:
`Name the lowest against for when wins are greater than 14, draws is 0 and losses are 4`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_ladder" (
"mid_gippsland_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the lowest against for when wins are greater than 14, draws is 0 and losses are 4`:
```sql
|
SELECT SUM("against") FROM "2009_ladder" WHERE "byes"<0; |
## Task
Generate a SQL query to answer the following question:
`Name the sum against for byes less than 0`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_ladder" (
"mid_gippsland_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the sum against for byes less than 0`:
```sql
|
SELECT SUM("draws") FROM "2009_ladder" WHERE "wins"=16 AND "losses"<2; |
## Task
Generate a SQL query to answer the following question:
`Name the sum of draws for losses less than 2 and wins of 16`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "2009_ladder" (
"mid_gippsland_fl" text,
"wins" real,
"byes" real,
"losses" real,
"draws" real,
"against" real
);
### SQL
Given the database schema, here is the SQL query that answers `Name the sum of draws for losses less than 2 and wins of 16`:
```sql
|
SELECT MIN("laps") FROM "indy_500_career" WHERE "finish"='17'; |
## Task
Generate a SQL query to answer the following question:
`How few laps were finished in 17?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_career" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `How few laps were finished in 17?`:
```sql
|
SELECT "qual" FROM "indy_500_career" WHERE "year"='1966'; |
## Task
Generate a SQL query to answer the following question:
`What is 1966's Qual rating?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_career" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is 1966's Qual rating?`:
```sql
|
SELECT "start" FROM "indy_500_career" WHERE "finish"='10'; |
## Task
Generate a SQL query to answer the following question:
`What race has a finish time of 10?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_career" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What race has a finish time of 10?`:
```sql
|
SELECT MIN("laps") FROM "indy_500_career" WHERE "rank"='30'; |
## Task
Generate a SQL query to answer the following question:
`What is the lowest lap with a rank of 30?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_career" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What is the lowest lap with a rank of 30?`:
```sql
|
SELECT "finish" FROM "indy_500_career" WHERE "start"='32'; |
## Task
Generate a SQL query to answer the following question:
`What finish time started at 32?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "indy_500_career" (
"year" text,
"start" text,
"qual" text,
"rank" text,
"finish" text,
"laps" real
);
### SQL
Given the database schema, here is the SQL query that answers `What finish time started at 32?`:
```sql
|
SELECT MIN("rank") FROM "leaders" WHERE "country"='united states' AND "wins"<3; |
## Task
Generate a SQL query to answer the following question:
`Who is the lowest ranked player from the United States that has less than 3 Wins?`
### 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,
"events" real,
"wins" real
);
### SQL
Given the database schema, here is the SQL query that answers `Who is the lowest ranked player from the United States that has less than 3 Wins?`:
```sql
|
SELECT "score" FROM "game_log" WHERE "visitor"='edmonton'; |
## Task
Generate a SQL query to answer the following question:
`What is the score of the game that had a visiting team of Edmonton?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the score of the game that had a visiting team of Edmonton?`:
```sql
|
SELECT "record" FROM "game_log" WHERE "home"='colorado' AND "visitor"='winnipeg'; |
## Task
Generate a SQL query to answer the following question:
`What is the record of the game that had a home team of Colorado, and a visiting team of Winnipeg?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the record of the game that had a home team of Colorado, and a visiting team of Winnipeg?`:
```sql
|
SELECT "visitor" FROM "game_log" WHERE "date"='february 15'; |
## Task
Generate a SQL query to answer the following question:
`What team was visiting on February 15?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "game_log" (
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text
);
### SQL
Given the database schema, here is the SQL query that answers `What team was visiting on February 15?`:
```sql
|
SELECT "theme" FROM "canadian_commerce" WHERE "issue_price"='$489.95' AND "year">2005; |
## Task
Generate a SQL query to answer the following question:
`What theme had an issue price of $489.95 after 2005?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "canadian_commerce" (
"year" real,
"theme" text,
"artist" text,
"mintage" real,
"issue_price" text
);
### SQL
Given the database schema, here is the SQL query that answers `What theme had an issue price of $489.95 after 2005?`:
```sql
|
SELECT SUM("year") FROM "canadian_commerce" WHERE "theme"='timber trade'; |
## Task
Generate a SQL query to answer the following question:
`What year was the timber trade?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "canadian_commerce" (
"year" real,
"theme" text,
"artist" text,
"mintage" real,
"issue_price" text
);
### SQL
Given the database schema, here is the SQL query that answers `What year was the timber trade?`:
```sql
|
SELECT COUNT("year") FROM "canadian_commerce" WHERE "issue_price"='$697.95'; |
## Task
Generate a SQL query to answer the following question:
`What year has an issue price of $697.95?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "canadian_commerce" (
"year" real,
"theme" text,
"artist" text,
"mintage" real,
"issue_price" text
);
### SQL
Given the database schema, here is the SQL query that answers `What year has an issue price of $697.95?`:
```sql
|
SELECT "engine" FROM "drivers_and_constructors" WHERE "driver"='jean-pierre jarier' AND "chassis"='pc4'; |
## Task
Generate a SQL query to answer the following question:
`What was the engine driven by Jean-Pierre Jarier and has a chassis of PC4?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "drivers_and_constructors" (
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyres" text,
"driver" text,
"rounds" text
);
### SQL
Given the database schema, here is the SQL query that answers `What was the engine driven by Jean-Pierre Jarier and has a chassis of PC4?`:
```sql
|
SELECT "season" FROM "results" WHERE "winners"='dundee united'; |
## Task
Generate a SQL query to answer the following question:
`What Season had Dundee United as a Winner?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "results" (
"season" text,
"winners" text,
"score" text,
"runners_up" text,
"venue" text
);
### SQL
Given the database schema, here is the SQL query that answers `What Season had Dundee United as a Winner?`:
```sql
|
SELECT "score" FROM "results" WHERE "venue"='hampden park' AND "runners_up"='rangers' AND "winners"='hibernian'; |
## Task
Generate a SQL query to answer the following question:
`What is the Score of the Rangers' Runner-ups and Hibernian Winners in Hampden Park?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "results" (
"season" text,
"winners" text,
"score" text,
"runners_up" text,
"venue" text
);
### SQL
Given the database schema, here is the SQL query that answers `What is the Score of the Rangers' Runner-ups and Hibernian Winners in Hampden Park?`:
```sql
|
SELECT "runners_up" FROM "results" WHERE "venue"='broadwood stadium'; |
## Task
Generate a SQL query to answer the following question:
`What Runners-up have a Venue in Broadwood Stadium?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "results" (
"season" text,
"winners" text,
"score" text,
"runners_up" text,
"venue" text
);
### SQL
Given the database schema, here is the SQL query that answers `What Runners-up have a Venue in Broadwood Stadium?`:
```sql
|
SELECT "completed" FROM "g_class" WHERE "pennant_number"='h63'; |
## Task
Generate a SQL query to answer the following question:
`When is the completed date of the destroyer with a pennant number h63?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "g_class" (
"ship" text,
"pennant_number" text,
"laid_down" text,
"launched" text,
"completed" text
);
### SQL
Given the database schema, here is the SQL query that answers `When is the completed date of the destroyer with a pennant number h63?`:
```sql
|
SELECT "completed" FROM "g_class" WHERE "pennant_number"='h59'; |
## Task
Generate a SQL query to answer the following question:
`When is the completed date of the destroyer with a pennant number h59?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "g_class" (
"ship" text,
"pennant_number" text,
"laid_down" text,
"launched" text,
"completed" text
);
### SQL
Given the database schema, here is the SQL query that answers `When is the completed date of the destroyer with a pennant number h59?`:
```sql
|
SELECT "ship" FROM "g_class" WHERE "pennant_number"='h05'; |
## Task
Generate a SQL query to answer the following question:
`What ship has a pennant number h05?`
### Database Schema
This query will run on a database whose schema is represented in this string:
CREATE TABLE "g_class" (
"ship" text,
"pennant_number" text,
"laid_down" text,
"launched" text,
"completed" text
);
### SQL
Given the database schema, here is the SQL query that answers `What ship has a pennant number h05?`:
```sql
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.