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 \"february\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: Who is the visitor team of the game where Buffalo was the home team?"
},
{
"role": "assistant",
"content": "SELECT \"visitor\" FROM \"february\" WHERE \"home\"='buffalo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What driver has grid number 18?"
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"race\" WHERE \"grid\"=18;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the time or retired time for timo glock with under 70 laps and a grid number greater than 15?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"race\" WHERE \"laps\"<70 AND \"grid\">15 AND \"driver\"='timo glock';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"districts_of_bogor_city\" (\n \"english_name\" text,\n \"original_name\" text,\n \"area_in_km\" real,\n \"population_at_2010_census\" real,\n \"number_of_settlements_and_villages\" real\n);\n\nQuestion: Kecamatan Bogor Timur has more than 6 villages, what is the area in km\u00b2?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"area_in_km\") FROM \"districts_of_bogor_city\" WHERE \"original_name\"='kecamatan bogor timur' AND \"number_of_settlements_and_villages\">6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"districts_of_bogor_city\" (\n \"english_name\" text,\n \"original_name\" text,\n \"area_in_km\" real,\n \"population_at_2010_census\" real,\n \"number_of_settlements_and_villages\" real\n);\n\nQuestion: There are less than 11 settlements in Kecamatan Bogor Tengah, what is the area in km\u00b2?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"area_in_km\") FROM \"districts_of_bogor_city\" WHERE \"original_name\"='kecamatan bogor tengah' AND \"number_of_settlements_and_villages\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_count\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Luxembourg received how many gold medals?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"gold\") FROM \"medal_count\" WHERE \"nation\"='luxembourg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ships_operated_by_zeeland_steamship_comp\" (\n \"ship_s_name\" text,\n \"date_entered_service\" text,\n \"date_withdrawn\" text,\n \"tonnage\" real,\n \"type_of_ship\" text\n);\n\nQuestion: what is the sum of tonnage when the type of ship is twin screw ro-ro motorship and the date entered service is 11 february 1983?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"tonnage\") FROM \"ships_operated_by_zeeland_steamship_comp\" WHERE \"type_of_ship\"='twin screw ro-ro motorship' AND \"date_entered_service\"='11 february 1983';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ships_operated_by_zeeland_steamship_comp\" (\n \"ship_s_name\" text,\n \"date_entered_service\" text,\n \"date_withdrawn\" text,\n \"tonnage\" real,\n \"type_of_ship\" text\n);\n\nQuestion: what is the ships name that is a twin screw ro-ro motorship and entered service on 11 february 1983?"
},
{
"role": "assistant",
"content": "SELECT \"ship_s_name\" FROM \"ships_operated_by_zeeland_steamship_comp\" WHERE \"type_of_ship\"='twin screw ro-ro motorship' AND \"date_entered_service\"='11 february 1983';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ships_operated_by_zeeland_steamship_comp\" (\n \"ship_s_name\" text,\n \"date_entered_service\" text,\n \"date_withdrawn\" text,\n \"tonnage\" real,\n \"type_of_ship\" text\n);\n\nQuestion: what is the least tonnage for the ship(s) that entered service on 11 february 1983?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"tonnage\") FROM \"ships_operated_by_zeeland_steamship_comp\" WHERE \"date_entered_service\"='11 february 1983';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ships_operated_by_zeeland_steamship_comp\" (\n \"ship_s_name\" text,\n \"date_entered_service\" text,\n \"date_withdrawn\" text,\n \"tonnage\" real,\n \"type_of_ship\" text\n);\n\nQuestion: what is the name of the ship that was withdrawn from service on 25 march 1986?"
},
{
"role": "assistant",
"content": "SELECT \"ship_s_name\" FROM \"ships_operated_by_zeeland_steamship_comp\" WHERE \"date_withdrawn\"='25 march 1986';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ships_operated_by_zeeland_steamship_comp\" (\n \"ship_s_name\" text,\n \"date_entered_service\" text,\n \"date_withdrawn\" text,\n \"tonnage\" real,\n \"type_of_ship\" text\n);\n\nQuestion: what is the tonnage of the ship koningin juliana?"
},
{
"role": "assistant",
"content": "SELECT \"tonnage\" FROM \"ships_operated_by_zeeland_steamship_comp\" WHERE \"ship_s_name\"='koningin juliana';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_count\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the sum of gold where silver is more than 2 and the total is 12?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_count\" WHERE \"silver\">2 AND \"total\"=12;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_count\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the lowest gold with a total of 4 and less than 2 silver for liechtenstein?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"gold\") FROM \"medal_count\" WHERE \"total\"=4 AND \"nation\"='liechtenstein' 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_count\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the total number of gold where the total is less than 23 and the rank is over 10?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medal_count\" WHERE \"total\"<23 AND \"rank\">10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_count\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the sum of total where the rank is over 9 and the gold is less than 1?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") FROM \"medal_count\" WHERE \"rank\">9 AND \"gold\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"standings\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"location_attendance\" real,\n \"record\" text\n);\n\nQuestion: What was the attendance number for the Timberwolves game?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"location_attendance\") FROM \"standings\" WHERE \"team\"='timberwolves';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the team score when playing at home with a score of 13.8 (86)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_10\" WHERE \"away_team_score\"='13.8 (86)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What was the smallest crowd at home with a score of 15.8 (98)?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_10\" WHERE \"home_team_score\"='15.8 (98)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the combined of Crowd when richmond played at home?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_10\" WHERE \"home_team\"='richmond';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the team score when playing against an away team with a score of 13.8 (86)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_10\" WHERE \"away_team_score\"='13.8 (86)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_21_5\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: What opponent has a result of 3\u20136, 6\u20132, 4\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"singles_21_5\" WHERE \"result\"='3\u20136, 6\u20132, 4\u20136';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_21_5\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: When was the 1991 world group I with the opponent of Li Fang?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"singles_21_5\" WHERE \"edition\"='1991 world group i' AND \"opponent\"='li fang';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_21_5\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: On July 15, 1984 what surface was used?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"singles_21_5\" WHERE \"date\"='july 15, 1984';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_21_5\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: For what round was the opponent mercedes paz with a result of 4\u20136, 6\u20131, 6\u20133?"
},
{
"role": "assistant",
"content": "SELECT \"round\" FROM \"singles_21_5\" WHERE \"opponent\"='mercedes paz' AND \"result\"='4\u20136, 6\u20131, 6\u20133';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_21_5\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: What surface was used on July 17, 1983?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"singles_21_5\" WHERE \"date\"='july 17, 1983';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_21_5\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: What was the result on October 8, 1985?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"singles_21_5\" WHERE \"date\"='october 8, 1985';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_vancouver_canucks_draft_picks\" (\n \"rd_num\" real,\n \"pick_num\" real,\n \"player\" text,\n \"team_league\" text,\n \"reg_gp\" real,\n \"pl_gp\" real\n);\n\nQuestion: Name the highest pick number for PI GP more than 55"
},
{
"role": "assistant",
"content": "SELECT MAX(\"pick_num\") FROM \"list_of_vancouver_canucks_draft_picks\" WHERE \"pl_gp\">55;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_vancouver_canucks_draft_picks\" (\n \"rd_num\" real,\n \"pick_num\" real,\n \"player\" text,\n \"team_league\" text,\n \"reg_gp\" real,\n \"pl_gp\" real\n);\n\nQuestion: Name the least RD number that has PI GP more than 0 and pick # more than 51"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rd_num\") FROM \"list_of_vancouver_canucks_draft_picks\" WHERE \"pl_gp\">0 AND \"pick_num\">51;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What day did Footscray play as the away team?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_12\" WHERE \"away_team\"='footscray';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What was Hawthorn's away teams opponents score?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_12\" WHERE \"home_team\"='hawthorn';"
}
] |
[
{
"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 attendance of april 17?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"playoffs\" WHERE \"date\"='april 17';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What was the loss of the Mariners game when they had a record of 21-34?"
},
{
"role": "assistant",
"content": "SELECT \"loss\" FROM \"game_log\" WHERE \"record\"='21-34';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who did the Mariners play when they had a record of 33-45?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='33-45';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What was the loss of the Mariners game when they had a record of 22-35?"
},
{
"role": "assistant",
"content": "SELECT \"loss\" FROM \"game_log\" WHERE \"record\"='22-35';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What was the record for the game attended by 35,614 spectators?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"attendance\"='35,614';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the record for April 8?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"date\"='april 8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What was the attendance for the game that has a record of 1-1?"
},
{
"role": "assistant",
"content": "SELECT \"attendance\" FROM \"game_log\" WHERE \"record\"='1-1';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the record for the game with an attendance of 35,305?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"attendance\"='35,305';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the grid when the driver is louis rosier and the laps is more than 78?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"grid\") FROM \"classification\" WHERE \"driver\"='louis rosier' AND \"laps\">78;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the time/retired when the driver is toulo de graffenried?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"driver\"='toulo de graffenried';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the laps when the driver is tony rolt and the grid is less than 10?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"laps\") FROM \"classification\" WHERE \"driver\"='tony rolt' AND \"grid\"<10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the time/retired when the constructor is maserati and the laps is 90?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"constructor\"='maserati' AND \"laps\"=90;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"matches\" (\n \"date\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What is the average Attendance at Venue A on 16 October 2004?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"attendance\") FROM \"matches\" WHERE \"venue\"='a' AND \"date\"='16 october 2004';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"matches\" (\n \"date\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What is the lowest Attendance when Middlesbrough played at Venue A?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"matches\" WHERE \"opponent\"='middlesbrough' AND \"venue\"='a';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_13\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Who was the home team when the away team scored 14.21 (105)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_13\" WHERE \"away_team_score\"='14.21 (105)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"legislative_history\" (\n \"congress\" text,\n \"short_title\" text,\n \"bill_number_s\" text,\n \"date_introduced\" text,\n \"sponsor_s\" text,\n \"num_of_cosponsors\" real\n);\n\nQuestion: Who was the sponsor for the bill introduced February 28, 2005 with cosponsors less than 200?"
},
{
"role": "assistant",
"content": "SELECT \"sponsor_s\" FROM \"legislative_history\" WHERE \"num_of_cosponsors\"<200 AND \"date_introduced\"='february 28, 2005';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"nominated_work\" text,\n \"event\" text,\n \"award\" text,\n \"result\" text\n);\n\nQuestion: What year was Herself nominated at the MTV Movie Awards?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"awards_and_nominations\" WHERE \"nominated_work\"='herself' AND \"event\"='mtv movie awards';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_16\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the average amount of spectators when Essendon played as the home team?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"crowd\") FROM \"round_16\" WHERE \"home_team\"='essendon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_16\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the away team score at MCG?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_16\" WHERE \"venue\"='mcg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_16\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What did the home team score when playing against Collingwood?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_16\" WHERE \"away_team\"='collingwood';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_16\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Where was the game when Geelong was the away team?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_16\" WHERE \"away_team\"='geelong';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_16\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What team was the away team at Arden Street Oval?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_16\" WHERE \"venue\"='arden street oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"x\" (\n \"name\" text,\n \"latitude\" real,\n \"longitude\" real,\n \"diameter_km\" real,\n \"named_after\" text\n);\n\nQuestion: What in Xenia's Diameter in km, with a latitude of 14 and a longitude of 249.4?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"diameter_km\") FROM \"x\" WHERE \"latitude\"<14 AND \"name\"='xenia' AND \"longitude\">249.4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"x\" (\n \"name\" text,\n \"latitude\" real,\n \"longitude\" real,\n \"diameter_km\" real,\n \"named_after\" text\n);\n\nQuestion: What is the latitude for a crater with a diameter of 12.8 km and a longitude of 208?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"latitude\") FROM \"x\" WHERE \"diameter_km\"<12.8 AND \"longitude\"<208;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"to_par\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: Who was the Runner(s)-up in the race with a winning score of 67-66-65-69=267?"
},
{
"role": "assistant",
"content": "SELECT \"runner_s_up\" FROM \"european_tour_wins_9\" WHERE \"winning_score\"='67-66-65-69=267';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"to_par\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: When was the Masters Tournament?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"european_tour_wins_9\" WHERE \"tournament\"='masters tournament';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"to_par\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is the margin of victory in the race where Justin Rose was the runner-up?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"european_tour_wins_9\" WHERE \"runner_s_up\"='justin rose';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"to_par\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What tournament took place on 7 Aug 2011?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"european_tour_wins_9\" WHERE \"date\"='7 aug 2011';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_times\" (\n \"team\" text,\n \"class\" text,\n \"day_1\" text,\n \"day_2\" text,\n \"behind\" text\n);\n\nQuestion: For the team that had 4:05.096, what was their day 2?"
},
{
"role": "assistant",
"content": "SELECT \"day_2\" FROM \"qualifying_times\" WHERE \"day_1\"='4:05.096';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_times\" (\n \"team\" text,\n \"class\" text,\n \"day_1\" text,\n \"day_2\" text,\n \"behind\" text\n);\n\nQuestion: Which team had 3:18.513 on day 1?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"qualifying_times\" WHERE \"day_1\"='3:18.513';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_times\" (\n \"team\" text,\n \"class\" text,\n \"day_1\" text,\n \"day_2\" text,\n \"behind\" text\n);\n\nQuestion: For the team with a class of gt2 and 3:59.820 on day 2, what was the behind?"
},
{
"role": "assistant",
"content": "SELECT \"behind\" FROM \"qualifying_times\" WHERE \"class\"='gt2' AND \"day_2\"='3:59.820';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_times\" (\n \"team\" text,\n \"class\" text,\n \"day_1\" text,\n \"day_2\" text,\n \"behind\" text\n);\n\nQuestion: Which team was 3:47.761 on day 2?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"qualifying_times\" WHERE \"day_2\"='3:47.761';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_times\" (\n \"team\" text,\n \"class\" text,\n \"day_1\" text,\n \"day_2\" text,\n \"behind\" text\n);\n\nQuestion: What is the class of the team that has a behind of +44.780?"
},
{
"role": "assistant",
"content": "SELECT \"class\" FROM \"qualifying_times\" WHERE \"behind\"='+44.780';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_times\" (\n \"team\" text,\n \"class\" text,\n \"day_1\" text,\n \"day_2\" text,\n \"behind\" text\n);\n\nQuestion: For the team with 3:42.162 on day 2, what was the behind?"
},
{
"role": "assistant",
"content": "SELECT \"behind\" FROM \"qualifying_times\" WHERE \"day_2\"='3:42.162';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"juniors\" (\n \"tournament\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text\n);\n\nQuestion: Which one of the tournaments had a QF in 1996?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"juniors\" WHERE \"1996\"='qf';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"juniors\" (\n \"tournament\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text\n);\n\nQuestion: What is the value for the Wimbledon tournament in 1996?"
},
{
"role": "assistant",
"content": "SELECT \"1996\" FROM \"juniors\" WHERE \"tournament\"='wimbledon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"year\" real,\n \"player\" text,\n \"position\" text,\n \"college_country\" text,\n \"wnba_team\" text\n);\n\nQuestion: What year is center Ann Wauters?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"see_also\" WHERE \"position\"='center' AND \"player\"='ann wauters';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"year\" real,\n \"player\" text,\n \"position\" text,\n \"college_country\" text,\n \"wnba_team\" text\n);\n\nQuestion: What is the earliest year that includes a Seattle Storm guard?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"see_also\" WHERE \"position\"='guard' AND \"wnba_team\"='seattle storm';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"year\" real,\n \"player\" text,\n \"position\" text,\n \"college_country\" text,\n \"wnba_team\" text\n);\n\nQuestion: Regarding players before 2000, what is the USC player's position?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"see_also\" WHERE \"year\"<2000 AND \"college_country\"='usc';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"year\" real,\n \"player\" text,\n \"position\" text,\n \"college_country\" text,\n \"wnba_team\" text\n);\n\nQuestion: What is the earliest year a Baylor player made the list?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"see_also\" WHERE \"college_country\"='baylor';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"year\" real,\n \"player\" text,\n \"position\" text,\n \"college_country\" text,\n \"wnba_team\" text\n);\n\nQuestion: What is Sue Bird's position?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"see_also\" WHERE \"player\"='sue bird';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1899_1913\" (\n \"class\" text,\n \"wheels\" text,\n \"date\" text,\n \"builder\" text,\n \"no_built\" real\n);\n\nQuestion: Which Builder has a Class of Terrier?"
},
{
"role": "assistant",
"content": "SELECT \"builder\" FROM \"1899_1913\" WHERE \"class\"='terrier';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: who is the constructor when the laps is less than 68, the grid is more than 20 and the driver is thierry boutsen?"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"classification\" WHERE \"laps\"<68 AND \"grid\">20 AND \"driver\"='thierry boutsen';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the laps when the time/retired is turbo and the grid is less than 14?"
},
{
"role": "assistant",
"content": "SELECT \"laps\" FROM \"classification\" WHERE \"time_retired\"='turbo' AND \"grid\"<14;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the time/retired when the laps is less than 4?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"laps\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"statistics\" (\n \"season\" text,\n \"club\" text,\n \"competition\" text,\n \"apps\" real,\n \"goals\" real\n);\n\nQuestion: Name the most goals for total club and apps less than 120"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals\") FROM \"statistics\" WHERE \"club\"='total' AND \"apps\"<120;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"afl_draftees\" (\n \"draft\" text,\n \"pick\" real,\n \"player\" text,\n \"club\" text,\n \"games\" real,\n \"goals\" real\n);\n\nQuestion: How many goals are associated with 75 games?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals\") FROM \"afl_draftees\" WHERE \"games\"=75;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"g\" (\n \"player\" text,\n \"no_s\" real,\n \"height_in_ft\" text,\n \"position\" text,\n \"years_for_rockets\" text,\n \"school_club_team_country\" text\n);\n\nQuestion: What is the position for the Rockets years of 2004-05?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"g\" WHERE \"years_for_rockets\"='2004-05';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"g\" (\n \"player\" text,\n \"no_s\" real,\n \"height_in_ft\" text,\n \"position\" text,\n \"years_for_rockets\" text,\n \"school_club_team_country\" text\n);\n\nQuestion: What is the average number of years for the Houston Rockets 2004-05?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"no_s\") FROM \"g\" WHERE \"years_for_rockets\"='2004-05';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"g\" (\n \"player\" text,\n \"no_s\" real,\n \"height_in_ft\" text,\n \"position\" text,\n \"years_for_rockets\" text,\n \"school_club_team_country\" text\n);\n\nQuestion: For the years 1992-93, what position did he play for the Houston Rockets?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"g\" WHERE \"years_for_rockets\"='1992-93';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"g\" (\n \"player\" text,\n \"no_s\" real,\n \"height_in_ft\" text,\n \"position\" text,\n \"years_for_rockets\" text,\n \"school_club_team_country\" text\n);\n\nQuestion: What is the total number of years did he play the forward position and what school/club/team/country of Oregon State did he play?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"no_s\") FROM \"g\" WHERE \"position\"='forward' AND \"school_club_team_country\"='oregon state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"leaders\" (\n \"rank\" real,\n \"player\" text,\n \"country\" text,\n \"earnings\" real,\n \"events\" real,\n \"wins\" real\n);\n\nQuestion: How many wins for bruce fleisher with over 31 events?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"wins\") FROM \"leaders\" WHERE \"player\"='bruce fleisher' AND \"events\">31;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"leaders\" (\n \"rank\" real,\n \"player\" text,\n \"country\" text,\n \"earnings\" real,\n \"events\" real,\n \"wins\" real\n);\n\nQuestion: What is the average rank for players with under 26 events and less than 2 wins?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"leaders\" WHERE \"events\"<26 AND \"wins\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"leaders\" (\n \"rank\" real,\n \"player\" text,\n \"country\" text,\n \"earnings\" real,\n \"events\" real,\n \"wins\" real\n);\n\nQuestion: What is the high earnings for players with 34 events and over 2 wins?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"earnings\") FROM \"leaders\" WHERE \"events\"=34 AND \"wins\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"leaders\" (\n \"rank\" real,\n \"player\" text,\n \"country\" text,\n \"earnings\" real,\n \"events\" real,\n \"wins\" real\n);\n\nQuestion: What is the ranking for bruce fleisher with over $2,411,543?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"rank\") FROM \"leaders\" WHERE \"player\"='bruce fleisher' AND \"earnings\">'2,411,543';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_performance_timeline\" (\n \"tournament\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: Which tournament had a 2R categorization in 2009 and SF in 2010?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"doubles_performance_timeline\" WHERE \"2009\"='2r' AND \"2010\"='sf';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_performance_timeline\" (\n \"tournament\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the categorization in 2009 when it was 2R in 2008 and 2011?"
},
{
"role": "assistant",
"content": "SELECT \"2009\" FROM \"doubles_performance_timeline\" WHERE \"2008\"='2r' AND \"2011\"='2r';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_performance_timeline\" (\n \"tournament\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the categorization in 2012 when it was A in 2008 and 1R in 2011?"
},
{
"role": "assistant",
"content": "SELECT \"2012\" FROM \"doubles_performance_timeline\" WHERE \"2008\"='a' AND \"2011\"='1r';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_performance_timeline\" (\n \"tournament\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the categorization in 2010 when it was A in 2008 and 20011 while being QF in 2012?"
},
{
"role": "assistant",
"content": "SELECT \"2010\" FROM \"doubles_performance_timeline\" WHERE \"2008\"='a' AND \"2011\"='a' AND \"2012\"='qf';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2007_08_teams\" (\n \"club\" text,\n \"city\" text,\n \"stadium\" text,\n \"capacity\" real,\n \"2006_2007_season\" text\n);\n\nQuestion: What city in the 06/07 season had cagliari and finished 16th in serie a?"
},
{
"role": "assistant",
"content": "SELECT \"city\" FROM \"2007_08_teams\" WHERE \"2006_2007_season\"='16th in serie a' AND \"club\"='cagliari';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_3\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What was the score against home team, Richmond?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_3\" WHERE \"home_team\"='richmond';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_3\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is Fitzroy's smallest crowd size?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_3\" WHERE \"home_team\"='fitzroy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_3\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many people attended the game where the away team scored 16.7 (103) points?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_3\" WHERE \"away_team_score\"='16.7 (103)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_18_5_13\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: When was naomi cavaday the opponent?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"singles_18_5_13\" WHERE \"opponent\"='naomi cavaday';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_18_5_13\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: When was andrea g\u00e1miz the opponent?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"singles_18_5_13\" WHERE \"opponent\"='andrea g\u00e1miz';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_18_5_13\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Who is the opponent when the score was 6\u20134, 6\u20132 and the surface was clay?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"singles_18_5_13\" WHERE \"score\"='6\u20134, 6\u20132' AND \"surface\"='clay';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_22\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Where was game that had a home team score 18.16 (124)?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_22\" WHERE \"home_team_score\"='18.16 (124)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_22\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many points did the away team score when the home team scored 16.14 (110)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_22\" WHERE \"home_team_score\"='16.14 (110)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_22\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What was the smallest crowd at a home game for essendon?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_22\" WHERE \"home_team\"='essendon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Tell me the time/retired for riccardo patrese"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"race\" WHERE \"driver\"='riccardo patrese';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.