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 \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: Who had the high assists when the record was 33\u201315?"
},
{
"role": "assistant",
"content": "SELECT \"high_assists\" FROM \"game_log\" WHERE \"record\"='33\u201315';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What date was the location attendance at&t center 18,797, and a game earlier than 57?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"game_log\" WHERE \"location_attendance\"='at&t center 18,797' AND \"game\"<57;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What player had the high assists when the Score was l 107\u2013112 (ot)?"
},
{
"role": "assistant",
"content": "SELECT \"high_assists\" FROM \"game_log\" WHERE \"score\"='l 107\u2013112 (ot)';"
}
] |
[
{
"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\" real\n);\n\nQuestion: What was the result when they played the Miami Dolphins with a crowd of 21,881?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"schedule\" WHERE \"attendance\">'21,881' AND \"opponent\"='miami dolphins';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"rank\" real,\n \"rank_forbes_2000\" real,\n \"name\" text,\n \"headquarters\" text,\n \"revenue_bn\" real,\n \"profit_bn\" real,\n \"assets_bn\" real,\n \"market_value_bn\" real,\n \"industry\" text\n);\n\nQuestion: Which company had a market value less than $5.59 billion, assets greater than $27.46 billion, and a rank above 39?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"list\" WHERE \"market_value_bn\"<5.59 AND \"rank\">39 AND \"assets_bn\">27.46;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"rank\" real,\n \"rank_forbes_2000\" real,\n \"name\" text,\n \"headquarters\" text,\n \"revenue_bn\" real,\n \"profit_bn\" real,\n \"assets_bn\" real,\n \"market_value_bn\" real,\n \"industry\" text\n);\n\nQuestion: How many ranks have assets of $70.74 billion and market value greater than $11.29 billion?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"list\" WHERE \"assets_bn\"=70.74 AND \"market_value_bn\">11.29;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"rank\" real,\n \"rank_forbes_2000\" real,\n \"name\" text,\n \"headquarters\" text,\n \"revenue_bn\" real,\n \"profit_bn\" real,\n \"assets_bn\" real,\n \"market_value_bn\" real,\n \"industry\" text\n);\n\nQuestion: What is the sum of revenue in Hong Kong with a rank greater than 42, less than $3.46 billion in assets, and greater than $0.17 billion in profits?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"revenue_bn\") FROM \"list\" WHERE \"assets_bn\"<3.46 AND \"headquarters\"='hong kong' AND \"profit_bn\">0.17 AND \"rank\">42;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"rank\" real,\n \"rank_forbes_2000\" real,\n \"name\" text,\n \"headquarters\" text,\n \"revenue_bn\" real,\n \"profit_bn\" real,\n \"assets_bn\" real,\n \"market_value_bn\" real,\n \"industry\" text\n);\n\nQuestion: What is the sum of revenue for the banking industry with a Forbes 2000 rank under 53?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"revenue_bn\") FROM \"list\" WHERE \"industry\"='banking' AND \"rank_forbes_2000\"<53;"
}
] |
[
{
"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\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the highest number of gold medals when the silver is less than 0?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"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 \"immigration\" (\n \"year\" text,\n \"indians_admitted\" real,\n \"pakistanis_admitted\" real,\n \"sri_lankans_admitted\" real,\n \"bangladeshis_admitted\" real,\n \"nepalis_admitted\" real\n);\n\nQuestion: What was the most Nepalis admitted when the number of Sri Lankans was more than 5,520, Bangladeshis was more than 2,715, and Pakistanis more than 139,574?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"nepalis_admitted\") FROM \"immigration\" WHERE \"sri_lankans_admitted\">'5,520' AND \"bangladeshis_admitted\">'2,715' AND \"pakistanis_admitted\">'139,574';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"immigration\" (\n \"year\" text,\n \"indians_admitted\" real,\n \"pakistanis_admitted\" real,\n \"sri_lankans_admitted\" real,\n \"bangladeshis_admitted\" real,\n \"nepalis_admitted\" real\n);\n\nQuestion: What were the fewest number of Sri Lankans admitted when more than 4,270 Bangladeshis and more than 4,986 Pakistanis were admitted?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"sri_lankans_admitted\") FROM \"immigration\" WHERE \"bangladeshis_admitted\">'4,270' AND \"pakistanis_admitted\">'4,986';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"immigration\" (\n \"year\" text,\n \"indians_admitted\" real,\n \"pakistanis_admitted\" real,\n \"sri_lankans_admitted\" real,\n \"bangladeshis_admitted\" real,\n \"nepalis_admitted\" real\n);\n\nQuestion: How many Sri Lankans were admitted in 2004 when more than 594 Nepalis were admitted?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"sri_lankans_admitted\") FROM \"immigration\" WHERE \"year\"='2004' AND \"nepalis_admitted\">594;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"immigration\" (\n \"year\" text,\n \"indians_admitted\" real,\n \"pakistanis_admitted\" real,\n \"sri_lankans_admitted\" real,\n \"bangladeshis_admitted\" real,\n \"nepalis_admitted\" real\n);\n\nQuestion: How many Bangladeshis were admitted when 714 Nepalis and 13,575 Pakistanis were admitted?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"bangladeshis_admitted\") FROM \"immigration\" WHERE \"nepalis_admitted\"=714 AND \"pakistanis_admitted\">'13,575';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"immigration\" (\n \"year\" text,\n \"indians_admitted\" real,\n \"pakistanis_admitted\" real,\n \"sri_lankans_admitted\" real,\n \"bangladeshis_admitted\" real,\n \"nepalis_admitted\" real\n);\n\nQuestion: What was the most Nepalis admitted when fewer than 1,896 Bangladeshis were admitted?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"nepalis_admitted\") FROM \"immigration\" WHERE \"bangladeshis_admitted\"<'1,896';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"special_editions\" (\n \"title\" text,\n \"parent_magazine\" text,\n \"magazine_type\" text,\n \"frequency\" text,\n \"first_published\" text\n);\n\nQuestion: What is the frequency that the magazine issues that was first published on april 27, 2010?"
},
{
"role": "assistant",
"content": "SELECT \"frequency\" FROM \"special_editions\" WHERE \"first_published\"='april 27, 2010';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"special_editions\" (\n \"title\" text,\n \"parent_magazine\" text,\n \"magazine_type\" text,\n \"frequency\" text,\n \"first_published\" text\n);\n\nQuestion: What was the type of the magazine that was named dengeki game appli?"
},
{
"role": "assistant",
"content": "SELECT \"magazine_type\" FROM \"special_editions\" WHERE \"title\"='dengeki game appli';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"special_editions\" (\n \"title\" text,\n \"parent_magazine\" text,\n \"magazine_type\" text,\n \"frequency\" text,\n \"first_published\" text\n);\n\nQuestion: What is the name of the video game magazine that was issued bimonthly?"
},
{
"role": "assistant",
"content": "SELECT \"title\" FROM \"special_editions\" WHERE \"magazine_type\"='video game' AND \"frequency\"='bimonthly';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"special_editions\" (\n \"title\" text,\n \"parent_magazine\" text,\n \"magazine_type\" text,\n \"frequency\" text,\n \"first_published\" text\n);\n\nQuestion: What was the parent magazine for the manga magazine, dengeki moeoh that was issued bimonthly?"
},
{
"role": "assistant",
"content": "SELECT \"parent_magazine\" FROM \"special_editions\" WHERE \"frequency\"='bimonthly' AND \"magazine_type\"='manga' AND \"title\"='dengeki moeoh';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"special_editions\" (\n \"title\" text,\n \"parent_magazine\" text,\n \"magazine_type\" text,\n \"frequency\" text,\n \"first_published\" text\n);\n\nQuestion: What was the parent magazine of the magazine that was first published on december 16, 2004?"
},
{
"role": "assistant",
"content": "SELECT \"parent_magazine\" FROM \"special_editions\" WHERE \"first_published\"='december 16, 2004';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: WHAT IS THE OVERALL AVERAGE WITH A 22 PICK, FROM RICE COLLEGE, AND ROUND BIGGER THAN 10?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"pick\"=22 AND \"college\"='rice' AND \"round\">10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: WHAT POSITION HAS A 23 PICK?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"washington_redskins_draft_history\" WHERE \"pick\"=23;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: WHAT IS THE AVERAGE OVERALL WITH A ROUND LARGER THAN 9, AND RB POSITION?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"round\">9 AND \"position\"='rb';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: WHAT IS THE TOTAL NUMBER WITH A ROUND BIGGER THAN 7 AND PICK OF 21?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"round\">7 AND \"pick\"=21;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: WHAT POSITION IS 273?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"washington_redskins_draft_history\" WHERE \"overall\"=273;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"college_statistics\" (\n \"year\" text,\n \"rebs\" real,\n \"asts\" real,\n \"stls\" real,\n \"blks\" real\n);\n\nQuestion: What is the lowest Stls, when Rebs is greater than 8.6?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"stls\") FROM \"college_statistics\" WHERE \"rebs\">8.6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"college_statistics\" (\n \"year\" text,\n \"rebs\" real,\n \"asts\" real,\n \"stls\" real,\n \"blks\" real\n);\n\nQuestion: What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"blks\") FROM \"college_statistics\" WHERE \"stls\"=1 AND \"rebs\">8.6;"
}
] |
[
{
"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 \"game\" real,\n \"october\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text\n);\n\nQuestion: Which opponent played in game 3 before October 18?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule_and_results\" WHERE \"october\"<18 AND \"game\"=3;"
}
] |
[
{
"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 \"game\" real,\n \"october\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text\n);\n\nQuestion: Which game was after October 24 and had a record of 6-2-1?"
},
{
"role": "assistant",
"content": "SELECT \"game\" FROM \"schedule_and_results\" WHERE \"october\">24 AND \"record\"='6-2-1';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: What was the lowest pick for the kicker after round 12?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"pick\") FROM \"nfl_draft\" WHERE \"round\">12 AND \"position\"='kicker';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: How many picks had less than 11 rounds and a player of Charley Casey?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"pick\") FROM \"nfl_draft\" WHERE \"round\"<11 AND \"player\"='charley casey';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: How many rounds had a position of kicker?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"round\") FROM \"nfl_draft\" WHERE \"position\"='kicker';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: Which position had a pick larger than 80 and Walt Mainer as a player?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"nfl_draft\" WHERE \"pick\">80 AND \"player\"='walt mainer';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\n \"date\" text,\n \"home\" text,\n \"score\" text,\n \"away\" text,\n \"attendance\" real\n);\n\nQuestion: What is the score of the match with deportes savio as the away team?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"round_11\" WHERE \"away\"='deportes savio';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\n \"date\" text,\n \"home\" text,\n \"score\" text,\n \"away\" text,\n \"attendance\" real\n);\n\nQuestion: What is the total attendance of the match with a 1:2 score?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") FROM \"round_11\" WHERE \"score\"='1:2';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\n \"date\" text,\n \"home\" text,\n \"score\" text,\n \"away\" text,\n \"attendance\" real\n);\n\nQuestion: What is the home team of the match on 21 September 2008 with an attendance less than 2248 and a 2:0 score?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"round_11\" WHERE \"attendance\"<2248 AND \"score\"='2:0' AND \"date\"='21 september 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\n \"date\" text,\n \"home\" text,\n \"score\" text,\n \"away\" text,\n \"attendance\" real\n);\n\nQuestion: What is the highest attendance of the match with a 2:0 score and vida as the away team?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"attendance\") FROM \"round_11\" WHERE \"score\"='2:0' AND \"away\"='vida';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\n \"date\" text,\n \"home\" text,\n \"score\" text,\n \"away\" text,\n \"attendance\" real\n);\n\nQuestion: What is the score of the home team olimpia?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"round_11\" WHERE \"home\"='olimpia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\n \"date\" text,\n \"home\" text,\n \"score\" text,\n \"away\" text,\n \"attendance\" real\n);\n\nQuestion: What is the score of the match with an attendance of 2248?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"round_11\" WHERE \"attendance\"=2248;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"party\" text,\n \"previous_council\" real,\n \"staying_councillors\" real,\n \"seats_up_for_election\" real,\n \"election_result\" real,\n \"new_council\" real\n);\n\nQuestion: Which Seats up for election have an Election result larger than 8, and Staying councillors of 24?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"seats_up_for_election\") FROM \"results\" WHERE \"election_result\">8 AND \"staying_councillors\"=24;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"party\" text,\n \"previous_council\" real,\n \"staying_councillors\" real,\n \"seats_up_for_election\" real,\n \"election_result\" real,\n \"new_council\" real\n);\n\nQuestion: Which New council has an Election result larger than 24?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"new_council\") FROM \"results\" WHERE \"election_result\">24;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"party\" text,\n \"previous_council\" real,\n \"staying_councillors\" real,\n \"seats_up_for_election\" real,\n \"election_result\" real,\n \"new_council\" real\n);\n\nQuestion: Which Staying councillors have a New council of 7, and a Previous council larger than 8?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"staying_councillors\") FROM \"results\" WHERE \"new_council\"=7 AND \"previous_council\">8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"location\" text,\n \"record\" text\n);\n\nQuestion: What was the record when they played in the Miami Arena, before game 24?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"game\"<24 AND \"location\"='miami arena';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"location\" text,\n \"record\" text\n);\n\nQuestion: Who was the opponent when they played after Game 26 and their record was 23-4?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"game\">26 AND \"record\"='23-4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"location\" text,\n \"record\" text\n);\n\nQuestion: On what date did they play in Boston Garden with a record of 22-4?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"game_log\" WHERE \"location\"='boston garden' AND \"record\"='22-4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"location\" text,\n \"record\" text\n);\n\nQuestion: What was their record on Wed. Dec. 5, when they played in Boston Garden?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"location\"='boston garden' AND \"date\"='wed. dec. 5';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: What place in Lon Hinkle in?"
},
{
"role": "assistant",
"content": "SELECT \"place\" FROM \"second_round\" WHERE \"player\"='lon hinkle';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: What country does Mark Hayes play for?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"second_round\" WHERE \"player\"='mark hayes';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" real,\n \"finish\" text\n);\n\nQuestion: What is the sum of To Par, when Country is \"United States\", and when Year(s) Won is \"1973\"?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"to_par\") FROM \"made_the_cut\" WHERE \"country\"='united states' AND \"year_s_won\"='1973';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" real,\n \"finish\" text\n);\n\nQuestion: What is Player, when Total is greater than 288, and when Country is \"South Africa\"?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"made_the_cut\" WHERE \"total\">288 AND \"country\"='south africa';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" real,\n \"finish\" text\n);\n\nQuestion: What is Year(s) Won, when To Par is greater than 13?"
},
{
"role": "assistant",
"content": "SELECT \"year_s_won\" FROM \"made_the_cut\" WHERE \"to_par\">13;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"members_of_the_georgia_state_house_of_re\" (\n \"district\" real,\n \"representative\" text,\n \"party\" text,\n \"first_elected\" real,\n \"residence\" text\n);\n\nQuestion: What residence has representative Quincy Murphy?"
},
{
"role": "assistant",
"content": "SELECT \"residence\" FROM \"members_of_the_georgia_state_house_of_re\" WHERE \"representative\"='quincy murphy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"test_matches\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: Who is the home captain when the venue is adelaide oval?"
},
{
"role": "assistant",
"content": "SELECT \"home_captain\" FROM \"test_matches\" WHERE \"venue\"='adelaide oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pre_season\" (\n \"date\" text,\n \"time\" text,\n \"opponent\" text,\n \"location\" text,\n \"score\" text\n);\n\nQuestion: What was the score in the September 20 game?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"pre_season\" WHERE \"date\"='september 20';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pre_season\" (\n \"date\" text,\n \"time\" text,\n \"opponent\" text,\n \"location\" text,\n \"score\" text\n);\n\nQuestion: Where was the September 22 game played?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"pre_season\" WHERE \"date\"='september 22';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pre_season\" (\n \"date\" text,\n \"time\" text,\n \"opponent\" text,\n \"location\" text,\n \"score\" text\n);\n\nQuestion: What was the score in the September 26 game?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"pre_season\" WHERE \"date\"='september 26';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pre_season\" (\n \"date\" text,\n \"time\" text,\n \"opponent\" text,\n \"location\" text,\n \"score\" text\n);\n\nQuestion: Who was the opposing team in the game(s) that started at 7:30pm?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"pre_season\" WHERE \"time\"='7:30pm';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pre_season\" (\n \"date\" text,\n \"time\" text,\n \"opponent\" text,\n \"location\" text,\n \"score\" text\n);\n\nQuestion: What was the score of the 7:00pm game at Scotiabank Place against the Philadelphia Flyers?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"pre_season\" WHERE \"time\"='7:00pm' AND \"location\"='scotiabank place' AND \"opponent\"='philadelphia flyers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponentnum\" text,\n \"rank_num\" text,\n \"site\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What is the attendance of the match on October 26?"
},
{
"role": "assistant",
"content": "SELECT \"attendance\" FROM \"schedule\" WHERE \"date\"='october 26';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponentnum\" text,\n \"rank_num\" text,\n \"site\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What is the opponent number of the match with a w27-16 result?"
},
{
"role": "assistant",
"content": "SELECT \"opponentnum\" FROM \"schedule\" WHERE \"result\"='w27-16';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponentnum\" text,\n \"rank_num\" text,\n \"site\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What is the result of the match with an attendance of 73,855?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"schedule\" WHERE \"attendance\"='73,855';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponentnum\" text,\n \"rank_num\" text,\n \"site\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What is the rank of the match on October 19?"
},
{
"role": "assistant",
"content": "SELECT \"rank_num\" FROM \"schedule\" WHERE \"date\"='october 19';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_cup\" (\n \"date\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real,\n \"scorers\" text\n);\n\nQuestion: Who was the scorer when the opponent was aberdeen?"
},
{
"role": "assistant",
"content": "SELECT \"scorers\" FROM \"league_cup\" WHERE \"opponent\"='aberdeen';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_cup\" (\n \"date\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real,\n \"scorers\" text\n);\n\nQuestion: When was the scorer mccoist (3), johnston, butcher, steven?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"league_cup\" WHERE \"scorers\"='mccoist (3), johnston, butcher, steven';"
}
] |
[
{
"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 \"attendance\" real,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: What is Score, when Visitor is \"Pittsburgh\", and when Points is greater than 18?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"visitor\"='pittsburgh' AND \"points\">18;"
}
] |
[
{
"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 \"attendance\" real,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: What is the sum of Points, when Home is \"Pittsburgh\", when Date is \"December 21\", and when Attendance is greater than 5,307?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points\") FROM \"game_log\" WHERE \"home\"='pittsburgh' AND \"date\"='december 21' AND \"attendance\">'5,307';"
}
] |
[
{
"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 \"attendance\" real,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: What is the lowest Points, when Home is \"Boston\"?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"game_log\" WHERE \"home\"='boston';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: what is the team when the high points is by charlie villanueva (24)?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"game_log\" WHERE \"high_points\"='charlie villanueva (24)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: what is the location attendance when the high assists is by ramon sessions (8) on march 30?"
},
{
"role": "assistant",
"content": "SELECT \"location_attendance\" FROM \"game_log\" WHERE \"high_assists\"='ramon sessions (8)' AND \"date\"='march 30';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: Who had the high rebounds when the score was l 85\u2013102 (ot)?"
},
{
"role": "assistant",
"content": "SELECT \"high_rebounds\" FROM \"game_log\" WHERE \"score\"='l 85\u2013102 (ot)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: what is the location attendance when the score is w 86\u201377 (ot)?"
},
{
"role": "assistant",
"content": "SELECT \"location_attendance\" FROM \"game_log\" WHERE \"score\"='w 86\u201377 (ot)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: what is the date when ramon sessions (8) had the high assists, richard jefferson (29) had the high points and the score was w 107\u201378 (ot)?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"game_log\" WHERE \"high_assists\"='ramon sessions (8)' AND \"high_points\"='richard jefferson (29)' AND \"score\"='w 107\u201378 (ot)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: who had the high rebounds when the team was @ toronto?"
},
{
"role": "assistant",
"content": "SELECT \"high_rebounds\" FROM \"game_log\" WHERE \"team\"='@ toronto';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_season\" (\n \"season\" text,\n \"race\" real,\n \"podium\" real,\n \"pole\" real,\n \"f_lap\" real\n);\n\nQuestion: What is the lowest pole with a Flap larger than 5, and a before race 155?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"pole\") FROM \"by_season\" WHERE \"f_lap\">5 AND \"race\"<155;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: What was Fred Couples' score?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"score\") FROM \"first_round\" WHERE \"player\"='fred couples';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: When Payne Stewart of the United States scored higher than 69, what was the To Par?"
},
{
"role": "assistant",
"content": "SELECT \"to_par\" FROM \"first_round\" WHERE \"country\"='united states' AND \"score\">69 AND \"player\"='payne stewart';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"north_korea_dprk\" (\n \"city\" text,\n \"korean\" text,\n \"hancha\" text,\n \"province\" text,\n \"population_2008\" real\n);\n\nQuestion: What is the 2008 population in \ud568\ud765 (Ham Hyung)?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"population_2008\") FROM \"north_korea_dprk\" WHERE \"korean\"='\ud568\ud765';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"the_200_most_topographically_prominent_m\" (\n \"rank\" real,\n \"mountain_peak\" text,\n \"region\" text,\n \"mountain_range\" text,\n \"location\" text\n);\n\nQuestion: what is the mountain peak when the location is 53.1370\u00b0n 119.2667\u00b0w?"
},
{
"role": "assistant",
"content": "SELECT \"mountain_peak\" FROM \"the_200_most_topographically_prominent_m\" WHERE \"location\"='53.1370\u00b0n 119.2667\u00b0w';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"the_200_most_topographically_prominent_m\" (\n \"rank\" real,\n \"mountain_peak\" text,\n \"region\" text,\n \"mountain_range\" text,\n \"location\" text\n);\n\nQuestion: what is the region when the location is 49.7462\u00b0n 117.1419\u00b0w?"
},
{
"role": "assistant",
"content": "SELECT \"region\" FROM \"the_200_most_topographically_prominent_m\" WHERE \"location\"='49.7462\u00b0n 117.1419\u00b0w';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"the_200_most_topographically_prominent_m\" (\n \"rank\" real,\n \"mountain_peak\" text,\n \"region\" text,\n \"mountain_range\" text,\n \"location\" text\n);\n\nQuestion: what is the rank when the mountain peak is isthmus peak?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"the_200_most_topographically_prominent_m\" WHERE \"mountain_peak\"='isthmus peak';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"the_200_most_topographically_prominent_m\" (\n \"rank\" real,\n \"mountain_peak\" text,\n \"region\" text,\n \"mountain_range\" text,\n \"location\" text\n);\n\nQuestion: what is the mountain range when the region is british columbia and mountain pea is mount edziza?"
},
{
"role": "assistant",
"content": "SELECT \"mountain_range\" FROM \"the_200_most_topographically_prominent_m\" WHERE \"region\"='british columbia' AND \"mountain_peak\"='mount edziza';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1914_1925\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is the Born-Died dates of Xhafer Bej Ypi?"
},
{
"role": "assistant",
"content": "SELECT \"born_died\" FROM \"1914_1925\" WHERE \"name\"='xhafer bej ypi';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1914_1925\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is the Name of the Prime Minister with a Born-Died of 1873\u20131933?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"1914_1925\" WHERE \"born_died\"='1873\u20131933';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1914_1925\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is the Term Start date of the Progressive Party Prime Minister?"
},
{
"role": "assistant",
"content": "SELECT \"term_start\" FROM \"1914_1925\" WHERE \"political_party\"='progressive party';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"opinion_polling_for_the_united_states_gu\" (\n \"poll_source\" text,\n \"dates_administered\" text,\n \"democrat_brian_schweitzer\" text,\n \"republican_roy_brown\" text,\n \"libertarian_stan_jones\" text,\n \"lead_margin\" real\n);\n\nQuestion: What was the lead margin when Schweitzer had 55% and Jones had 2%?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"lead_margin\") FROM \"opinion_polling_for_the_united_states_gu\" WHERE \"democrat_brian_schweitzer\"='55%' AND \"libertarian_stan_jones\"='2%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"opinion_polling_for_the_united_states_gu\" (\n \"poll_source\" text,\n \"dates_administered\" text,\n \"democrat_brian_schweitzer\" text,\n \"republican_roy_brown\" text,\n \"libertarian_stan_jones\" text,\n \"lead_margin\" real\n);\n\nQuestion: What is the percentage for Brown when the lead margin is 26?"
},
{
"role": "assistant",
"content": "SELECT \"republican_roy_brown\" FROM \"opinion_polling_for_the_united_states_gu\" WHERE \"lead_margin\"=26;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"opinion_polling_for_the_united_states_gu\" (\n \"poll_source\" text,\n \"dates_administered\" text,\n \"democrat_brian_schweitzer\" text,\n \"republican_roy_brown\" text,\n \"libertarian_stan_jones\" text,\n \"lead_margin\" real\n);\n\nQuestion: What is the percentage for Schweitzer when the lead margin is 29?"
},
{
"role": "assistant",
"content": "SELECT \"democrat_brian_schweitzer\" FROM \"opinion_polling_for_the_united_states_gu\" WHERE \"lead_margin\"=29;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"opinion_polling_for_the_united_states_gu\" (\n \"poll_source\" text,\n \"dates_administered\" text,\n \"democrat_brian_schweitzer\" text,\n \"republican_roy_brown\" text,\n \"libertarian_stan_jones\" text,\n \"lead_margin\" real\n);\n\nQuestion: What is the largest lead margin when Schweitzer has 55% and Jones is not an option?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"lead_margin\") FROM \"opinion_polling_for_the_united_states_gu\" WHERE \"democrat_brian_schweitzer\"='55%' AND \"libertarian_stan_jones\"='not an option';"
}
] |
[
{
"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 \"decision\" text,\n \"attendance\" real,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: What is Record, when Date is \"November 22\"?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"date\"='november 22';"
}
] |
[
{
"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 \"decision\" text,\n \"attendance\" real,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: What is Date, when Attendance is greater than 20,066, and when Visitor is \"Boston Bruins\"?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"game_log\" WHERE \"attendance\">'20,066' AND \"visitor\"='boston bruins';"
}
] |
[
{
"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\" real\n);\n\nQuestion: What is the attendance before week 1?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") 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 \"lpga_tour_wins_13\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What was the date of the match with a winning score of \u20137 (67-72-69-69=277)?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"lpga_tour_wins_13\" WHERE \"winning_score\"='\u20137 (67-72-69-69=277)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: Who was the home team in the match with an away team of Millwall?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"first_round_proper\" WHERE \"away_team\"='millwall';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: What is the score for the match that had a home team of Kidderminster Harriers?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"first_round_proper\" WHERE \"home_team\"='kidderminster harriers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: What is the date of the match with a home team of Huddersfield Town and was a replay tie?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"first_round_proper\" WHERE \"tie_no\"='replay' AND \"home_team\"='huddersfield town';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: Who was the home team for tie number 11?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"first_round_proper\" WHERE \"tie_no\"='11';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_2_1000cc_superbike_race_final_stand\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"time\" text,\n \"speed\" text\n);\n\nQuestion: Who was the rider with 120.953 mph speed?"
},
{
"role": "assistant",
"content": "SELECT \"rider\" FROM \"race_2_1000cc_superbike_race_final_stand\" WHERE \"speed\"='120.953 mph';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_2_1000cc_superbike_race_final_stand\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"time\" text,\n \"speed\" text\n);\n\nQuestion: What time did rider steve plater have?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"race_2_1000cc_superbike_race_final_stand\" WHERE \"rider\"='steve plater';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_2_1000cc_superbike_race_final_stand\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"time\" text,\n \"speed\" text\n);\n\nQuestion: What is the rank of rider gary johnson, who had a speed of 120.979 mph?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"race_2_1000cc_superbike_race_final_stand\" WHERE \"speed\"='120.979 mph' AND \"rider\"='gary johnson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" real,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: What club has less than 8 draws, 37 points, and less than 71 goals?"
},
{
"role": "assistant",
"content": "SELECT \"club\" FROM \"group_ii\" WHERE \"draws\"<8 AND \"points\"=37 AND \"goals_for\"<71;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" real,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"goals_for\") FROM \"group_ii\" WHERE \"draws\"=3 AND \"losses\">18 AND \"played\"<38;"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.