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 \"group_i\" (\n \"position\" real,\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 average number played that has fewer than 11 wins, more than 42 goals, more than 22 points, and 11 losses?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"played\") FROM \"group_i\" WHERE \"wins\"<11 AND \"goals_for\">42 AND \"points\">22 AND \"losses\"=11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_i\" (\n \"position\" real,\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 of the goal difference entries for entries with fewer than 49 goals and position smaller than 8?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"goal_difference\") FROM \"group_i\" WHERE \"goals_for\"<49 AND \"position\"<8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_i\" (\n \"position\" real,\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 lowest played for the entry with position of 2 and fewer than 9 losses?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"played\") FROM \"group_i\" WHERE \"position\"=2 AND \"losses\"<9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_i\" (\n \"position\" real,\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 losses for entries that have 12 wins and a goal difference smaller than -14?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"losses\") FROM \"group_i\" WHERE \"wins\"=12 AND \"goal_difference\"<-14;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"squad_information\" (\n \"nat\" text,\n \"name\" text,\n \"since\" text,\n \"app_l_c_e\" text,\n \"goals_l_c_e\" text,\n \"ends\" real,\n \"transfer_fee\" text\n);\n\nQuestion: What are the goals for Pelletieri in ARG?"
},
{
"role": "assistant",
"content": "SELECT \"goals_l_c_e\" FROM \"squad_information\" WHERE \"nat\"='arg' AND \"name\"='pelletieri';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"squad_information\" (\n \"nat\" text,\n \"name\" text,\n \"since\" text,\n \"app_l_c_e\" text,\n \"goals_l_c_e\" text,\n \"ends\" real,\n \"transfer_fee\" text\n);\n\nQuestion: What are the fewest ends with an App(L/C/E) of 51 (44/6/1)?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"ends\") FROM \"squad_information\" WHERE \"app_l_c_e\"='51 (44/6/1)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"squad_information\" (\n \"nat\" text,\n \"name\" text,\n \"since\" text,\n \"app_l_c_e\" text,\n \"goals_l_c_e\" text,\n \"ends\" real,\n \"transfer_fee\" text\n);\n\nQuestion: Who has a nationality of GRE and an App(L/C/E) of 49 (40/8/1)?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"squad_information\" WHERE \"nat\"='gre' AND \"app_l_c_e\"='49 (40/8/1)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"squad_information\" (\n \"nat\" text,\n \"name\" text,\n \"since\" text,\n \"app_l_c_e\" text,\n \"goals_l_c_e\" text,\n \"ends\" real,\n \"transfer_fee\" text\n);\n\nQuestion: What are the gaols(L/C/E) with an App(L/C/E) of 55 (47/5/3)?"
},
{
"role": "assistant",
"content": "SELECT \"goals_l_c_e\" FROM \"squad_information\" WHERE \"app_l_c_e\"='55 (47/5/3)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"previous_winners\" (\n \"year\" real,\n \"best_teenage_young_adult\" text,\n \"reader_s_vote\" text,\n \"best_non_fiction\" text,\n \"lifetime_achievement\" text\n);\n\nQuestion: How many times was the reader's vote na and the lifetime achievement na?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year\") FROM \"previous_winners\" WHERE \"reader_s_vote\"='na' AND \"lifetime_achievement\"='na';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"previous_winners\" (\n \"year\" real,\n \"best_teenage_young_adult\" text,\n \"reader_s_vote\" text,\n \"best_non_fiction\" text,\n \"lifetime_achievement\" text\n);\n\nQuestion: who won the lifetime achievement in the year 1998?"
},
{
"role": "assistant",
"content": "SELECT \"lifetime_achievement\" FROM \"previous_winners\" WHERE \"year\"=1998;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"previous_winners\" (\n \"year\" real,\n \"best_teenage_young_adult\" text,\n \"reader_s_vote\" text,\n \"best_non_fiction\" text,\n \"lifetime_achievement\" text\n);\n\nQuestion: who won the lifetime achievement when the best non-fiction is na, reader's vote is ne and the year is after 2005?"
},
{
"role": "assistant",
"content": "SELECT \"lifetime_achievement\" FROM \"previous_winners\" WHERE \"best_non_fiction\"='na' AND \"reader_s_vote\"='na' AND \"year\">2005;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"previous_winners\" (\n \"year\" real,\n \"best_teenage_young_adult\" text,\n \"reader_s_vote\" text,\n \"best_non_fiction\" text,\n \"lifetime_achievement\" text\n);\n\nQuestion: what is the reader's vote for 2011?"
},
{
"role": "assistant",
"content": "SELECT \"reader_s_vote\" FROM \"previous_winners\" WHERE \"year\"=2011;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying\" (\n \"driver\" text,\n \"constructor\" text,\n \"q1_order\" real,\n \"q1_time\" text,\n \"q1_pos\" real,\n \"q1_q2_time\" text\n);\n\nQuestion: Constructor with total time of 2:45.416"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"qualifying\" WHERE \"q1_q2_time\"='2:45.416';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying\" (\n \"driver\" text,\n \"constructor\" text,\n \"q1_order\" real,\n \"q1_time\" text,\n \"q1_pos\" real,\n \"q1_q2_time\" text\n);\n\nQuestion: Driver at larger than 10 with a Q1 of 18."
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"qualifying\" WHERE \"q1_order\">10 AND \"q1_pos\"=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 \"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 the record was 55-14?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='55-14';"
}
] |
[
{
"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 game number when record is 59-15?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"game\") FROM \"game_log\" WHERE \"record\"='59-15';"
}
] |
[
{
"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 is the date that the record was 51-14?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"game_log\" WHERE \"record\"='51-14';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_five\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the sum of Pick #, when College is Laurier?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"pick_num\") FROM \"round_five\" WHERE \"college\"='laurier';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_five\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is CFL Team, when Pick # is greater than 34, and when College is Boise State?"
},
{
"role": "assistant",
"content": "SELECT \"cfl_team\" FROM \"round_five\" WHERE \"pick_num\">34 AND \"college\"='boise state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_five\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the lowest Pick #, when Position is REC, and when CFL Team is Hamilton Tiger-Cats?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"pick_num\") FROM \"round_five\" WHERE \"position\"='rec' AND \"cfl_team\"='hamilton tiger-cats';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_five\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is Player, when Position is DB, and when College is Saint Mary's?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"round_five\" WHERE \"position\"='db' AND \"college\"='saint mary''s';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_five\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is Position, when Pick # is less than 40, and when College is Western?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"round_five\" WHERE \"pick_num\"<40 AND \"college\"='western';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_e\" (\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: Which Date has a Time of 12:00?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"pool_e\" WHERE \"time\"='12:00';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_e\" (\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: Set 1 of 25\u201320, what was Set 2?"
},
{
"role": "assistant",
"content": "SELECT \"set_2\" FROM \"pool_e\" WHERE \"set_1\"='25\u201320';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_state_leaders_in_the_20th_centur\" (\n \"type\" text,\n \"name\" text,\n \"title\" text,\n \"royal_house\" text,\n \"from\" text\n);\n\nQuestion: Whose rule began in 1906 BC?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"list_of_state_leaders_in_the_20th_centur\" WHERE \"from\"='1906 bc';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_state_leaders_in_the_20th_centur\" (\n \"type\" text,\n \"name\" text,\n \"title\" text,\n \"royal_house\" text,\n \"from\" text\n);\n\nQuestion: What is the title of the one who ruled from 2007 BC?"
},
{
"role": "assistant",
"content": "SELECT \"title\" FROM \"list_of_state_leaders_in_the_20th_centur\" WHERE \"from\"='2007 bc';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_state_leaders_in_the_20th_centur\" (\n \"type\" text,\n \"name\" text,\n \"title\" text,\n \"royal_house\" text,\n \"from\" text\n);\n\nQuestion: What is the name of the ruler whose rule began in 1924 BC?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"list_of_state_leaders_in_the_20th_centur\" WHERE \"from\"='1924 bc';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_state_leaders_in_the_20th_centur\" (\n \"type\" text,\n \"name\" text,\n \"title\" text,\n \"royal_house\" text,\n \"from\" text\n);\n\nQuestion: What royal house did Shaokang belong to?"
},
{
"role": "assistant",
"content": "SELECT \"royal_house\" FROM \"list_of_state_leaders_in_the_20th_centur\" WHERE \"name\"='shaokang';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tallest_buildings\" (\n \"rank\" real,\n \"name\" text,\n \"height_ft_m\" text,\n \"floors\" real,\n \"year\" real\n);\n\nQuestion: What is the highest rank of a building erected in 1976 with fewer than 21 floors?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"tallest_buildings\" WHERE \"year\"=1976 AND \"floors\"<21;"
}
] |
[
{
"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 \"february\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text\n);\n\nQuestion: What team was the opponent when February shows more than 2, with a game number less than 55?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule_and_results\" WHERE \"february\">2 AND \"game\"<55;"
}
] |
[
{
"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 \"february\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text\n);\n\nQuestion: What is the game number when the Toronto Maple Leafs were the opponent, and the February was less than 17?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"game\") FROM \"schedule_and_results\" WHERE \"opponent\"='toronto maple leafs' AND \"february\"<17;"
}
] |
[
{
"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 \"february\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text\n);\n\nQuestion: What is the number of the game when the opponent was the New York Islanders, and a February less than 24?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"game\") FROM \"schedule_and_results\" WHERE \"opponent\"='new york islanders' AND \"february\"<24;"
}
] |
[
{
"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 \"february\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text\n);\n\nQuestion: What is the lowest game number when the record was 26-24-9?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"game\") FROM \"schedule_and_results\" WHERE \"record\"='26-24-9';"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What rank has less than 16 gold, more than 2 bronze and silver, and a total of 14?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"medal_table\" WHERE \"gold\"<16 AND \"bronze\">2 AND \"silver\">2 AND \"total\"=14;"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the silver for rank 1 with less than 2 bronze?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"silver\") FROM \"medal_table\" WHERE \"rank\"='1' AND \"bronze\"<2;"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the lowest total when there's less than 16 bronze and more than 6 silver?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"medal_table\" WHERE \"bronze\"<16 AND \"silver\">6;"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the lowest gold with a total over 15 and less than 16 silver?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"gold\") FROM \"medal_table\" WHERE \"total\">15 AND \"silver\"<16;"
}
] |
[
{
"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: Which Gold has a Rank of 7, a Nation of italy, and a Silver smaller than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medal_table\" WHERE \"rank\"='7' AND \"nation\"='italy' AND \"silver\"<0;"
}
] |
[
{
"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: Which Gold has a Total larger than 3, a Rank of total, and a Silver larger than 8?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"gold\") FROM \"medal_table\" WHERE \"total\">3 AND \"rank\"='total' AND \"silver\">8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"nationality\" text,\n \"club_team\" text\n);\n\nQuestion: Which Club team has a Pick larger than 139?"
},
{
"role": "assistant",
"content": "SELECT \"club_team\" FROM \"draft_picks\" WHERE \"pick\">139;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"nationality\" text,\n \"club_team\" text\n);\n\nQuestion: Which Nationality has a Pick larger than 109, and a Round smaller than 5?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"draft_picks\" WHERE \"pick\">109 AND \"round\"<5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"r\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_grizzlies\" text,\n \"school_club_team\" text\n);\n\nQuestion: Which school was Lawrence Roberts from ?"
},
{
"role": "assistant",
"content": "SELECT \"school_club_team\" FROM \"r\" WHERE \"player\"='lawrence roberts';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"r\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_grizzlies\" text,\n \"school_club_team\" text\n);\n\nQuestion: Which school was Chris Robinson from?"
},
{
"role": "assistant",
"content": "SELECT \"school_club_team\" FROM \"r\" WHERE \"player\"='chris robinson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"r\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_grizzlies\" text,\n \"school_club_team\" text\n);\n\nQuestion: What was the position that Chris Robinson played?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"r\" WHERE \"player\"='chris robinson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"r\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_grizzlies\" text,\n \"school_club_team\" text\n);\n\nQuestion: In which years did Zach Randolph play for the Grizzlies?"
},
{
"role": "assistant",
"content": "SELECT \"years_for_grizzlies\" FROM \"r\" WHERE \"player\"='zach randolph';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"r\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_grizzlies\" text,\n \"school_club_team\" text\n);\n\nQuestion: Which player played for Western Kentucky?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"r\" WHERE \"school_club_team\"='western kentucky';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What was the score on January 14 when the Chicago Black Hawks were home against the New York Rangers?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"regular_season\" WHERE \"home\"='chicago black hawks' AND \"visitor\"='new york rangers' AND \"date\"='january 14';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: Who was the home team on February 18 that had a visitor of the Chicago Black Hawks?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"regular_season\" WHERE \"visitor\"='chicago black hawks' AND \"date\"='february 18';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_4\" (\n \"team\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_diff\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"points_diff\" text\n);\n\nQuestion: What is points diff when points against is 123?"
},
{
"role": "assistant",
"content": "SELECT \"points_diff\" FROM \"pool_4\" WHERE \"points_against\"='123';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_4\" (\n \"team\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_diff\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"points_diff\" text\n);\n\nQuestion: Which team has 123 points agaibst the other team?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"pool_4\" WHERE \"points_against\"='123';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_4\" (\n \"team\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_diff\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"points_diff\" text\n);\n\nQuestion: What is the points against when try diff is +23?"
},
{
"role": "assistant",
"content": "SELECT \"points_against\" FROM \"pool_4\" WHERE \"try_diff\"='+23';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_4\" (\n \"team\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_diff\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"points_diff\" text\n);\n\nQuestion: What is points when try diff is +23?"
},
{
"role": "assistant",
"content": "SELECT \"points_for\" FROM \"pool_4\" WHERE \"try_diff\"='+23';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pool_4\" (\n \"team\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_diff\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"points_diff\" text\n);\n\nQuestion: What is points sgsinst when points diff is +96?"
},
{
"role": "assistant",
"content": "SELECT \"points_against\" FROM \"pool_4\" WHERE \"points_diff\"='+96';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: How many laps led when the Grid was 15?"
},
{
"role": "assistant",
"content": "SELECT \"laps_led\" FROM \"classification\" WHERE \"grid\"='15';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: Name the Time/Retired when the points were 32."
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"points\"='32';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: What car number had 24 points?"
},
{
"role": "assistant",
"content": "SELECT \"car_no\" FROM \"classification\" WHERE \"points\"='24';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: What team does Dan Wheldon drive for when he led 0 laps?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"classification\" WHERE \"laps_led\"='0' AND \"driver\"='dan wheldon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: How many points when the Grid was 1?"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"classification\" WHERE \"grid\"='1';"
}
] |
[
{
"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: What is the average game number that was on october 19?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"game\") FROM \"schedule_and_results\" WHERE \"october\"=19;"
}
] |
[
{
"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: What is the sum of October, when Opponent is \"Pittsburgh Penguins\"?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"october\") FROM \"schedule_and_results\" WHERE \"opponent\"='pittsburgh penguins';"
}
] |
[
{
"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: What is the sum of Game, when Record is \"2-1-1\", and when October is less than 21?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"game\") FROM \"schedule_and_results\" WHERE \"record\"='2-1-1' AND \"october\"<21;"
}
] |
[
{
"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: What is Opponent, when October is less than 31, and when Game is greater than 7?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule_and_results\" WHERE \"october\"<31 AND \"game\">7;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_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 tie number for the home team Orient?"
},
{
"role": "assistant",
"content": "SELECT \"tie_no\" FROM \"third_round_proper\" WHERE \"home_team\"='orient';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_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 away team Chelsea?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"third_round_proper\" WHERE \"away_team\"='chelsea';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_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 away team for the tie no. 29?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"third_round_proper\" WHERE \"tie_no\"='29';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"demography\" (\n \"religion\" text,\n \"suriname\" text,\n \"paramaribo\" text,\n \"wanica\" text,\n \"nickerie\" text,\n \"coronie\" text,\n \"saramacca\" text,\n \"commewijne\" text,\n \"marowijne\" text,\n \"para\" text,\n \"brokopondo\" text,\n \"sipaliwini\" text\n);\n\nQuestion: What is the coronie with a 0.7% nickerie?"
},
{
"role": "assistant",
"content": "SELECT \"coronie\" FROM \"demography\" WHERE \"nickerie\"='0.7%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"demography\" (\n \"religion\" text,\n \"suriname\" text,\n \"paramaribo\" text,\n \"wanica\" text,\n \"nickerie\" text,\n \"coronie\" text,\n \"saramacca\" text,\n \"commewijne\" text,\n \"marowijne\" text,\n \"para\" text,\n \"brokopondo\" text,\n \"sipaliwini\" text\n);\n\nQuestion: What is the marowijne with an 18.8% saramacca?"
},
{
"role": "assistant",
"content": "SELECT \"marowijne\" FROM \"demography\" WHERE \"saramacca\"='18.8%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"demography\" (\n \"religion\" text,\n \"suriname\" text,\n \"paramaribo\" text,\n \"wanica\" text,\n \"nickerie\" text,\n \"coronie\" text,\n \"saramacca\" text,\n \"commewijne\" text,\n \"marowijne\" text,\n \"para\" text,\n \"brokopondo\" text,\n \"sipaliwini\" text\n);\n\nQuestion: What is the para with a 0.1% sipaliwini?"
},
{
"role": "assistant",
"content": "SELECT \"para\" FROM \"demography\" WHERE \"sipaliwini\"='0.1%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"demography\" (\n \"religion\" text,\n \"suriname\" text,\n \"paramaribo\" text,\n \"wanica\" text,\n \"nickerie\" text,\n \"coronie\" text,\n \"saramacca\" text,\n \"commewijne\" text,\n \"marowijne\" text,\n \"para\" text,\n \"brokopondo\" text,\n \"sipaliwini\" text\n);\n\nQuestion: What religion has a para of 56.5%?"
},
{
"role": "assistant",
"content": "SELECT \"religion\" FROM \"demography\" WHERE \"para\"='56.5%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"demography\" (\n \"religion\" text,\n \"suriname\" text,\n \"paramaribo\" text,\n \"wanica\" text,\n \"nickerie\" text,\n \"coronie\" text,\n \"saramacca\" text,\n \"commewijne\" text,\n \"marowijne\" text,\n \"para\" text,\n \"brokopondo\" text,\n \"sipaliwini\" text\n);\n\nQuestion: What is the suriname with a 16.8% brokopondo?"
},
{
"role": "assistant",
"content": "SELECT \"suriname\" FROM \"demography\" WHERE \"brokopondo\"='16.8%';"
}
] |
[
{
"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: What's the rank average when the gold medals are less than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"medal_table\" WHERE \"gold\"<0;"
}
] |
[
{
"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: What is the total rank of Hungary (HUN) when the bronze medals were less than 0?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"rank\") FROM \"medal_table\" WHERE \"nation\"='hungary (hun)' AND \"bronze\"<0;"
}
] |
[
{
"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: What is the sum of the total number of medals when silver is less than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") 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 \"1939_1943\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is Born-Died, when Term Start is 4 December 1941?"
},
{
"role": "assistant",
"content": "SELECT \"born_died\" FROM \"1939_1943\" WHERE \"term_start\"='4 december 1941';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1939_1943\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is Term Start, when Name is Prime Ministers 1939 - 1943?"
},
{
"role": "assistant",
"content": "SELECT \"term_start\" FROM \"1939_1943\" WHERE \"name\"='prime ministers 1939 - 1943';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1939_1943\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is Born-Died, when Name is Maliq Bushati?"
},
{
"role": "assistant",
"content": "SELECT \"born_died\" FROM \"1939_1943\" WHERE \"name\"='maliq bushati';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1939_1943\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is Term End, when Political Party is Albanian Fascist Party, and when Term Start is 12 April 1939?"
},
{
"role": "assistant",
"content": "SELECT \"term_end\" FROM \"1939_1943\" WHERE \"political_party\"='albanian fascist party' AND \"term_start\"='12 april 1939';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1939_1943\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is Term Start, when Born-Died is Prime Ministers 1939 - 1943?"
},
{
"role": "assistant",
"content": "SELECT \"term_start\" FROM \"1939_1943\" WHERE \"born_died\"='prime ministers 1939 - 1943';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1939_1943\" (\n \"name\" text,\n \"born_died\" text,\n \"term_start\" text,\n \"term_end\" text,\n \"political_party\" text\n);\n\nQuestion: What is Born-Died, when Term End is 19 January 1943?"
},
{
"role": "assistant",
"content": "SELECT \"born_died\" FROM \"1939_1943\" WHERE \"term_end\"='19 january 1943';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Score of the game with a Record of 5\u20134\u20133?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"regular_season\" WHERE \"record\"='5\u20134\u20133';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Score on January 23?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"regular_season\" WHERE \"date\"='january 23';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Visitor of the Montreal Canadiens Home game with a Record of 6\u20134\u20134?"
},
{
"role": "assistant",
"content": "SELECT \"visitor\" FROM \"regular_season\" WHERE \"home\"='montreal canadiens' AND \"record\"='6\u20134\u20134';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Date of the game with a Record of 12\u20137\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"regular_season\" WHERE \"record\"='12\u20137\u20136';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Record of the Montreal Canadiens Home game on March 23?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"regular_season\" WHERE \"home\"='montreal canadiens' AND \"date\"='march 23';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"dates\" text,\n \"champion\" text,\n \"country\" text,\n \"winning_score\" text,\n \"to_par\" text,\n \"margin_of_victory\" text,\n \"tournament_location\" text,\n \"purse\" text,\n \"winner_s_share\" text\n);\n\nQuestion: What tournament location has 1 stroke as the margin of victory, with 1,200,000 as the purse ($)?"
},
{
"role": "assistant",
"content": "SELECT \"tournament_location\" FROM \"winners\" WHERE \"margin_of_victory\"='1 stroke' AND \"purse\"='1,200,000';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"dates\" text,\n \"champion\" text,\n \"country\" text,\n \"winning_score\" text,\n \"to_par\" text,\n \"margin_of_victory\" text,\n \"tournament_location\" text,\n \"purse\" text,\n \"winner_s_share\" text\n);\n\nQuestion: What tournament location has south korea as the country?"
},
{
"role": "assistant",
"content": "SELECT \"tournament_location\" FROM \"winners\" WHERE \"country\"='south korea';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ranking\" (\n \"country\" text,\n \"population_july_2005_est\" real,\n \"land_area_km\" real,\n \"pct_of_arable_land_2005_est\" text,\n \"arable_land_km\" real,\n \"population_density_pop_per_km\" real\n);\n\nQuestion: What is the total population of American Samoa (US) that has less than 16,280 km\u00b2 arable land, less than 240 km\u00b2 land area, and has a population density of more than 291?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"population_july_2005_est\") FROM \"ranking\" WHERE \"arable_land_km\"<'16,280' AND \"land_area_km\"<240 AND \"country\"='american samoa (us)' AND \"population_density_pop_per_km\">291;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ranking\" (\n \"country\" text,\n \"population_july_2005_est\" real,\n \"land_area_km\" real,\n \"pct_of_arable_land_2005_est\" text,\n \"arable_land_km\" real,\n \"population_density_pop_per_km\" real\n);\n\nQuestion: What's the arable land for the population of 20,090,437?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"arable_land_km\") FROM \"ranking\" WHERE \"population_july_2005_est\"='20,090,437';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ranking\" (\n \"country\" text,\n \"population_july_2005_est\" real,\n \"land_area_km\" real,\n \"pct_of_arable_land_2005_est\" text,\n \"arable_land_km\" real,\n \"population_density_pop_per_km\" real\n);\n\nQuestion: What is the land area of Switzerland with a population density fewer than 188 km\u00b2?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"land_area_km\") FROM \"ranking\" WHERE \"country\"='switzerland' AND \"population_density_pop_per_km\"<188;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ranking\" (\n \"country\" text,\n \"population_july_2005_est\" real,\n \"land_area_km\" real,\n \"pct_of_arable_land_2005_est\" text,\n \"arable_land_km\" real,\n \"population_density_pop_per_km\" real\n);\n\nQuestion: What's the population density of the Democratic Republic of the Congo when the population is greater than 37,762,842, and the arable land is more than 200 km\u00b2?"
},
{
"role": "assistant",
"content": "SELECT \"population_density_pop_per_km\" FROM \"ranking\" WHERE \"population_july_2005_est\">'37,762,842' AND \"arable_land_km\">200 AND \"country\"='democratic republic of the congo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: What lost has 86 points?"
},
{
"role": "assistant",
"content": "SELECT \"lost\" FROM \"league_table\" WHERE \"points\"='86';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: With 37 tries against, what is the try bonus?"
},
{
"role": "assistant",
"content": "SELECT \"try_bonus\" FROM \"league_table\" WHERE \"tries_against\"='37';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many points against when 41 is the tries for?"
},
{
"role": "assistant",
"content": "SELECT \"points_against\" FROM \"league_table\" WHERE \"tries_for\"='41';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: With a lost of lost what was the losing bonus?"
},
{
"role": "assistant",
"content": "SELECT \"losing_bonus\" FROM \"league_table\" WHERE \"lost\"='lost';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: What points has points for as points for?"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"league_table\" WHERE \"points_for\"='points for';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: What is the points when the club is Barry RFC with a 5 as the try bonus?"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"league_table\" WHERE \"try_bonus\"='5' AND \"club\"='barry rfc';"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of Gold, when Silver is greater than 6, when Rank is 1, and when Bronze is less than 61?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_table\" WHERE \"silver\">6 AND \"rank\"='1' AND \"bronze\"<61;"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest Silver, when Bronze is 1, and when Total is less than 3?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"silver\") FROM \"medal_table\" WHERE \"bronze\"=1 AND \"total\"<3;"
}
] |
[
{
"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 \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average Gold, when Silver is less than 107, when Bronze is greater than 42, and when Rank is 3?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"gold\") FROM \"medal_table\" WHERE \"silver\"<107 AND \"bronze\">42 AND \"rank\"='3';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"moto_gp_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which manufacturer has more than 28 laps and less than 9 grids with jeremy mcwilliams?"
},
{
"role": "assistant",
"content": "SELECT \"manufacturer\" FROM \"moto_gp_classification\" WHERE \"laps\"<28 AND \"grid\"<9 AND \"rider\"='jeremy mcwilliams';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.