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 \"regular_season\" (\n \"game\" real,\n \"january\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: Which January is the lowest one that has an Opponent of florida panthers, and Points smaller than 59?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"january\") FROM \"regular_season\" WHERE \"opponent\"='florida panthers' AND \"points\"<59;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"game\" real,\n \"january\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: Which Record has a Game of 41?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"regular_season\" WHERE \"game\"=41;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"game\" real,\n \"january\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: Which Score has a January larger than 21, and Points of 63?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"regular_season\" WHERE \"january\">21 AND \"points\"=63;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"game\" real,\n \"january\" real,\n \"opponent\" text,\n \"score\" text,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: How many Points have a Record of 25\u201310\u201311, and a January larger than 28?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"points\") FROM \"regular_season\" WHERE \"record\"='25\u201310\u201311' AND \"january\">28;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"former_medical_schools\" (\n \"province\" text,\n \"school\" text,\n \"city\" text,\n \"degree\" text,\n \"established\" real,\n \"closed\" text\n);\n\nQuestion: what province was established in 1870"
},
{
"role": "assistant",
"content": "SELECT \"province\" FROM \"former_medical_schools\" WHERE \"established\"=1870;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ohio\" (\n \"district\" text,\n \"incumbent\" text,\n \"party\" text,\n \"first_elected\" real,\n \"result\" text\n);\n\nQuestion: Who is the Incumbent that has a District of ohio 13 in Democratic Party?"
},
{
"role": "assistant",
"content": "SELECT \"incumbent\" FROM \"ohio\" WHERE \"district\"='ohio 13';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"champion\" text,\n \"runner_up\" text,\n \"score\" text,\n \"surface\" text\n);\n\nQuestion: What is the score of champion Ken Rosewall in 1957?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"champions\" WHERE \"champion\"='ken rosewall' AND \"year\"='1957';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"champion\" text,\n \"runner_up\" text,\n \"score\" text,\n \"surface\" text\n);\n\nQuestion: What is the surface of the match with Brian Gottfried as the runner-up?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"champions\" WHERE \"runner_up\"='brian gottfried';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"champion\" text,\n \"runner_up\" text,\n \"score\" text,\n \"surface\" text\n);\n\nQuestion: What is the score of the match with anders j\u00e4rryd as the runner-up?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"champions\" WHERE \"runner_up\"='anders j\u00e4rryd';"
}
] |
[
{
"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 low bronze total for the team with 4 total and under 1 gold?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"bronze\") FROM \"medal_table\" WHERE \"total\"=4 AND \"gold\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average total for teams with over 3 bronzes and over 8 golds?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"medal_table\" WHERE \"bronze\">3 AND \"gold\">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\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the low silver total associated with under 1 total?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"silver\") FROM \"medal_table\" WHERE \"total\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"top_singles_of_1959\" (\n \"position\" real,\n \"artist\" text,\n \"song_title\" text,\n \"highest_position\" real,\n \"points\" real\n);\n\nQuestion: What is the number of points associated with the highest position under 9 and a current position of 22?"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"top_singles_of_1959\" WHERE \"highest_position\"<9 AND \"position\"=22;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"series_2\" (\n \"date\" text,\n \"episode\" real,\n \"performer_1\" text,\n \"performer_2\" text,\n \"performer_3\" text,\n \"performer_4\" text\n);\n\nQuestion: Performer 3 of paul merton, and a Performer 4 of sandi toksvig is which performer 1?"
},
{
"role": "assistant",
"content": "SELECT \"performer_1\" FROM \"series_2\" WHERE \"performer_3\"='paul merton' AND \"performer_4\"='sandi toksvig';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"series_2\" (\n \"date\" text,\n \"episode\" real,\n \"performer_1\" text,\n \"performer_2\" text,\n \"performer_3\" text,\n \"performer_4\" text\n);\n\nQuestion: Episode of 16 involves which performer 1?"
},
{
"role": "assistant",
"content": "SELECT \"performer_1\" FROM \"series_2\" WHERE \"episode\"=16;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"series_2\" (\n \"date\" text,\n \"episode\" real,\n \"performer_1\" text,\n \"performer_2\" text,\n \"performer_3\" text,\n \"performer_4\" text\n);\n\nQuestion: Performer 2 of compilation 1 had what performer 1?"
},
{
"role": "assistant",
"content": "SELECT \"performer_1\" FROM \"series_2\" WHERE \"performer_2\"='compilation 1';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bavarian_cup_era\" (\n \"season\" real,\n \"oberbayern\" text,\n \"niederbayern\" text,\n \"schwaben\" text,\n \"mittelfranken\" text\n);\n\nQuestion: Which Schwaben has an Oberbayern of fc ingolstadt 04 and a Mittelfranken of sv seligenporten"
},
{
"role": "assistant",
"content": "SELECT \"schwaben\" FROM \"bavarian_cup_era\" WHERE \"oberbayern\"='fc ingolstadt 04' AND \"mittelfranken\"='sv seligenporten';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bavarian_cup_era\" (\n \"season\" real,\n \"oberbayern\" text,\n \"niederbayern\" text,\n \"schwaben\" text,\n \"mittelfranken\" text\n);\n\nQuestion: Which Schwaben has a Oberbayern of fc bayern munich ii and a Mittelfranken of 1. fc nuremberg ii?"
},
{
"role": "assistant",
"content": "SELECT \"schwaben\" FROM \"bavarian_cup_era\" WHERE \"oberbayern\"='fc bayern munich ii' AND \"mittelfranken\"='1. fc nuremberg ii';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_carolina\" (\n \"district\" text,\n \"incumbent\" text,\n \"party\" text,\n \"first_elected\" text,\n \"result\" text\n);\n\nQuestion: Who was the incumbent for south carolina 3 district?"
},
{
"role": "assistant",
"content": "SELECT \"incumbent\" FROM \"south_carolina\" WHERE \"district\"='south carolina 3';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_carolina\" (\n \"district\" text,\n \"incumbent\" text,\n \"party\" text,\n \"first_elected\" text,\n \"result\" text\n);\n\nQuestion: When was the incumbent from the south carolina 1 district first elected?"
},
{
"role": "assistant",
"content": "SELECT \"first_elected\" FROM \"south_carolina\" WHERE \"district\"='south carolina 1';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_carolina\" (\n \"district\" text,\n \"incumbent\" text,\n \"party\" text,\n \"first_elected\" text,\n \"result\" text\n);\n\nQuestion: Who was the incumbent that was first elected in 1892 and retired to run for the senate democratic hold?"
},
{
"role": "assistant",
"content": "SELECT \"incumbent\" FROM \"south_carolina\" WHERE \"first_elected\"='1892' AND \"result\"='retired to run for the senate democratic hold';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_carolina\" (\n \"district\" text,\n \"incumbent\" text,\n \"party\" text,\n \"first_elected\" text,\n \"result\" text\n);\n\nQuestion: Who was the incumbent that retired to run for the senate democratic hold?"
},
{
"role": "assistant",
"content": "SELECT \"incumbent\" FROM \"south_carolina\" WHERE \"result\"='retired to run for the senate democratic hold';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_carolina\" (\n \"district\" text,\n \"incumbent\" text,\n \"party\" text,\n \"first_elected\" text,\n \"result\" text\n);\n\nQuestion: What was the result of W. Jasper Talbert who was first elected in 1892?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"south_carolina\" WHERE \"first_elected\"='1892' AND \"incumbent\"='w. jasper talbert';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final\" (\n \"athlete\" text,\n \"nationality\" text,\n \"2_15\" text,\n \"2_20\" text,\n \"2_24\" text,\n \"2_27\" text,\n \"result\" real\n);\n\nQuestion: Which Nationality has a 2.24 of xo, and a 2.20 of xo?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"final\" WHERE \"2_24\"='xo' AND \"2_20\"='xo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final\" (\n \"athlete\" text,\n \"nationality\" text,\n \"2_15\" text,\n \"2_20\" text,\n \"2_24\" text,\n \"2_27\" text,\n \"result\" real\n);\n\nQuestion: Which Athlete has a 2.24 of xo, and a 2.20 of o, and a 2.15 of o?"
},
{
"role": "assistant",
"content": "SELECT \"athlete\" FROM \"final\" WHERE \"2_24\"='xo' AND \"2_20\"='o' AND \"2_15\"='o';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"election_results\" (\n \"election\" real,\n \"num_of_candidates_nominated\" real,\n \"num_of_seats_won\" real,\n \"num_of_total_votes\" real,\n \"pct_of_popular_vote\" text\n);\n\nQuestion: What is the earliest election with more than 7 candidates nominated, a percentage of the popular vote of 2.75%, and 0 seats won?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"election\") FROM \"election_results\" WHERE \"num_of_candidates_nominated\">7 AND \"pct_of_popular_vote\"='2.75%' AND \"num_of_seats_won\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_brasileiro_s_rie_a\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: How much Played has a Lost larger than 14, and Drawn of 8, and a Team of ipatinga?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"played\") FROM \"campeonato_brasileiro_s_rie_a\" WHERE \"lost\">14 AND \"drawn\"=8 AND \"team\"='ipatinga';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_brasileiro_s_rie_a\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: How many Drawn have a Difference of 3, and Points smaller than 52?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"drawn\") FROM \"campeonato_brasileiro_s_rie_a\" WHERE \"difference\"='3' AND \"points\"<52;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_brasileiro_s_rie_a\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: Which Points is the highest one that has a Position smaller than 4, and a Team of s\u00e3o paulo, and Drawn larger than 12?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"points\") FROM \"campeonato_brasileiro_s_rie_a\" WHERE \"position\"<4 AND \"team\"='s\u00e3o paulo' AND \"drawn\">12;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_brasileiro_s_rie_a\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: How many Lost have Points larger than 40, and a Position of 11, and a Played smaller than 38?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"lost\") FROM \"campeonato_brasileiro_s_rie_a\" WHERE \"points\">40 AND \"position\"=11 AND \"played\"<38;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_group_c_bulgaria\" (\n \"games\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points_difference\" text,\n \"points\" real\n);\n\nQuestion: What is the lowest number of games loss with a Points difference of 40 - 17, and over 6 games?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"lost\") FROM \"world_championship_group_c_bulgaria\" WHERE \"points_difference\"='40 - 17' AND \"games\">6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_group_c_bulgaria\" (\n \"games\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points_difference\" text,\n \"points\" real\n);\n\nQuestion: How many games lost for teams with over 6 games?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"lost\") FROM \"world_championship_group_c_bulgaria\" WHERE \"games\">6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_group_c_bulgaria\" (\n \"games\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points_difference\" text,\n \"points\" real\n);\n\nQuestion: What are the highest number of games drawn for games numbered under 6?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"drawn\") FROM \"world_championship_group_c_bulgaria\" WHERE \"games\"<6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_group_c_bulgaria\" (\n \"games\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points_difference\" text,\n \"points\" real\n);\n\nQuestion: How many games drawn with a Points difference of 31 - 33, and under 4 games lost?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"drawn\") FROM \"world_championship_group_c_bulgaria\" WHERE \"points_difference\"='31 - 33' AND \"lost\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"itf_singles_finals\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Outcome has a Surface of hard (i), and a Date of 28 january 2003?"
},
{
"role": "assistant",
"content": "SELECT \"outcome\" FROM \"itf_singles_finals\" WHERE \"surface\"='hard (i)' AND \"date\"='28 january 2003';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"itf_singles_finals\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Tournament has an Outcome of winner, and a Surface of hard (i)?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"itf_singles_finals\" WHERE \"outcome\"='winner' AND \"surface\"='hard (i)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"itf_singles_finals\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Date has a Score of 6\u20131, 6\u20132?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"itf_singles_finals\" WHERE \"score\"='6\u20131, 6\u20132';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"itf_singles_finals\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Surface has an Opponent of oleksandra kravets?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"itf_singles_finals\" WHERE \"opponent\"='oleksandra kravets';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"itf_singles_finals\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Surface has a Date of 3 october 2003?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"itf_singles_finals\" WHERE \"date\"='3 october 2003';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"itf_singles_finals\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Surface has a Score of 6\u20134, 6\u20132?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"itf_singles_finals\" WHERE \"score\"='6\u20134, 6\u20132';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_preliminary_statistics\" (\n \"rank\" real,\n \"airport\" text,\n \"code_iata_icao\" text,\n \"total_cargo_metric_tonnes\" real,\n \"pct_change\" text\n);\n\nQuestion: Which Rank is the lowest one that has a % Change of 3.3%, and a Total Cargo (Metric Tonnes) smaller than 2,456,724?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rank\") FROM \"2012_preliminary_statistics\" WHERE \"pct_change\"='3.3%' AND \"total_cargo_metric_tonnes\"<'2,456,724';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_preliminary_statistics\" (\n \"rank\" real,\n \"airport\" text,\n \"code_iata_icao\" text,\n \"total_cargo_metric_tonnes\" real,\n \"pct_change\" text\n);\n\nQuestion: How many ranks have a Code (IATA/ICAO) of ord/kord?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"2012_preliminary_statistics\" WHERE \"code_iata_icao\"='ord/kord';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_preliminary_statistics\" (\n \"rank\" real,\n \"airport\" text,\n \"code_iata_icao\" text,\n \"total_cargo_metric_tonnes\" real,\n \"pct_change\" text\n);\n\nQuestion: Which Total Cargo (Metric Tonnes) is the highest one that has a Rank smaller than 4, and an Airport of shanghai pudong international airport?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"total_cargo_metric_tonnes\") FROM \"2012_preliminary_statistics\" WHERE \"rank\"<4 AND \"airport\"='shanghai pudong international airport';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_preliminary_statistics\" (\n \"rank\" real,\n \"airport\" text,\n \"code_iata_icao\" text,\n \"total_cargo_metric_tonnes\" real,\n \"pct_change\" text\n);\n\nQuestion: Which Rank is the average one that has a % Change of 0.7%, and a Total Cargo (Metric Tonnes) smaller than 1,556,203?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"2012_preliminary_statistics\" WHERE \"pct_change\"='0.7%' AND \"total_cargo_metric_tonnes\"<'1,556,203';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"louisiana_parishes_ranked_by_per_capita_\" (\n \"parish\" text,\n \"per_capita_income\" text,\n \"median_household_income\" text,\n \"median_family_income\" text,\n \"population\" real,\n \"number_of_households\" real\n);\n\nQuestion: What is the Per capita income where Median family income is $72,288?"
},
{
"role": "assistant",
"content": "SELECT \"per_capita_income\" FROM \"louisiana_parishes_ranked_by_per_capita_\" WHERE \"median_family_income\"='$72,288';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"team\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the average grid for the +2.2 secs time/retired?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"grid\") FROM \"race\" WHERE \"time_retired\"='+2.2 secs';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"facility_id\" real,\n \"erp_power_w\" real,\n \"height_m_ft\" text,\n \"class\" text\n);\n\nQuestion: Which Facility ID has a City of license of springfield, ma, and a ERP / Power W smaller than 230?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"facility_id\") FROM \"stations\" WHERE \"city_of_license\"='springfield, ma' AND \"erp_power_w\"<230;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"facility_id\" real,\n \"erp_power_w\" real,\n \"height_m_ft\" text,\n \"class\" text\n);\n\nQuestion: Which Frequency has a Facility ID of 13598?"
},
{
"role": "assistant",
"content": "SELECT \"frequency\" FROM \"stations\" WHERE \"facility_id\"=13598;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"facility_id\" real,\n \"erp_power_w\" real,\n \"height_m_ft\" text,\n \"class\" text\n);\n\nQuestion: WHich Facility ID has a Call sign of wnpr?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"facility_id\") FROM \"stations\" WHERE \"call_sign\"='wnpr';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"facility_id\" real,\n \"erp_power_w\" real,\n \"height_m_ft\" text,\n \"class\" text\n);\n\nQuestion: Which Frequency has a Facility ID of 13598?"
},
{
"role": "assistant",
"content": "SELECT \"frequency\" FROM \"stations\" WHERE \"facility_id\"=13598;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bischofshofen_6_january\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"1st_m\" real,\n \"2nd_m\" real,\n \"points\" real,\n \"overall_fht_points\" text,\n \"overall_wc_points_rank\" text\n);\n\nQuestion: What is the rank that has a 1st less than 132.5 and a Fin nationality."
},
{
"role": "assistant",
"content": "SELECT \"overall_wc_points_rank\" FROM \"bischofshofen_6_january\" WHERE \"1st_m\"<132.5 AND \"nationality\"='fin';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bischofshofen_6_january\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"1st_m\" real,\n \"2nd_m\" real,\n \"points\" real,\n \"overall_fht_points\" text,\n \"overall_wc_points_rank\" text\n);\n\nQuestion: What is the highest number of points that has a 1st of 121.5?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"points\") FROM \"bischofshofen_6_january\" WHERE \"1st_m\"=121.5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bischofshofen_6_january\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"1st_m\" real,\n \"2nd_m\" real,\n \"points\" real,\n \"overall_fht_points\" text,\n \"overall_wc_points_rank\" text\n);\n\nQuestion: What is the total number of 1sts that Martin Schmitt had where he less than 235.7 points?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"1st_m\") FROM \"bischofshofen_6_january\" WHERE \"name\"='martin schmitt' AND \"points\"<235.7;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"playoffs\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"series\" text\n);\n\nQuestion: What is the total number of attendance for games where buffalo was the home team?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") FROM \"playoffs\" WHERE \"home\"='buffalo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"playoffs\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"series\" text\n);\n\nQuestion: What was the score of the game on April 28 where Buffalo were the visiting team?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"playoffs\" WHERE \"visitor\"='buffalo' AND \"date\"='april 28';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"playoffs\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"series\" text\n);\n\nQuestion: What date was the game where the visiting team was philadelphia?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"playoffs\" WHERE \"visitor\"='philadelphia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"individual\" (\n \"year\" real,\n \"location\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text\n);\n\nQuestion: Who got the gold in seoul before 2002?"
},
{
"role": "assistant",
"content": "SELECT \"gold\" FROM \"individual\" WHERE \"year\"<2002 AND \"location\"='seoul';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"individual\" (\n \"year\" real,\n \"location\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text\n);\n\nQuestion: Where did sohn bong-gak win silver?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"individual\" WHERE \"silver\"='sohn bong-gak';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"individual\" (\n \"year\" real,\n \"location\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text\n);\n\nQuestion: Who won the bronze when jin kanno won the gold?"
},
{
"role": "assistant",
"content": "SELECT \"bronze\" FROM \"individual\" WHERE \"gold\"='jin kanno';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_30_15_15\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Score has an Outcome of runner-up, and a Tournament of johannesburg?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"singles_30_15_15\" WHERE \"outcome\"='runner-up' AND \"tournament\"='johannesburg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_30_15_15\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Surface has an Opponent of kerry melville reid, and a Score of 6\u20133, 2\u20136, 3\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"singles_30_15_15\" WHERE \"opponent\"='kerry melville reid' AND \"score\"='6\u20133, 2\u20136, 3\u20136';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_30_15_15\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Outcome has an Opponent of wendy turnbull, and a Surface of grass?"
},
{
"role": "assistant",
"content": "SELECT \"outcome\" FROM \"singles_30_15_15\" WHERE \"opponent\"='wendy turnbull' AND \"surface\"='grass';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_30_15_15\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Tournament has a Date of 22 january 1979?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"singles_30_15_15\" WHERE \"date\"='22 january 1979';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_30_15_15\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Which Outcome has a Score of 6\u20134, 2\u20136, 6\u20133?"
},
{
"role": "assistant",
"content": "SELECT \"outcome\" FROM \"singles_30_15_15\" WHERE \"score\"='6\u20134, 2\u20136, 6\u20133';"
}
] |
[
{
"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 nation has total medals under 63, less than 2 silver, more than 2 bronze, and a rank of 8?"
},
{
"role": "assistant",
"content": "SELECT \"nation\" FROM \"medal_table\" WHERE \"total\"<63 AND \"silver\"<2 AND \"bronze\">2 AND \"rank\"='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\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many golds have bronze values of 4 and silver values over 2?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medal_table\" WHERE \"bronze\"=4 AND \"silver\">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 \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of silver values that have bronze values under 4, golds over 2, and a rank of 3?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"silver\") FROM \"medal_table\" WHERE \"bronze\"<4 AND \"rank\"='3' AND \"gold\">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 \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of gold values that have bronze values over 0 and totals under 2?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_table\" WHERE \"bronze\">0 AND \"total\"<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 \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the smallest gold value that has a total over 15 and bronze values under 31?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"gold\") FROM \"medal_table\" WHERE \"total\">15 AND \"bronze\"<31;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"other_celestial_bodies\" (\n \"body\" text,\n \"equatorial_diameter\" text,\n \"polar_diameter\" text,\n \"equatorial_bulge\" text,\n \"flattening_ratio\" text\n);\n\nQuestion: What is the Equatorial diameter of the Body: Mars?"
},
{
"role": "assistant",
"content": "SELECT \"equatorial_diameter\" FROM \"other_celestial_bodies\" WHERE \"body\"='mars';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"other_celestial_bodies\" (\n \"body\" text,\n \"equatorial_diameter\" text,\n \"polar_diameter\" text,\n \"equatorial_bulge\" text,\n \"flattening_ratio\" text\n);\n\nQuestion: What is the Equatorial diameter of the Body: ceres?"
},
{
"role": "assistant",
"content": "SELECT \"equatorial_diameter\" FROM \"other_celestial_bodies\" WHERE \"body\"='ceres';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"other_celestial_bodies\" (\n \"body\" text,\n \"equatorial_diameter\" text,\n \"polar_diameter\" text,\n \"equatorial_bulge\" text,\n \"flattening_ratio\" text\n);\n\nQuestion: What is the Flattening ratio associated with the Equatorial diameter of 49,528km?"
},
{
"role": "assistant",
"content": "SELECT \"flattening_ratio\" FROM \"other_celestial_bodies\" WHERE \"equatorial_diameter\"='49,528km';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"other_celestial_bodies\" (\n \"body\" text,\n \"equatorial_diameter\" text,\n \"polar_diameter\" text,\n \"equatorial_bulge\" text,\n \"flattening_ratio\" text\n);\n\nQuestion: What is the Equatorial bulge of the Body: Earth?"
},
{
"role": "assistant",
"content": "SELECT \"equatorial_bulge\" FROM \"other_celestial_bodies\" WHERE \"body\"='earth';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"other_celestial_bodies\" (\n \"body\" text,\n \"equatorial_diameter\" text,\n \"polar_diameter\" text,\n \"equatorial_bulge\" text,\n \"flattening_ratio\" text\n);\n\nQuestion: What is the Flattening ratio associated with the Equatorial diameter of 120,536km?"
},
{
"role": "assistant",
"content": "SELECT \"flattening_ratio\" FROM \"other_celestial_bodies\" WHERE \"equatorial_diameter\"='120,536km';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"other_celestial_bodies\" (\n \"body\" text,\n \"equatorial_diameter\" text,\n \"polar_diameter\" text,\n \"equatorial_bulge\" text,\n \"flattening_ratio\" text\n);\n\nQuestion: What is the Flattening ratio associated with the Equatorial diameter of 12,756.28km?"
},
{
"role": "assistant",
"content": "SELECT \"flattening_ratio\" FROM \"other_celestial_bodies\" WHERE \"equatorial_diameter\"='12,756.28km';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"attempts\" real,\n \"yards\" real,\n \"average\" real,\n \"long\" real,\n \"touchdowns\" real\n);\n\nQuestion: What is the average Yards with an average of less than 4 and the long is 12 with less than 29 attempts?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"yards\") FROM \"rushing\" WHERE \"average\"<4 AND \"long\"=12 AND \"attempts\"<29;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"attempts\" real,\n \"yards\" real,\n \"average\" real,\n \"long\" real,\n \"touchdowns\" real\n);\n\nQuestion: What is the least amount of yards when the average is less than 2.6?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"yards\") FROM \"rushing\" WHERE \"average\"<2.6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"attempts\" real,\n \"yards\" real,\n \"average\" real,\n \"long\" real,\n \"touchdowns\" real\n);\n\nQuestion: What is the lease amount of touchdowns with 1318 yards?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"touchdowns\") FROM \"rushing\" WHERE \"yards\"=1318;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"attempts\" real,\n \"yards\" real,\n \"average\" real,\n \"long\" real,\n \"touchdowns\" real\n);\n\nQuestion: What is the number of touchdowns with the average is less than 2.6?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"touchdowns\") FROM \"rushing\" WHERE \"average\"<2.6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"attempts\" real,\n \"yards\" real,\n \"average\" real,\n \"long\" real,\n \"touchdowns\" real\n);\n\nQuestion: What is the total number for long when there are 19 attempts?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"long\") FROM \"rushing\" WHERE \"attempts\"=19;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_23\" (\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 margin of victory for Olazabal in the German Masters?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"european_tour_wins_23\" WHERE \"tournament\"='german masters';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_23\" (\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 Olazabal's winning score in the event in which Phillip Price finished 2nd?"
},
{
"role": "assistant",
"content": "SELECT \"winning_score\" FROM \"european_tour_wins_23\" WHERE \"runner_s_up\"='phillip price';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_23\" (\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 Olazabal's winning score in the German Masters?"
},
{
"role": "assistant",
"content": "SELECT \"winning_score\" FROM \"european_tour_wins_23\" WHERE \"tournament\"='german masters';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_23\" (\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 Olazabal's margin of victory int he Ebel European Masters Swiss Open?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"european_tour_wins_23\" WHERE \"tournament\"='ebel european masters swiss open';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_16_2010_2011\" (\n \"series_ep\" text,\n \"episode\" real,\n \"netflix\" text,\n \"segment_a\" text,\n \"segment_b\" text,\n \"segment_c\" text,\n \"segment_d\" text\n);\n\nQuestion: Which Series Ep has a Netflix of s08e18?"
},
{
"role": "assistant",
"content": "SELECT \"series_ep\" FROM \"season_16_2010_2011\" WHERE \"netflix\"='s08e18';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_16_2010_2011\" (\n \"series_ep\" text,\n \"episode\" real,\n \"netflix\" text,\n \"segment_a\" text,\n \"segment_b\" text,\n \"segment_c\" text,\n \"segment_d\" text\n);\n\nQuestion: Which Segment B has a Segment D of stone wool insulation?"
},
{
"role": "assistant",
"content": "SELECT \"segment_b\" FROM \"season_16_2010_2011\" WHERE \"segment_d\"='stone wool insulation';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_16_2010_2011\" (\n \"series_ep\" text,\n \"episode\" real,\n \"netflix\" text,\n \"segment_a\" text,\n \"segment_b\" text,\n \"segment_c\" text,\n \"segment_d\" text\n);\n\nQuestion: Which Segment A has a Segment C of poster restoration?"
},
{
"role": "assistant",
"content": "SELECT \"segment_a\" FROM \"season_16_2010_2011\" WHERE \"segment_c\"='poster restoration';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_16_2010_2011\" (\n \"series_ep\" text,\n \"episode\" real,\n \"netflix\" text,\n \"segment_a\" text,\n \"segment_b\" text,\n \"segment_c\" text,\n \"segment_d\" text\n);\n\nQuestion: Which Segment C has a Segment B of fish food?"
},
{
"role": "assistant",
"content": "SELECT \"segment_c\" FROM \"season_16_2010_2011\" WHERE \"segment_b\"='fish food';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_16_2010_2011\" (\n \"series_ep\" text,\n \"episode\" real,\n \"netflix\" text,\n \"segment_a\" text,\n \"segment_b\" text,\n \"segment_c\" text,\n \"segment_d\" text\n);\n\nQuestion: Which Segment C has a Netflix of s08e16?"
},
{
"role": "assistant",
"content": "SELECT \"segment_c\" FROM \"season_16_2010_2011\" WHERE \"netflix\"='s08e16';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"december\" (\n \"date\" real,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" text,\n \"competition\" text\n);\n\nQuestion: What was the name of the competition that had Peterborough Phantoms as an opponent and a date of 2?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"december\" WHERE \"opponent\"='peterborough phantoms' AND \"date\"=2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"single_game\" (\n \"player\" text,\n \"county\" text,\n \"tally\" text,\n \"total\" real,\n \"matches\" real,\n \"average\" real\n);\n\nQuestion: What is the Tally in Kerry County?"
},
{
"role": "assistant",
"content": "SELECT \"tally\" FROM \"single_game\" WHERE \"county\"='kerry';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"single_game\" (\n \"player\" text,\n \"county\" text,\n \"tally\" text,\n \"total\" real,\n \"matches\" real,\n \"average\" real\n);\n\nQuestion: With a Total of less than 29, what is Ian Ryan's most Matches?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"matches\") FROM \"single_game\" WHERE \"player\"='ian ryan' AND \"total\"<29;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"lema_sublema\" text,\n \"candidates\" text,\n \"votes\" real,\n \"ch_of_senators\" text,\n \"ch_of_deputies\" text\n);\n\nQuestion: Which LEMA/SUBLEMA that has Votes smaller than 218656, and a Ch of Deputies of 0?"
},
{
"role": "assistant",
"content": "SELECT \"lema_sublema\" FROM \"results\" WHERE \"votes\"<218656 AND \"ch_of_deputies\"='0';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"lema_sublema\" text,\n \"candidates\" text,\n \"votes\" real,\n \"ch_of_senators\" text,\n \"ch_of_deputies\" text\n);\n\nQuestion: Which LEMA/SUBLEMA has a Ch of Senators of 2?"
},
{
"role": "assistant",
"content": "SELECT \"lema_sublema\" FROM \"results\" WHERE \"ch_of_senators\"='2';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"lema_sublema\" text,\n \"candidates\" text,\n \"votes\" real,\n \"ch_of_senators\" text,\n \"ch_of_deputies\" text\n);\n\nQuestion: Which Ch of Senators has a LEMA/SUBLEMA of lema?"
},
{
"role": "assistant",
"content": "SELECT \"ch_of_senators\" FROM \"results\" WHERE \"lema_sublema\"='lema';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"wins_22\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score_in_the_final\" text\n);\n\nQuestion: what tornament had the scores 6\u20137, 6\u20132, 6\u20134?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"wins_22\" WHERE \"score_in_the_final\"='6\u20137, 6\u20132, 6\u20134';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"wins_22\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score_in_the_final\" text\n);\n\nQuestion: what partner made the scores 6\u20134, 6\u20131?"
},
{
"role": "assistant",
"content": "SELECT \"partner\" FROM \"wins_22\" WHERE \"score_in_the_final\"='6\u20134, 6\u20131';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: What year had 6.62 m in the notes?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"achievements\" WHERE \"notes\"='6.62 m';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: Which competition in Budapest, Hungary gave a result of 8th?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"achievements\" WHERE \"position\"='8th' AND \"venue\"='budapest, hungary';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: Which year did the World indoor championships gave a position of 3rd?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"achievements\" WHERE \"competition\"='world indoor championships' AND \"position\"='3rd';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.