chat_prompt stringlengths 438 1.53k |
|---|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_superlative_academy_award_winner\" (\n \"superlative\" text,\n \"actress\" text,\n \"record_set\" text,\n \"year\" real,\n \"notes\" text\n);\n\nQuestion: Which award has Thelma Ritter won?"
},
{
"role": "assistant",
"content": "SELECT \"superlative\" FROM \"list_of_superlative_academy_award_winner\" WHERE \"actress\"='thelma ritter';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"table\" (\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"points_diff\" real,\n \"points\" real\n);\n\nQuestion: I want the lowest points diff for against being less than 578 and lost being 15 and points more than 26"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points_diff\") FROM \"table\" WHERE \"against\"<578 AND \"lost\"=15 AND \"points\">26;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"table\" (\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"points_diff\" real,\n \"points\" real\n);\n\nQuestion: I want the total number of points for against of 753 and points diff more than -114"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"points\") FROM \"table\" WHERE \"against\"=753 AND \"points_diff\">-114;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: In What Week was the Attendance 75,866?"
},
{
"role": "assistant",
"content": "SELECT \"week\" FROM \"schedule\" WHERE \"attendance\"='75,866';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What Opponent has an Attendance of 74,246?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"attendance\"='74,246';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What Date is Week 1?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"week\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" text,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: Which team had 7 losses and 55 goals?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"final_standing\" WHERE \"losses\"='7' AND \"goals_for\"=55;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"gdp_per_capita_in_usd_in_main_years_1978\" (\n \"year\" text,\n \"2010\" real,\n \"2009\" real,\n \"2008\" real,\n \"2005\" real,\n \"2000\" real,\n \"1995\" real,\n \"1990\" real,\n \"1985\" real\n);\n\nQuestion: What is the largest 2000 GDP when the 2008 GDP is smaller than 3,632, 2010 GDP is 2,558 and 2009 GDP is larger than 2,239?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"2000\") FROM \"gdp_per_capita_in_usd_in_main_years_1978\" WHERE \"2008\"<'3,632' AND \"2010\"='2,558' AND \"2009\">'2,239';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"gdp_per_capita_in_usd_in_main_years_1978\" (\n \"year\" text,\n \"2010\" real,\n \"2009\" real,\n \"2008\" real,\n \"2005\" real,\n \"2000\" real,\n \"1995\" real,\n \"1990\" real,\n \"1985\" real\n);\n\nQuestion: What is the GDP in 2008 for the region where 2009 is less than 3,355, 2005 is larger than 1,103, 2010 GDP is 3,977 and 1995 GDP is larger than 413?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"2008\") FROM \"gdp_per_capita_in_usd_in_main_years_1978\" WHERE \"2009\"<'3,355' AND \"2005\">'1,103' AND \"2010\"='3,977' AND \"1995\">413;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"gdp_per_capita_in_usd_in_main_years_1978\" (\n \"year\" text,\n \"2010\" real,\n \"2009\" real,\n \"2008\" real,\n \"2005\" real,\n \"2000\" real,\n \"1995\" real,\n \"1990\" real,\n \"1985\" real\n);\n\nQuestion: What is the minimum 2010 GDP if the 2009 GDP is larger than 3,749, 1995 GDP is 876 and 2008 GDP is larger than 4,885?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"2010\") FROM \"gdp_per_capita_in_usd_in_main_years_1978\" WHERE \"2009\">'3,749' AND \"1995\"=876 AND \"2008\">'4,885';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"gdp_per_capita_in_usd_in_main_years_1978\" (\n \"year\" text,\n \"2010\" real,\n \"2009\" real,\n \"2008\" real,\n \"2005\" real,\n \"2000\" real,\n \"1995\" real,\n \"1990\" real,\n \"1985\" real\n);\n\nQuestion: What is the 1995 GDP when 1990 GDP is 441 and 1985 GDP is less than 359?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"1995\") FROM \"gdp_per_capita_in_usd_in_main_years_1978\" WHERE \"1990\"=441 AND \"1985\"<359;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"gdp_per_capita_in_usd_in_main_years_1978\" (\n \"year\" text,\n \"2010\" real,\n \"2009\" real,\n \"2008\" real,\n \"2005\" real,\n \"2000\" real,\n \"1995\" real,\n \"1990\" real,\n \"1985\" real\n);\n\nQuestion: What is the maximum 1985 GDP for the region where 1990 GDP is less than 267, 2000 GDP is 333 and 2005 GDP is less than 658?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"1985\") FROM \"gdp_per_capita_in_usd_in_main_years_1978\" WHERE \"1990\"<267 AND \"2000\"=333 AND \"2005\"<658;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_municipalities_in_quebec\" (\n \"code\" real,\n \"type\" text,\n \"name\" text,\n \"area_km_2\" real,\n \"population\" real,\n \"regional_county_municipality\" text,\n \"region\" real\n);\n\nQuestion: When populatioin is greater than 7,747 and the type is V, what is the sum of code?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"code\") FROM \"list_of_municipalities_in_quebec\" WHERE \"type\"='v' AND \"population\">'7,747';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"most_doubles_wins\" (\n \"name\" text,\n \"tkm_career\" text,\n \"ties\" real,\n \"dou_w_l\" text,\n \"sin_w_l\" text\n);\n\nQuestion: Who has ties of 5?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"most_doubles_wins\" WHERE \"ties\"=5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Where did st kilda play as the away team?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_10\" WHERE \"away_team\"='st kilda';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What home team scored 10.14 (74)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_10\" WHERE \"home_team_score\"='10.14 (74)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How big of a crowd does the home team of essendon have?"
},
{
"role": "assistant",
"content": "SELECT \"crowd\" FROM \"round_10\" WHERE \"home_team\"='essendon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_team\" (\n \"player\" text,\n \"position\" text,\n \"school\" text,\n \"hometown\" text,\n \"mlb_draft\" text\n);\n\nQuestion: What is the MLB Draft status of the person who attended Seton Hall Preparatory School?"
},
{
"role": "assistant",
"content": "SELECT \"mlb_draft\" FROM \"2003_team\" WHERE \"school\"='seton hall preparatory school';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_team\" (\n \"player\" text,\n \"position\" text,\n \"school\" text,\n \"hometown\" text,\n \"mlb_draft\" text\n);\n\nQuestion: Where is the Hometown of the person that attended Kennedy-Kenrick Catholic High School?"
},
{
"role": "assistant",
"content": "SELECT \"hometown\" FROM \"2003_team\" WHERE \"school\"='kennedy-kenrick catholic high school';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_team\" (\n \"player\" text,\n \"position\" text,\n \"school\" text,\n \"hometown\" text,\n \"mlb_draft\" text\n);\n\nQuestion: Which Player attended George Washington High School?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"2003_team\" WHERE \"school\"='george washington high school';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_team\" (\n \"player\" text,\n \"position\" text,\n \"school\" text,\n \"hometown\" text,\n \"mlb_draft\" text\n);\n\nQuestion: Where is the Hometown that the person who attended Camarillo High School is from?"
},
{
"role": "assistant",
"content": "SELECT \"hometown\" FROM \"2003_team\" WHERE \"school\"='camarillo high school';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many people in total have attended games where carlton played as away?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_18\" WHERE \"away_team\"='carlton';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: When the home team scored 19.15 (129)?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_18\" WHERE \"home_team_score\"='19.15 (129)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"receiving\" (\n \"player\" text,\n \"rec\" real,\n \"yards\" real,\n \"avg\" real,\n \"td_s\" real,\n \"long\" real\n);\n\nQuestion: Which player has a long of less than 15 and an average of 6 yards."
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"receiving\" WHERE \"long\"<15 AND \"avg\"=6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"h\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What years did Troy Hudson play for the Jazz?"
},
{
"role": "assistant",
"content": "SELECT \"years_for_jazz\" FROM \"h\" WHERE \"player\"='troy hudson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"h\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What Nationality is the Iowa State team?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"h\" WHERE \"school_club_team\"='iowa state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"h\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What Nationality is Jeff Hornacek?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"h\" WHERE \"player\"='jeff hornacek';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"h\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What Nationality is the Colorado State team?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"h\" WHERE \"school_club_team\"='colorado';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"h\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What Player is from the Southern Illinois team?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"h\" WHERE \"school_club_team\"='southern illinois';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"h\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What years did Eddie Hughes play for the Jazz?"
},
{
"role": "assistant",
"content": "SELECT \"years_for_jazz\" FROM \"h\" WHERE \"player\"='eddie hughes';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"feral_animals_introduced_species\" (\n \"name\" text,\n \"species\" text,\n \"overview\" text,\n \"introduced\" text,\n \"feral\" text,\n \"threat_level\" text\n);\n\nQuestion: Which Species has a medium Threat Level?"
},
{
"role": "assistant",
"content": "SELECT \"species\" FROM \"feral_animals_introduced_species\" WHERE \"threat_level\"='medium';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"feral_animals_introduced_species\" (\n \"name\" text,\n \"species\" text,\n \"overview\" text,\n \"introduced\" text,\n \"feral\" text,\n \"threat_level\" text\n);\n\nQuestion: What is the Overview with a medium Threat Level?"
},
{
"role": "assistant",
"content": "SELECT \"overview\" FROM \"feral_animals_introduced_species\" WHERE \"threat_level\"='medium';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"feral_animals_introduced_species\" (\n \"name\" text,\n \"species\" text,\n \"overview\" text,\n \"introduced\" text,\n \"feral\" text,\n \"threat_level\" text\n);\n\nQuestion: What is the Threat Levels with Rabbits in Australia?"
},
{
"role": "assistant",
"content": "SELECT \"threat_level\" FROM \"feral_animals_introduced_species\" WHERE \"overview\"='rabbits in australia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_broadway_revival\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: Which nominee won the Drama Desk Award for outstanding choreography?"
},
{
"role": "assistant",
"content": "SELECT \"nominee\" FROM \"2004_broadway_revival\" WHERE \"award\"='drama desk award' AND \"result\"='won' AND \"category\"='outstanding choreography';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_broadway_revival\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: When was the last time a nominee for Best Revival of a Musical was selected?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"2004_broadway_revival\" WHERE \"nominee\"='best revival of a musical';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_broadway_revival\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: Which Award is the winner for Outstanding Revival of a Musical given?"
},
{
"role": "assistant",
"content": "SELECT \"award\" FROM \"2004_broadway_revival\" WHERE \"category\"='outstanding revival of a musical';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_8\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the home team score in the game where the away team scored 8.14 (62)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_8\" WHERE \"away_team_score\"='8.14 (62)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_8\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Who is the home team in the game where South Melbourne was the away team?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_8\" WHERE \"away_team\"='south melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_8\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the home team score in the game where the away team scored 9.13 (67)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_8\" WHERE \"away_team_score\"='9.13 (67)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_8\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: In which venue did the home team score 10.11 (71)"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_8\" WHERE \"home_team_score\"='10.11 (71)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"attendance\" real\n);\n\nQuestion: I want the result for week larger than 10 for opponent of new england patriots"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"schedule\" WHERE \"week\">10 AND \"opponent\"='new england patriots';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"attendance\" real\n);\n\nQuestion: I want the game site for week of 11"
},
{
"role": "assistant",
"content": "SELECT \"game_site\" FROM \"schedule\" WHERE \"week\"=11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the average number of laps for mika salo's arrows car with a grid over 13?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"laps\") FROM \"race\" WHERE \"constructor\"='arrows' AND \"driver\"='mika salo' AND \"grid\">13;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Who drove the car with a grid of 7?"
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"race\" WHERE \"grid\"=7;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"scottish_cup\" (\n \"round\" text,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"aberdeen_scorer_s\" text,\n \"attendance\" real,\n \"report\" text\n);\n\nQuestion: Which Report is Dated 9 March?"
},
{
"role": "assistant",
"content": "SELECT \"report\" FROM \"scottish_cup\" WHERE \"date\"='9 march';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"scottish_cup\" (\n \"round\" text,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"aberdeen_scorer_s\" text,\n \"attendance\" real,\n \"report\" text\n);\n\nQuestion: When Hamilton Academical is the Opponent, what is the total Attendance?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") FROM \"scottish_cup\" WHERE \"opponent\"='hamilton academical';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: How many in attendance with a loss of volquez (1\u20134)?"
},
{
"role": "assistant",
"content": "SELECT \"attendance\" FROM \"game_log\" WHERE \"loss\"='volquez (1\u20134)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What record has a Score of 9\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"score\"='9\u20136';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What is the average number in attendance on September 16?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"attendance\") FROM \"game_log\" WHERE \"date\"='september 16';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What is the sum of people in attendance on September 8?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"game_log\" WHERE \"date\"='september 8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"participants\" (\n \"school\" text,\n \"conference\" text,\n \"record_conference\" text,\n \"head_coach\" text,\n \"cws_appearances\" text,\n \"cws_best_finish\" text,\n \"cws_record\" text\n);\n\nQuestion: What was Head Coach Jim Morris's best finish?"
},
{
"role": "assistant",
"content": "SELECT \"cws_best_finish\" FROM \"participants\" WHERE \"head_coach\"='jim morris';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule_and_results\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the record when the visiting team was the montreal canadiens?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"schedule_and_results\" WHERE \"visitor\"='montreal canadiens';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ice_dancing\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What nation has 187.84 points?"
},
{
"role": "assistant",
"content": "SELECT \"nation\" FROM \"ice_dancing\" WHERE \"points\"=187.84;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ice_dancing\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What is the low point total for teams with 81 places?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"ice_dancing\" WHERE \"places\"='81';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station_number\" text,\n \"district\" text,\n \"location\" text,\n \"type\" text,\n \"appliances\" text,\n \"registrations\" text\n);\n\nQuestion: What is the station number of the station at Dogsthorpe?"
},
{
"role": "assistant",
"content": "SELECT \"station_number\" FROM \"stations\" WHERE \"location\"='dogsthorpe';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station_number\" text,\n \"district\" text,\n \"location\" text,\n \"type\" text,\n \"appliances\" text,\n \"registrations\" text\n);\n\nQuestion: What is the type of the station with a 1 wrl appliance in Linton?"
},
{
"role": "assistant",
"content": "SELECT \"type\" FROM \"stations\" WHERE \"appliances\"='1 wrl' AND \"location\"='linton';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station_number\" text,\n \"district\" text,\n \"location\" text,\n \"type\" text,\n \"appliances\" text,\n \"registrations\" text\n);\n\nQuestion: What is the appliance at the station in St Neots?"
},
{
"role": "assistant",
"content": "SELECT \"appliances\" FROM \"stations\" WHERE \"location\"='st neots';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station_number\" text,\n \"district\" text,\n \"location\" text,\n \"type\" text,\n \"appliances\" text,\n \"registrations\" text\n);\n\nQuestion: What is the registration of the station at Cambridge?"
},
{
"role": "assistant",
"content": "SELECT \"registrations\" FROM \"stations\" WHERE \"district\"='cambridge';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station_number\" text,\n \"district\" text,\n \"location\" text,\n \"type\" text,\n \"appliances\" text,\n \"registrations\" text\n);\n\nQuestion: What is the location of the station at Huntingdonshire with a station number of c17?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"stations\" WHERE \"district\"='huntingdonshire' AND \"station_number\"='c17';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station_number\" text,\n \"district\" text,\n \"location\" text,\n \"type\" text,\n \"appliances\" text,\n \"registrations\" text\n);\n\nQuestion: What is the registration of the station with a retained type and a station number of c03?"
},
{
"role": "assistant",
"content": "SELECT \"registrations\" FROM \"stations\" WHERE \"type\"='retained' AND \"station_number\"='c03';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"player\" text,\n \"nationality\" text,\n \"nhl_team\" text,\n \"college_junior_club_team_league\" text\n);\n\nQuestion: Name the nationality of the player with round more than 4"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"draft_picks\" WHERE \"round\">4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tallest_buildings\" (\n \"rank\" text,\n \"name\" text,\n \"height_ft_m\" text,\n \"floors\" real,\n \"year\" real\n);\n\nQuestion: In what Year was the Rank 14.0 14?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"tallest_buildings\" WHERE \"rank\"='14.0 14';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tallest_buildings\" (\n \"rank\" text,\n \"name\" text,\n \"height_ft_m\" text,\n \"floors\" real,\n \"year\" real\n);\n\nQuestion: After 1971, what is the Rank with a Height ft (m) of 19.0 477 (145) and less than 35 Floors?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"tallest_buildings\" WHERE \"year\">1971 AND \"floors\"<35 AND \"height_ft_m\"='19.0 477 (145)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tallest_buildings\" (\n \"rank\" text,\n \"name\" text,\n \"height_ft_m\" text,\n \"floors\" real,\n \"year\" real\n);\n\nQuestion: What Year has a Rank of 12.0 12?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"tallest_buildings\" WHERE \"rank\"='12.0 12';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_5\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Which crowd has an Away team score of 8.10 (58)?"
},
{
"role": "assistant",
"content": "SELECT \"crowd\" FROM \"round_5\" WHERE \"away_team_score\"='8.10 (58)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Which away team had a score of 17.13 (115)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_17\" WHERE \"away_team_score\"='17.13 (115)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the away team score at VFL Park?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_17\" WHERE \"venue\"='vfl park';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many people watched the game at Lake Oval?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"crowd\") FROM \"round_17\" WHERE \"venue\"='lake oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Where did the home team score 15.21 (111)?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_17\" WHERE \"home_team_score\"='15.21 (111)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"passing\" (\n \"player\" text,\n \"att\" real,\n \"comp\" real,\n \"yards\" real,\n \"rating\" real\n);\n\nQuestion: What was the Comp average, having Gino Guidugli as a player and a rating of more than 92.2?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"comp\") FROM \"passing\" WHERE \"player\"='gino guidugli' AND \"rating\">92.2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"passing\" (\n \"player\" text,\n \"att\" real,\n \"comp\" real,\n \"yards\" real,\n \"rating\" real\n);\n\nQuestion: For the player with yards less than 138, and Comp more than 0, what was the highest Att.?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"att\") FROM \"passing\" WHERE \"yards\"<138 AND \"comp\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: How many laps for grid of 9?"
},
{
"role": "assistant",
"content": "SELECT \"laps\" FROM \"race\" WHERE \"grid\"=9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the high lap total for a grid less than 6, and a Time/Retired of halfshaft?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"laps\") FROM \"race\" WHERE \"grid\"<6 AND \"time_retired\"='halfshaft';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_b\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 1 with a Score with 3\u20132?"
},
{
"role": "assistant",
"content": "SELECT \"set_1\" FROM \"pool_b\" WHERE \"score\"='3\u20132';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_b\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 1 with a Set 2 of 15\u20135, and a Set 3 with 15\u20133?"
},
{
"role": "assistant",
"content": "SELECT \"set_1\" FROM \"pool_b\" WHERE \"set_2\"='15\u20135' AND \"set_3\"='15\u20133';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_b\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What is the Date with a Set 1 with 15\u20131?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"pool_b\" WHERE \"set_1\"='15\u20131';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_b\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 3 with a Date of 04 oct, and a Set 2 with 15\u20135?"
},
{
"role": "assistant",
"content": "SELECT \"set_3\" FROM \"pool_b\" WHERE \"date\"='04 oct' AND \"set_2\"='15\u20135';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_b\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 3 with a Set 2 with 15\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"set_3\" FROM \"pool_b\" WHERE \"set_2\"='15\u20136';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_b\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 2 with a Total of 45\u201312, and a Set 3 with 15\u20132?"
},
{
"role": "assistant",
"content": "SELECT \"set_2\" FROM \"pool_b\" WHERE \"total\"='45\u201312' AND \"set_3\"='15\u20132';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"moto_gp_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What was the grid associated with under 26 laps and a Time/Retired of +6.077?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"grid\") FROM \"moto_gp_classification\" WHERE \"time_retired\"='+6.077' AND \"laps\"<26;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regional_vote\" (\n \"date_s_conducted\" text,\n \"cons\" text,\n \"plaid_cymru\" text,\n \"lib_dem\" text,\n \"ukip\" text,\n \"green\" text,\n \"others\" text,\n \"lead\" text\n);\n\nQuestion: On 5 May 2011, what was the lead percentage?"
},
{
"role": "assistant",
"content": "SELECT \"lead\" FROM \"regional_vote\" WHERE \"date_s_conducted\"='5 may 2011';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regional_vote\" (\n \"date_s_conducted\" text,\n \"cons\" text,\n \"plaid_cymru\" text,\n \"lib_dem\" text,\n \"ukip\" text,\n \"green\" text,\n \"others\" text,\n \"lead\" text\n);\n\nQuestion: On what date was the lead 8.6%?"
},
{
"role": "assistant",
"content": "SELECT \"date_s_conducted\" FROM \"regional_vote\" WHERE \"lead\"='8.6%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"nationality\" text,\n \"metric\" text,\n \"imperial\" text,\n \"name\" text,\n \"lifespan\" text\n);\n\nQuestion: what is the lifespan when the imperial height is 7ft 8 in and the nationality is fiji?"
},
{
"role": "assistant",
"content": "SELECT \"lifespan\" FROM \"men\" WHERE \"imperial\"='7ft 8 in' AND \"nationality\"='fiji';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"nationality\" text,\n \"metric\" text,\n \"imperial\" text,\n \"name\" text,\n \"lifespan\" text\n);\n\nQuestion: what is the nationality with the metric height of 2.36m named sun ming-ming?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"men\" WHERE \"metric\"='2.36m' AND \"name\"='sun ming-ming';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the grid total that had a retired for engine, teo fabi driving, and under 39 laps?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"grid\") FROM \"classification\" WHERE \"time_retired\"='engine' AND \"driver\"='teo fabi' AND \"laps\"<39;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the average grid for johnny dumfries with less than 8 laps?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"grid\") FROM \"classification\" WHERE \"driver\"='johnny dumfries' AND \"laps\"<8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the low lap total for minardi - motori moderni, and a Grid smaller than 18?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"laps\") FROM \"classification\" WHERE \"constructor\"='minardi - motori moderni' AND \"grid\"<18;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What constructor has a 12 grid?"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"classification\" WHERE \"grid\"=12;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"scores\" (\n \"country\" text,\n \"preliminaries\" real,\n \"interview\" real,\n \"swimsuit\" real,\n \"evening_gown\" real,\n \"average\" real\n);\n\nQuestion: What is the average where the swimsuit is larger than 9.437?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"average\") FROM \"scores\" WHERE \"swimsuit\">9.437;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"scores\" (\n \"country\" text,\n \"preliminaries\" real,\n \"interview\" real,\n \"swimsuit\" real,\n \"evening_gown\" real,\n \"average\" real\n);\n\nQuestion: What is the evening gown score where the interview score is 9.22 and the preliminaries are larger than 9.057?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"evening_gown\") FROM \"scores\" WHERE \"interview\"=9.22 AND \"preliminaries\">9.057;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"scores\" (\n \"country\" text,\n \"preliminaries\" real,\n \"interview\" real,\n \"swimsuit\" real,\n \"evening_gown\" real,\n \"average\" real\n);\n\nQuestion: What is Pennsylvania's average where the swimsuit is smaller than 9.109 and the evening gown is smaller than 9.163?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"average\") FROM \"scores\" WHERE \"swimsuit\"<9.109 AND \"country\"='pennsylvania' AND \"evening_gown\"<9.163;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"scores\" (\n \"country\" text,\n \"preliminaries\" real,\n \"interview\" real,\n \"swimsuit\" real,\n \"evening_gown\" real,\n \"average\" real\n);\n\nQuestion: What is the preliminaries score where the swimsuit is smaller than 9.297, the evening gown is 9.617, and the interview is larger than 9.143?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"preliminaries\") FROM \"scores\" WHERE \"swimsuit\"<9.297 AND \"evening_gown\"=9.617 AND \"interview\">9.143;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"electronic_paper_displays\" (\n \"maker\" text,\n \"model\" text,\n \"intro_year\" text,\n \"screen_size_inch\" text,\n \"self_lit\" text,\n \"screen_type\" text,\n \"weight\" text,\n \"screen_pixels\" text,\n \"touch_screen\" text,\n \"micro_sdhc\" text\n);\n\nQuestion: For Amazon.com's device with a weight of 221g (7.8oz) how many screen pixels does the device have?"
},
{
"role": "assistant",
"content": "SELECT \"screen_pixels\" FROM \"electronic_paper_displays\" WHERE \"maker\"='amazon.com' AND \"weight\"='221g (7.8oz)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"multiple_winners\" (\n \"runner\" text,\n \"country\" text,\n \"5_k_wins\" real,\n \"10_k_wins\" real,\n \"total\" real\n);\n\nQuestion: How many 5K wins did Lynn Jennings, who had more than 0 10K wins, have?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"5_k_wins\") FROM \"multiple_winners\" WHERE \"10_k_wins\">0 AND \"runner\"='lynn jennings';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"multiple_winners\" (\n \"runner\" text,\n \"country\" text,\n \"5_k_wins\" real,\n \"10_k_wins\" real,\n \"total\" real\n);\n\nQuestion: What is the average 10K wins the United States, which had 0 5K wins, have?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"10_k_wins\") FROM \"multiple_winners\" WHERE \"country\"='united states' AND \"5_k_wins\"=0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"multiple_winners\" (\n \"runner\" text,\n \"country\" text,\n \"5_k_wins\" real,\n \"10_k_wins\" real,\n \"total\" real\n);\n\nQuestion: How many 5K wins did Emily Chebet, who had more than 2 total, have?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"5_k_wins\") FROM \"multiple_winners\" WHERE \"runner\"='emily chebet' AND \"total\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"multiple_winners\" (\n \"runner\" text,\n \"country\" text,\n \"5_k_wins\" real,\n \"10_k_wins\" real,\n \"total\" real\n);\n\nQuestion: How many 5K wins did Emily Chebet, who had more than 2 total, have?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"5_k_wins\") FROM \"multiple_winners\" WHERE \"runner\"='emily chebet' AND \"total\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"belt_requirements\" (\n \"evaluation_average_from_february_2011\" real,\n \"evaluation_average_from_april_2009\" text,\n \"evaluation_average_before_april_2009\" text,\n \"pct_of_negative_evaluations\" text,\n \"submitting_schedule_on_time\" text,\n \"punctuality_attendance_issues\" text,\n \"peak_lessons_taught\" real\n);\n\nQuestion: What is the largest number of Peak lessons taught when the Evaluation average (Before April 2009) was 4.4?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"peak_lessons_taught\") FROM \"belt_requirements\" WHERE \"evaluation_average_before_april_2009\"='4.4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"belt_requirements\" (\n \"evaluation_average_from_february_2011\" real,\n \"evaluation_average_from_april_2009\" text,\n \"evaluation_average_before_april_2009\" text,\n \"pct_of_negative_evaluations\" text,\n \"submitting_schedule_on_time\" text,\n \"punctuality_attendance_issues\" text,\n \"peak_lessons_taught\" real\n);\n\nQuestion: What is the mean Evaluation number (before April 2009) when the Peak lessons taught was less than 80 and the negative percentage of evaluations was 0.8%?"
},
{
"role": "assistant",
"content": "SELECT \"evaluation_average_before_april_2009\" FROM \"belt_requirements\" WHERE \"peak_lessons_taught\"<80 AND \"pct_of_negative_evaluations\"='0.8%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"belt_requirements\" (\n \"evaluation_average_from_february_2011\" real,\n \"evaluation_average_from_april_2009\" text,\n \"evaluation_average_before_april_2009\" text,\n \"pct_of_negative_evaluations\" text,\n \"submitting_schedule_on_time\" text,\n \"punctuality_attendance_issues\" text,\n \"peak_lessons_taught\" real\n);\n\nQuestion: What is the mean Evaluation number (Before April 2009) when the percentage of negative evaluations was 0.8% and the mean Evaluation number of April 2009 was 4.2?"
},
{
"role": "assistant",
"content": "SELECT \"evaluation_average_before_april_2009\" FROM \"belt_requirements\" WHERE \"pct_of_negative_evaluations\"='0.8%' AND \"evaluation_average_from_april_2009\"='4.2';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.