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 \"round_12\" (\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 team score at home in north melbourne?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_12\" WHERE \"away_team\"='north melbourne';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"quarterback\" (\n \"player\" text,\n \"comp\" real,\n \"att\" real,\n \"comppct\" real,\n \"yards\" real,\n \"td_s\" real,\n \"int_s\" real\n);\n\nQuestion: What is the computation for 5 or less TD's?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"comppct\") FROM \"quarterback\" WHERE \"td_s\"<5;"
}
]
|
[
{
"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 was the time of the driver in grid 2?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"grid\"<2;"
}
]
|
[
{
"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 time did Carroll Shelby have in Grid 14?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"grid\"<14 AND \"driver\"='carroll shelby';"
}
]
|
[
{
"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 time did the ferrari car that finished 62 laps have?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"laps\"<62 AND \"constructor\"='ferrari';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"april\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What is the date of the game where the vistor team was the Knicks and more than 18,165 were in attendance?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"april\" WHERE \"visitor\"='knicks' AND \"attendance\">'18,165';"
}
]
|
[
{
"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: Whats teo fabi average lap time while having less than 9 grids?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"laps\") FROM \"race\" WHERE \"driver\"='teo fabi' AND \"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: Which driver drove in grid 19?"
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"race\" WHERE \"grid\"=19;"
}
]
|
[
{
"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: Who was the opponent on April 29?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"date\"='april 29';"
}
]
|
[
{
"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 attended the game on April 17?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"game_log\" WHERE \"date\"='april 17';"
}
]
|
[
{
"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 record on April 3?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"date\"='april 3';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"non_electronic_paper_displays\" (\n \"maker\" text,\n \"model\" text,\n \"intro_year\" text,\n \"screen_size_inch\" text,\n \"screen_type\" text,\n \"weight\" text,\n \"screen_pixels\" text,\n \"hours_reading\" text,\n \"touch_screen\" text,\n \"wireless_network\" text,\n \"internal_storage\" text,\n \"card_reader_slot\" text\n);\n\nQuestion: What is the weight of the display that has an internal storage of 16-64 GB and uses a wi-fi, 3G wireless network?"
},
{
"role": "assistant",
"content": "SELECT \"weight\" FROM \"non_electronic_paper_displays\" WHERE \"internal_storage\"='16-64 gb' AND \"wireless_network\"='wi-fi, 3g';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"non_electronic_paper_displays\" (\n \"maker\" text,\n \"model\" text,\n \"intro_year\" text,\n \"screen_size_inch\" text,\n \"screen_type\" text,\n \"weight\" text,\n \"screen_pixels\" text,\n \"hours_reading\" text,\n \"touch_screen\" text,\n \"wireless_network\" text,\n \"internal_storage\" text,\n \"card_reader_slot\" text\n);\n\nQuestion: Which wireless network did LCD displays with 4 GB of internal storage use?"
},
{
"role": "assistant",
"content": "SELECT \"wireless_network\" FROM \"non_electronic_paper_displays\" WHERE \"screen_type\"='lcd' AND \"internal_storage\"='4 gb';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"mid_gippsland_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What's the lowest number of draws when the wins are less than 15, and against is 1228?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"draws\") FROM \"2012_ladder\" WHERE \"wins\"<15 AND \"against\"=1228;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"mid_gippsland_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What's the sum of draws for against larger than 1228 with fewer than 1 wins?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"draws\") FROM \"2012_ladder\" WHERE \"against\">1228 AND \"wins\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"riff_awards\" (\n \"year\" real,\n \"dates\" text,\n \"discovery_of_the_year_golden_puffin\" text,\n \"lifetime_achievement\" text,\n \"creative_excellency\" text,\n \"audience_award\" text,\n \"fipresci_award\" text,\n \"church_of_iceland_award\" text\n);\n\nQuestion: On what dates did Jim Jarmusch win the Lifetime Achievement?"
},
{
"role": "assistant",
"content": "SELECT \"dates\" FROM \"riff_awards\" WHERE \"lifetime_achievement\"='jim jarmusch';"
}
]
|
[
{
"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 \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: Which team was the home team when Colorado was the visitor and the record became 26\u201315\u20139?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"game_log\" WHERE \"visitor\"='colorado' AND \"record\"='26\u201315\u20139';"
}
]
|
[
{
"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 \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What was the score when the record became 25\u201314\u20139?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"record\"='25\u201314\u20139';"
}
]
|
[
{
"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 \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What was the date the record became 26\u201314\u20139?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"game_log\" WHERE \"record\"='26\u201314\u20139';"
}
]
|
[
{
"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 \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What team was the home team when Colorado was the visitor and the record became 22\u201313\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"game_log\" WHERE \"visitor\"='colorado' AND \"record\"='22\u201313\u20136';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"extra\" text\n);\n\nQuestion: What's the venue for the asian games tournament?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"achievements\" WHERE \"tournament\"='asian games';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"extra\" text\n);\n\nQuestion: Which tournament resulted in 6th place?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"achievements\" WHERE \"result\"='6th';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"extra\" text\n);\n\nQuestion: What's the latest year that Doha, Qatar hosted a tournament?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"achievements\" WHERE \"venue\"='doha, qatar';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"extra\" text\n);\n\nQuestion: What's the average of all years tournaments were hosted in Doha, Qatar?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"achievements\" WHERE \"venue\"='doha, qatar';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1994_chiefs_draft_selections\" (\n \"round\" real,\n \"overall\" real,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the overall draft number for the running back drafted after round 1 from fresno state?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"overall\") FROM \"1994_chiefs_draft_selections\" WHERE \"position\"='running back' AND \"round\">1 AND \"college\"='fresno state';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1994_chiefs_draft_selections\" (\n \"round\" real,\n \"overall\" real,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the overall total for players drafted from notre dame?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"overall\") FROM \"1994_chiefs_draft_selections\" WHERE \"college\"='notre dame';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the sum of gold which has a silver more than 1"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_table\" WHERE \"silver\">1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the average rank for west germany when gold is more than 1"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"medal_table\" WHERE \"nation\"='west germany' AND \"gold\">1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the average rank for when bronze is more than 1"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"medal_table\" WHERE \"bronze\">1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: I want the sum of gold for silver being less than 0"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_table\" WHERE \"silver\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uefa_team_ranking\" (\n \"rank_2014\" real,\n \"rank_2013\" real,\n \"mvmt\" text,\n \"club\" text,\n \"country\" text,\n \"2009_10\" real,\n \"2010_11\" real,\n \"2011_12\" real,\n \"2012_13\" real,\n \"2013_14\" real,\n \"coeff\" real\n);\n\nQuestion: Which 2011\u201312 has a 2010\u201311 smaller than 26.016, and a Rank 2013 larger than 20, and a Club of rubin kazan?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"2011_12\") FROM \"uefa_team_ranking\" WHERE \"2010_11\"<26.016 AND \"rank_2013\">20 AND \"club\"='rubin kazan';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uefa_team_ranking\" (\n \"rank_2014\" real,\n \"rank_2013\" real,\n \"mvmt\" text,\n \"club\" text,\n \"country\" text,\n \"2009_10\" real,\n \"2010_11\" real,\n \"2011_12\" real,\n \"2012_13\" real,\n \"2013_14\" real,\n \"coeff\" real\n);\n\nQuestion: Which Rank 2014 has a 2009\u201310 of 21.233?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank_2014\") FROM \"uefa_team_ranking\" WHERE \"2009_10\"=21.233;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uefa_team_ranking\" (\n \"rank_2014\" real,\n \"rank_2013\" real,\n \"mvmt\" text,\n \"club\" text,\n \"country\" text,\n \"2009_10\" real,\n \"2010_11\" real,\n \"2011_12\" real,\n \"2012_13\" real,\n \"2013_14\" real,\n \"coeff\" real\n);\n\nQuestion: Which 2013\u201314 has a Rank 2014 smaller than 23, and a 2011\u201312 larger than 19.1, and a Rank 2013 of 14?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"2013_14\") FROM \"uefa_team_ranking\" WHERE \"rank_2014\"<23 AND \"2011_12\">19.1 AND \"rank_2013\"=14;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"poll_results\" (\n \"polling_firm\" text,\n \"polling_dates\" text,\n \"bob_chiarelli\" text,\n \"alex_munter\" text,\n \"larry_o_brien\" text,\n \"terry_kilrea_dropped_out\" text\n);\n\nQuestion: What are the polling dates when Larry O'Brien has 37%?"
},
{
"role": "assistant",
"content": "SELECT \"polling_dates\" FROM \"poll_results\" WHERE \"larry_o_brien\"='37%';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"poll_results\" (\n \"polling_firm\" text,\n \"polling_dates\" text,\n \"bob_chiarelli\" text,\n \"alex_munter\" text,\n \"larry_o_brien\" text,\n \"terry_kilrea_dropped_out\" text\n);\n\nQuestion: What dates and firm does Larry O'Brien have 18% when Terry Kilrea dropped out?"
},
{
"role": "assistant",
"content": "SELECT \"terry_kilrea_dropped_out\" FROM \"poll_results\" WHERE \"larry_o_brien\"='18%';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"poll_results\" (\n \"polling_firm\" text,\n \"polling_dates\" text,\n \"bob_chiarelli\" text,\n \"alex_munter\" text,\n \"larry_o_brien\" text,\n \"terry_kilrea_dropped_out\" text\n);\n\nQuestion: What dates does Alex Munter have 25% and the polling firm of Decima?"
},
{
"role": "assistant",
"content": "SELECT \"polling_dates\" FROM \"poll_results\" WHERE \"alex_munter\"='25%' AND \"polling_firm\"='decima';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"poll_results\" (\n \"polling_firm\" text,\n \"polling_dates\" text,\n \"bob_chiarelli\" text,\n \"alex_munter\" text,\n \"larry_o_brien\" text,\n \"terry_kilrea_dropped_out\" text\n);\n\nQuestion: What are the Decima polling dates when Larry O'Brien has 37%?"
},
{
"role": "assistant",
"content": "SELECT \"polling_dates\" FROM \"poll_results\" WHERE \"polling_firm\"='decima' AND \"larry_o_brien\"='37%';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"poll_results\" (\n \"polling_firm\" text,\n \"polling_dates\" text,\n \"bob_chiarelli\" text,\n \"alex_munter\" text,\n \"larry_o_brien\" text,\n \"terry_kilrea_dropped_out\" text\n);\n\nQuestion: What are the polling dates for polling firm Holinshed when Terry Kilrea dropped out and Bob Chiarelli has 22.5%?"
},
{
"role": "assistant",
"content": "SELECT \"terry_kilrea_dropped_out\" FROM \"poll_results\" WHERE \"polling_firm\"='holinshed' AND \"bob_chiarelli\"='22.5%';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_4_7\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is Date, when Outcome is \"Runner Up\", and when Opponent is \"Lu Jiaxiang\"?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"singles_4_7\" WHERE \"outcome\"='runner up' AND \"opponent\"='lu jiaxiang';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_4_7\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is Opponent, when Tournament is \"Phuket , Thailand\"?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"singles_4_7\" WHERE \"tournament\"='phuket , thailand';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_4_7\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is Surface, when Tournament is \"Saint Joseph , United States\"?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"singles_4_7\" WHERE \"tournament\"='saint joseph , united states';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_4_7\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is Tournament, when Opponent is \"Lu Jiaxiang\"?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"singles_4_7\" WHERE \"opponent\"='lu jiaxiang';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_4_7\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is Outcome, when Tournament is \"Chiang Mai , Thailand\"?"
},
{
"role": "assistant",
"content": "SELECT \"outcome\" FROM \"singles_4_7\" WHERE \"tournament\"='chiang mai , thailand';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_4_7\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is Outcome, when Date is \"19 September 2012\"?"
},
{
"role": "assistant",
"content": "SELECT \"outcome\" FROM \"singles_4_7\" WHERE \"date\"='19 september 2012';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_summary\" (\n \"season\" real,\n \"series\" text,\n \"team\" text,\n \"races\" real,\n \"wins\" real,\n \"poles\" real,\n \"podiums\" real,\n \"points\" real,\n \"position\" text\n);\n\nQuestion: What Poles have Races smaller than 4?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"poles\") FROM \"career_summary\" WHERE \"races\"<4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_summary\" (\n \"season\" real,\n \"series\" text,\n \"team\" text,\n \"races\" real,\n \"wins\" real,\n \"poles\" real,\n \"podiums\" real,\n \"points\" real,\n \"position\" text\n);\n\nQuestion: What is the sum of Points with a Series of italian formula renault 2.0, and Poles smaller than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"points\") FROM \"career_summary\" WHERE \"series\"='italian formula renault 2.0' AND \"poles\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_summary\" (\n \"season\" real,\n \"series\" text,\n \"team\" text,\n \"races\" real,\n \"wins\" real,\n \"poles\" real,\n \"podiums\" real,\n \"points\" real,\n \"position\" text\n);\n\nQuestion: What is the total number of Points with Wins larger than 0, a Position of 12th, and Poles larger than 0?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points\") FROM \"career_summary\" WHERE \"wins\">0 AND \"position\"='12th' AND \"poles\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_summary\" (\n \"season\" real,\n \"series\" text,\n \"team\" text,\n \"races\" real,\n \"wins\" real,\n \"poles\" real,\n \"podiums\" real,\n \"points\" real,\n \"position\" text\n);\n\nQuestion: What is the smallest Wins with a Position of 20th, and Poles smaller than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"wins\") FROM \"career_summary\" WHERE \"position\"='20th' AND \"poles\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"professional_boxing_record\" (\n \"result\" text,\n \"opponent\" text,\n \"type\" text,\n \"rd_time\" text,\n \"date\" text,\n \"location\" text\n);\n\nQuestion: What is the date of the match located in Madrid, Esp?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"professional_boxing_record\" WHERE \"location\"='madrid, esp';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"title_holders_from_1964_until_1972\" (\n \"year\" real,\n \"binibining_pilipinas_universe\" text,\n \"binibining_pilipinas_international\" text,\n \"miss_maja_pilipinas\" text,\n \"first_runner_up\" text,\n \"second_runner_up\" text,\n \"third_runner_up\" text,\n \"fourth_runner_up\" text\n);\n\nQuestion: Can you tell me the Miss Pilipinas that has the Second runner-up of maria penson?"
},
{
"role": "assistant",
"content": "SELECT \"miss_maja_pilipinas\" FROM \"title_holders_from_1964_until_1972\" WHERE \"second_runner_up\"='maria penson';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"title_holders_from_1964_until_1972\" (\n \"year\" real,\n \"binibining_pilipinas_universe\" text,\n \"binibining_pilipinas_international\" text,\n \"miss_maja_pilipinas\" text,\n \"first_runner_up\" text,\n \"second_runner_up\" text,\n \"third_runner_up\" text,\n \"fourth_runner_up\" text\n);\n\nQuestion: Can you tell me the Miss Maja Pilipinas that has the Year of 1969?"
},
{
"role": "assistant",
"content": "SELECT \"miss_maja_pilipinas\" FROM \"title_holders_from_1964_until_1972\" WHERE \"year\"=1969;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"title_holders_from_1964_until_1972\" (\n \"year\" real,\n \"binibining_pilipinas_universe\" text,\n \"binibining_pilipinas_international\" text,\n \"miss_maja_pilipinas\" text,\n \"first_runner_up\" text,\n \"second_runner_up\" text,\n \"third_runner_up\" text,\n \"fourth_runner_up\" text\n);\n\nQuestion: Can you tell me the Third runner-up that has the Year of 1969?"
},
{
"role": "assistant",
"content": "SELECT \"third_runner_up\" FROM \"title_holders_from_1964_until_1972\" WHERE \"year\"=1969;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"numerals\" (\n \"2_twee\" text,\n \"3_dree\" text,\n \"4_vea\" text,\n \"5_fiew\" text,\n \"6_sas\" text,\n \"7_s_wen\" text,\n \"8_acht\" text,\n \"9_n_ajen\" text\n);\n\nQuestion: What is 7 s\u00e4wen if 3 dree is 3d dredda?"
},
{
"role": "assistant",
"content": "SELECT \"7_s_wen\" FROM \"numerals\" WHERE \"3_dree\"='3d dredda';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"numerals\" (\n \"2_twee\" text,\n \"3_dree\" text,\n \"4_vea\" text,\n \"5_fiew\" text,\n \"6_sas\" text,\n \"7_s_wen\" text,\n \"8_acht\" text,\n \"9_n_ajen\" text\n);\n\nQuestion: What is 3 dree if 8 acht is 8th achta?"
},
{
"role": "assistant",
"content": "SELECT \"3_dree\" FROM \"numerals\" WHERE \"8_acht\"='8th achta';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"numerals\" (\n \"2_twee\" text,\n \"3_dree\" text,\n \"4_vea\" text,\n \"5_fiew\" text,\n \"6_sas\" text,\n \"7_s_wen\" text,\n \"8_acht\" text,\n \"9_n_ajen\" text\n);\n\nQuestion: What is 5 fiew when 7 s\u00e4wen equals 17 s\u00e4wentieen?"
},
{
"role": "assistant",
"content": "SELECT \"5_fiew\" FROM \"numerals\" WHERE \"7_s_wen\"='17 s\u00e4wentieen';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"numerals\" (\n \"2_twee\" text,\n \"3_dree\" text,\n \"4_vea\" text,\n \"5_fiew\" text,\n \"6_sas\" text,\n \"7_s_wen\" text,\n \"8_acht\" text,\n \"9_n_ajen\" text\n);\n\nQuestion: What is 5 fiew if 7 s\u00e4wen is 7th s\u00e4wenda?"
},
{
"role": "assistant",
"content": "SELECT \"5_fiew\" FROM \"numerals\" WHERE \"7_s_wen\"='7th s\u00e4wenda';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"numerals\" (\n \"2_twee\" text,\n \"3_dree\" text,\n \"4_vea\" text,\n \"5_fiew\" text,\n \"6_sas\" text,\n \"7_s_wen\" text,\n \"8_acht\" text,\n \"9_n_ajen\" text\n);\n\nQuestion: Name the 4 vea for 6 sas at 60 zastich?"
},
{
"role": "assistant",
"content": "SELECT \"4_vea\" FROM \"numerals\" WHERE \"6_sas\"='60 zastich';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"geelong_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Byes have an Against smaller than 1466, and Losses smaller than 6?"
},
{
"role": "assistant",
"content": "SELECT \"byes\" FROM \"2009_ladder\" WHERE \"against\"<1466 AND \"losses\"<6;"
}
]
|
[
{
"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 \"venue\" text,\n \"attendance\" real\n);\n\nQuestion: What was week 2's opponent?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"week\"=2;"
}
]
|
[
{
"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 \"venue\" text,\n \"attendance\" real\n);\n\nQuestion: Which Week has an Attendance of 20,112?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"week\") FROM \"schedule\" WHERE \"attendance\"='20,112';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nascar_sprint_cup_series_race_winners\" (\n \"season\" real,\n \"date\" text,\n \"winning_driver\" text,\n \"car_num\" real,\n \"sponsor\" text,\n \"make\" text,\n \"distance\" text,\n \"avg_speed\" text,\n \"margin_of_victory\" text\n);\n\nQuestion: What is the margin of victory of the Dodge Intrepid?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"nascar_sprint_cup_series_race_winners\" WHERE \"make\"='dodge intrepid';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nascar_sprint_cup_series_race_winners\" (\n \"season\" real,\n \"date\" text,\n \"winning_driver\" text,\n \"car_num\" real,\n \"sponsor\" text,\n \"make\" text,\n \"distance\" text,\n \"avg_speed\" text,\n \"margin_of_victory\" text\n);\n\nQuestion: What is the lowest car number sponsored by UPS before 2001?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"car_num\") FROM \"nascar_sprint_cup_series_race_winners\" WHERE \"sponsor\"='ups' AND \"season\"<2001;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nascar_sprint_cup_series_race_winners\" (\n \"season\" real,\n \"date\" text,\n \"winning_driver\" text,\n \"car_num\" real,\n \"sponsor\" text,\n \"make\" text,\n \"distance\" text,\n \"avg_speed\" text,\n \"margin_of_victory\" text\n);\n\nQuestion: Who sponsored Greg Biffle's win on April 14?"
},
{
"role": "assistant",
"content": "SELECT \"sponsor\" FROM \"nascar_sprint_cup_series_race_winners\" WHERE \"winning_driver\"='greg biffle' AND \"date\"='april 14';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nascar_sprint_cup_series_race_winners\" (\n \"season\" real,\n \"date\" text,\n \"winning_driver\" text,\n \"car_num\" real,\n \"sponsor\" text,\n \"make\" text,\n \"distance\" text,\n \"avg_speed\" text,\n \"margin_of_victory\" text\n);\n\nQuestion: What is the highest car number sponsored by Post-It / National Guard?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"car_num\") FROM \"nascar_sprint_cup_series_race_winners\" WHERE \"sponsor\"='post-it / national guard';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nascar_sprint_cup_series_race_winners\" (\n \"season\" real,\n \"date\" text,\n \"winning_driver\" text,\n \"car_num\" real,\n \"sponsor\" text,\n \"make\" text,\n \"distance\" text,\n \"avg_speed\" text,\n \"margin_of_victory\" text\n);\n\nQuestion: How many seasons has UPS sponsored a car with a number larger than 17?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"season\") FROM \"nascar_sprint_cup_series_race_winners\" WHERE \"car_num\">17 AND \"sponsor\"='ups';"
}
]
|
[
{
"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 \"time\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: What shows for set 2 when Set 1 is 29\u201327?"
},
{
"role": "assistant",
"content": "SELECT \"set_2\" FROM \"pool_b\" WHERE \"set_1\"='29\u201327';"
}
]
|
[
{
"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 \"time\" 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 time when the set 1 is 21\u201325?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"pool_b\" WHERE \"set_1\"='21\u201325';"
}
]
|
[
{
"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 \"time\" 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 score when the set 3 is 26\u201328?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"pool_b\" WHERE \"set_3\"='26\u201328';"
}
]
|
[
{
"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 \"time\" 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 Score when the set 3 is 26\u201328?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"pool_b\" WHERE \"set_3\"='26\u201328';"
}
]
|
[
{
"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 \"time\" 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 when the total is 78\u201392?"
},
{
"role": "assistant",
"content": "SELECT \"set_3\" FROM \"pool_b\" WHERE \"total\"='78\u201392';"
}
]
|
[
{
"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 \"time\" 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 total when the set 1 is 21\u201325?"
},
{
"role": "assistant",
"content": "SELECT \"total\" FROM \"pool_b\" WHERE \"set_1\"='21\u201325';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"s_s_lazio\" (\n \"matches\" real,\n \"wins\" real,\n \"draw\" real,\n \"losses\" real,\n \"against\" real\n);\n\nQuestion: How many total losses were with less than 51 draws but more than 6 wins?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"losses\") FROM \"s_s_lazio\" WHERE \"draw\"<51 AND \"wins\">6;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"s_s_lazio\" (\n \"matches\" real,\n \"wins\" real,\n \"draw\" real,\n \"losses\" real,\n \"against\" real\n);\n\nQuestion: How many matches has 51 draws and more than 6 against?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"matches\") FROM \"s_s_lazio\" WHERE \"against\">6 AND \"draw\"=51;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"s_s_lazio\" (\n \"matches\" real,\n \"wins\" real,\n \"draw\" real,\n \"losses\" real,\n \"against\" real\n);\n\nQuestion: How many wins has more than 165 against?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"wins\") FROM \"s_s_lazio\" WHERE \"against\">165;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"s_s_lazio\" (\n \"matches\" real,\n \"wins\" real,\n \"draw\" real,\n \"losses\" real,\n \"against\" real\n);\n\nQuestion: How many draws have less than 35 losses with 136 matches and less than 146 against?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"draw\") FROM \"s_s_lazio\" WHERE \"losses\"<35 AND \"matches\"=136 AND \"against\"<146;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"mininera_dfl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: How many Againsts have more than 15 wins?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"against\") FROM \"2012_ladder\" WHERE \"wins\">15;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"mininera_dfl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Byes have Losses larger than 0, and an Against larger than 3049?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"byes\") FROM \"2012_ladder\" WHERE \"losses\">0 AND \"against\">3049;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: What is the total number of Points 1, when Position is \"7\", and when Drawn is greater than 6?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"points_1\") FROM \"second_division_final_table\" WHERE \"position\"=7 AND \"drawn\">6;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: What is the highest Goals For, when Team is \"Cheadle Town\", and when Drawn is greater than 7?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals_for\") FROM \"second_division_final_table\" WHERE \"team\"='cheadle town' AND \"drawn\">7;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: What is the sum of Position, when Points 1 is greater than 23, and when Goals For is \"77\"?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"position\") FROM \"second_division_final_table\" WHERE \"points_1\">23 AND \"goals_for\"=77;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: What is Played, when Goal Difference is \"+51\"?"
},
{
"role": "assistant",
"content": "SELECT \"played\" FROM \"second_division_final_table\" WHERE \"goal_difference\"='+51';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"runners_up_12\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is Date, when Surface is \"Carpet\"?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"runners_up_12\" WHERE \"surface\"='carpet';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"runners_up_12\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is Tournament, when Date is \"6 October 2008\"?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"runners_up_12\" WHERE \"date\"='6 october 2008';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"runners_up_12\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is Surface, when Tournament is \"Sunderland , United Kingdom\"?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"runners_up_12\" WHERE \"tournament\"='sunderland , united kingdom';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"position_in_table\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: Who replaced Istv\u00e1n S\u00e1ndor?"
},
{
"role": "assistant",
"content": "SELECT \"replaced_by\" FROM \"managerial_changes\" WHERE \"outgoing_manager\"='istv\u00e1n s\u00e1ndor';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"position_in_table\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: What is the position that has the outgoing manager l\u00e1szl\u00f3 Dajka?"
},
{
"role": "assistant",
"content": "SELECT \"position_in_table\" FROM \"managerial_changes\" WHERE \"outgoing_manager\"='l\u00e1szl\u00f3 dajka';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"position_in_table\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: When was outgoing manager Zolt\u00e1n Varga appointed?"
},
{
"role": "assistant",
"content": "SELECT \"date_of_appointment\" FROM \"managerial_changes\" WHERE \"outgoing_manager\"='zolt\u00e1n varga';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_a\" (\n \"date\" text,\n \"time\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"total\" text\n);\n\nQuestion: Can you tell me the Score that has the Date of 05 dec?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"pool_a\" WHERE \"date\"='05 dec';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"anaprof_2008_relegation_table\" (\n \"place_posici_n\" real,\n \"team_equipo\" text,\n \"played_pj\" real,\n \"won_pg\" real,\n \"draw_pe\" real,\n \"lost_pp\" real,\n \"goals_scored_gf\" real,\n \"goals_conceded_gc\" real,\n \"dif\" real,\n \"points_pts\" real\n);\n\nQuestion: What is the average number of points of the team with more than 17 pg won?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"points_pts\") FROM \"anaprof_2008_relegation_table\" WHERE \"won_pg\">17;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"anaprof_2008_relegation_table\" (\n \"place_posici_n\" real,\n \"team_equipo\" text,\n \"played_pj\" real,\n \"won_pg\" real,\n \"draw_pe\" real,\n \"lost_pp\" real,\n \"goals_scored_gf\" real,\n \"goals_conceded_gc\" real,\n \"dif\" real,\n \"points_pts\" real\n);\n\nQuestion: What is the total number of pg won of the team with 64 goals conceded and more than 33 goals scored?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"won_pg\") FROM \"anaprof_2008_relegation_table\" WHERE \"goals_conceded_gc\"=64 AND \"goals_scored_gf\">33;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"anaprof_2008_relegation_table\" (\n \"place_posici_n\" real,\n \"team_equipo\" text,\n \"played_pj\" real,\n \"won_pg\" real,\n \"draw_pe\" real,\n \"lost_pp\" real,\n \"goals_scored_gf\" real,\n \"goals_conceded_gc\" real,\n \"dif\" real,\n \"points_pts\" real\n);\n\nQuestion: What is the sum of the pe draw of team plaza amador, who has less than 6 pg won?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"draw_pe\") FROM \"anaprof_2008_relegation_table\" WHERE \"team_equipo\"='plaza amador' AND \"won_pg\"<6;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"anaprof_2008_relegation_table\" (\n \"place_posici_n\" real,\n \"team_equipo\" text,\n \"played_pj\" real,\n \"won_pg\" real,\n \"draw_pe\" real,\n \"lost_pp\" real,\n \"goals_scored_gf\" real,\n \"goals_conceded_gc\" real,\n \"dif\" real,\n \"points_pts\" real\n);\n\nQuestion: What is the sum of the places of the team with more than 49 points and less than 54 goals scored?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"place_posici_n\") FROM \"anaprof_2008_relegation_table\" WHERE \"points_pts\">49 AND \"goals_scored_gf\"<54;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1_fc_nuremberg_versus_sp_vgg_greuther_f_\" (\n \"season\" text,\n \"league\" text,\n \"teams\" text,\n \"home\" text,\n \"away\" text\n);\n\nQuestion: WHAT IS THE AWAY WITH HOME AT 2-2?"
},
{
"role": "assistant",
"content": "SELECT \"away\" FROM \"1_fc_nuremberg_versus_sp_vgg_greuther_f_\" WHERE \"home\"='2-2';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1_fc_nuremberg_versus_sp_vgg_greuther_f_\" (\n \"season\" text,\n \"league\" text,\n \"teams\" text,\n \"home\" text,\n \"away\" text\n);\n\nQuestion: WHAT IS THE LEAGUE WITH HOME 1-1?"
},
{
"role": "assistant",
"content": "SELECT \"league\" FROM \"1_fc_nuremberg_versus_sp_vgg_greuther_f_\" WHERE \"home\"='1-1';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"russia\" (\n \"name\" text,\n \"pos\" text,\n \"height\" text,\n \"weight\" text,\n \"date_of_birth\" text,\n \"club\" text\n);\n\nQuestion: What is the Weight of the person born 1981-02-24 from the Uralochka Zlatoust club ?"
},
{
"role": "assistant",
"content": "SELECT \"weight\" FROM \"russia\" WHERE \"club\"='uralochka zlatoust' AND \"date_of_birth\"='1981-02-24';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"michigan_counties_by_per_capita_income\" (\n \"county\" text,\n \"per_capita_income\" text,\n \"median_household_income\" text,\n \"median_family_income\" text,\n \"population\" real,\n \"number_of_households\" real\n);\n\nQuestion: What is the total number of households with a population larger than 25,692 and a median household income of $51,914?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"number_of_households\") FROM \"michigan_counties_by_per_capita_income\" WHERE \"population\">'25,692' AND \"median_household_income\"='$51,914';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"michigan_counties_by_per_capita_income\" (\n \"county\" text,\n \"per_capita_income\" text,\n \"median_household_income\" text,\n \"median_family_income\" text,\n \"population\" real,\n \"number_of_households\" real\n);\n\nQuestion: What is the sum of households that makes a median household income of $44,718?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"number_of_households\") FROM \"michigan_counties_by_per_capita_income\" WHERE \"median_household_income\"='$44,718';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"michigan_counties_by_per_capita_income\" (\n \"county\" text,\n \"per_capita_income\" text,\n \"median_household_income\" text,\n \"median_family_income\" text,\n \"population\" real,\n \"number_of_households\" real\n);\n\nQuestion: What is the highest population for Baraga County with less than 3,444 households?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"population\") FROM \"michigan_counties_by_per_capita_income\" WHERE \"county\"='baraga' AND \"number_of_households\"<'3,444';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money_s\" real\n);\n\nQuestion: Which golfer had a score of 68-70-68-66=272?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"final_round\" WHERE \"score\"='68-70-68-66=272';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money_s\" real\n);\n\nQuestion: What place was the golfer with a score of 67-67-66-68=268 ranked in?"
},
{
"role": "assistant",
"content": "SELECT \"place\" FROM \"final_round\" WHERE \"score\"='67-67-66-68=268';"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.