chat_prompt stringlengths 438 1.53k |
|---|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 fitzroy score at their home game?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_1\" 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_1\" (\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: Which away team played at western oval?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_1\" WHERE \"venue\"='western oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 big was the crowd when the opponent was essendon?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"crowd\") FROM \"round_1\" WHERE \"away_team\"='essendon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_runner_up\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: Which surface had Yew-Ming Si as a partner?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"doubles_runner_up\" WHERE \"partner\"='yew-ming si';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"labour_targets\" (\n \"rank\" real,\n \"constituency\" text,\n \"winning_party_2007\" text,\n \"swing_to_gain\" real,\n \"labour_s_place_2007\" text,\n \"result\" text\n);\n\nQuestion: What was the result of rank 1?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"labour_targets\" WHERE \"rank\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stage_results\" (\n \"date\" text,\n \"course\" text,\n \"distance\" text,\n \"type\" text,\n \"winner\" text\n);\n\nQuestion: What type has a date of 1 june?"
},
{
"role": "assistant",
"content": "SELECT \"type\" FROM \"stage_results\" WHERE \"date\"='1 june';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stage_results\" (\n \"date\" text,\n \"course\" text,\n \"distance\" text,\n \"type\" text,\n \"winner\" text\n);\n\nQuestion: What was the date with a hilly stage?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"stage_results\" WHERE \"type\"='hilly stage';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stage_results\" (\n \"date\" text,\n \"course\" text,\n \"distance\" text,\n \"type\" text,\n \"winner\" text\n);\n\nQuestion: What is the name of the winner on 18 may?"
},
{
"role": "assistant",
"content": "SELECT \"winner\" FROM \"stage_results\" WHERE \"date\"='18 may';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stage_results\" (\n \"date\" text,\n \"course\" text,\n \"distance\" text,\n \"type\" text,\n \"winner\" text\n);\n\nQuestion: What date was moena to aprica the course?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"stage_results\" WHERE \"course\"='moena to aprica';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stage_results\" (\n \"date\" text,\n \"course\" text,\n \"distance\" text,\n \"type\" text,\n \"winner\" text\n);\n\nQuestion: What is the name of the winner with a type of plain stage and a Course of nola to sora?"
},
{
"role": "assistant",
"content": "SELECT \"winner\" FROM \"stage_results\" WHERE \"type\"='plain stage' AND \"course\"='nola to sora';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colours_and_shapes\" (\n \"type_of_sign\" text,\n \"shape\" text,\n \"border\" text,\n \"background_colour\" text,\n \"text_symbol\" text\n);\n\nQuestion: Which sign has a red border and a warning sign?"
},
{
"role": "assistant",
"content": "SELECT \"text_symbol\" FROM \"colours_and_shapes\" WHERE \"border\"='red' AND \"type_of_sign\"='warning';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colours_and_shapes\" (\n \"type_of_sign\" text,\n \"shape\" text,\n \"border\" text,\n \"background_colour\" text,\n \"text_symbol\" text\n);\n\nQuestion: Which sign had a yellow background and a triangular shape?"
},
{
"role": "assistant",
"content": "SELECT \"border\" FROM \"colours_and_shapes\" WHERE \"background_colour\"='yellow' AND \"shape\"='triangular';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colours_and_shapes\" (\n \"type_of_sign\" text,\n \"shape\" text,\n \"border\" text,\n \"background_colour\" text,\n \"text_symbol\" text\n);\n\nQuestion: Which sign has a red border?"
},
{
"role": "assistant",
"content": "SELECT \"text_symbol\" FROM \"colours_and_shapes\" WHERE \"border\"='red';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colours_and_shapes\" (\n \"type_of_sign\" text,\n \"shape\" text,\n \"border\" text,\n \"background_colour\" text,\n \"text_symbol\" text\n);\n\nQuestion: Which color is the background of the mandatory instructions?"
},
{
"role": "assistant",
"content": "SELECT \"background_colour\" FROM \"colours_and_shapes\" WHERE \"type_of_sign\"='mandatory instructions';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colours_and_shapes\" (\n \"type_of_sign\" text,\n \"shape\" text,\n \"border\" text,\n \"background_colour\" text,\n \"text_symbol\" text\n);\n\nQuestion: What is the color of the background of the white border and sign of information?"
},
{
"role": "assistant",
"content": "SELECT \"background_colour\" FROM \"colours_and_shapes\" WHERE \"border\"='white' AND \"type_of_sign\"='information';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_6\" (\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 away team score when the home team score was 9.10 (64)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_6\" WHERE \"home_team_score\"='9.10 (64)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average total of Italy and has a bronze larger than 1?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"medal_table\" WHERE \"nation\"='italy' AND \"bronze\">1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What amount of Gold does Russia have and have a rank larger than 1?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_table\" WHERE \"nation\"='russia' AND \"rank\">1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of the ranks with a total of 1 and silver less than 0."
},
{
"role": "assistant",
"content": "SELECT SUM(\"rank\") FROM \"medal_table\" WHERE \"total\"=1 AND \"silver\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: Which Player is linebacker and has a pick larger than 28?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"nfl_draft\" WHERE \"position\"='linebacker' AND \"pick\">28;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: What was the lowest round that Melvin Johnson played?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"round\") FROM \"nfl_draft\" WHERE \"player\"='melvin johnson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"division_i\" (\n \"year\" text,\n \"champion\" text,\n \"score\" text,\n \"runner_up\" text,\n \"location\" text,\n \"semi_finalist_num1\" text,\n \"semi_finalist_num2\" text\n);\n\nQuestion: Who was the runner-up at the South Florida Semi-Finalist #1?"
},
{
"role": "assistant",
"content": "SELECT \"runner_up\" FROM \"division_i\" WHERE \"semi_finalist_num1\"='south florida';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"division_i\" (\n \"year\" text,\n \"champion\" text,\n \"score\" text,\n \"runner_up\" text,\n \"location\" text,\n \"semi_finalist_num1\" text,\n \"semi_finalist_num2\" text\n);\n\nQuestion: Who was the Champion in Snellville, GA in 2006?"
},
{
"role": "assistant",
"content": "SELECT \"champion\" FROM \"division_i\" WHERE \"location\"='snellville, ga' AND \"year\"='2006';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"division_i\" (\n \"year\" text,\n \"champion\" text,\n \"score\" text,\n \"runner_up\" text,\n \"location\" text,\n \"semi_finalist_num1\" text,\n \"semi_finalist_num2\" text\n);\n\nQuestion: Who won when Elon was the runner-up?"
},
{
"role": "assistant",
"content": "SELECT \"champion\" FROM \"division_i\" WHERE \"runner_up\"='elon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"division_i\" (\n \"year\" text,\n \"champion\" text,\n \"score\" text,\n \"runner_up\" text,\n \"location\" text,\n \"semi_finalist_num1\" text,\n \"semi_finalist_num2\" text\n);\n\nQuestion: What year saw a score of 8-5?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"division_i\" WHERE \"score\"='8-5';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"division_i\" (\n \"year\" text,\n \"champion\" text,\n \"score\" text,\n \"runner_up\" text,\n \"location\" text,\n \"semi_finalist_num1\" text,\n \"semi_finalist_num2\" text\n);\n\nQuestion: Who was the Semi-Finalist #2 in 2007?"
},
{
"role": "assistant",
"content": "SELECT \"semi_finalist_num2\" FROM \"division_i\" WHERE \"year\"='2007';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"division_i\" (\n \"year\" text,\n \"champion\" text,\n \"score\" text,\n \"runner_up\" text,\n \"location\" text,\n \"semi_finalist_num1\" text,\n \"semi_finalist_num2\" text\n);\n\nQuestion: Who was the Semi-Finalist #2 in 2001?"
},
{
"role": "assistant",
"content": "SELECT \"semi_finalist_num2\" FROM \"division_i\" WHERE \"year\"='2001';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournament_results\" (\n \"date\" text,\n \"tournament\" text,\n \"location\" text,\n \"purse\" real,\n \"winner\" text,\n \"score\" text,\n \"1st_prize\" real\n);\n\nQuestion: What tournament is in Arizona?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"tournament_results\" WHERE \"location\"='arizona';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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: When did an away team have a score of 12.9 (81)?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_1\" WHERE \"away_team_score\"='12.9 (81)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 home team that had an opponent of footscray?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_1\" 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_1\" (\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: Which away team had a crowd bigger than 21,000?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_1\" WHERE \"crowd\">'21,000';"
}
] |
[
{
"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: When the home team scored 15.22 (112), what was the away team?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_13\" WHERE \"home_team_score\"='15.22 (112)';"
}
] |
[
{
"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: When the away team scored 7.13 (55), what was the home team?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_13\" WHERE \"away_team_score\"='7.13 (55)';"
}
] |
[
{
"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: When an away team scored 10.8 (68), what was the crowd size?"
},
{
"role": "assistant",
"content": "SELECT \"crowd\" FROM \"round_13\" WHERE \"away_team_score\"='10.8 (68)';"
}
] |
[
{
"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: What was the smallest crowd size when a home team scored 6.11 (47)?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_13\" WHERE \"home_team_score\"='6.11 (47)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"sp_fs\" real,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What is the rank for points less than 166.96, and a Places of 166?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"ladies\" WHERE \"points\"<166.96 AND \"places\"='166';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"sp_fs\" real,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What is the rank for more than 120.44 points in East Germany and a SP+FS of 3?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"ladies\" WHERE \"points\">120.44 AND \"nation\"='east germany' AND \"sp_fs\"=3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"sp_fs\" real,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What is the rank when 233 shows for places and SP+FS smaller than 27?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"ladies\" WHERE \"places\"='233' AND \"sp_fs\"<27;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"sp_fs\" real,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What is the average SP+FS for Denise Biellmann, and a Rank larger than 5?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"sp_fs\") FROM \"ladies\" WHERE \"name\"='denise biellmann' AND \"rank\">5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"sp_fs\" real,\n \"points\" real,\n \"places\" text\n);\n\nQuestion: What is the number of points for east germany, and a Places of 88?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points\") FROM \"ladies\" WHERE \"nation\"='east germany' AND \"places\"='88';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"engines\" (\n \"years\" text,\n \"engine\" text,\n \"power\" text,\n \"torque\" text,\n \"notes\" text\n);\n\nQuestion: what is the years for engin 5.7l hemi v8?"
},
{
"role": "assistant",
"content": "SELECT \"years\" FROM \"engines\" WHERE \"engine\"='5.7l hemi v8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"engines\" (\n \"years\" text,\n \"engine\" text,\n \"power\" text,\n \"torque\" text,\n \"notes\" text\n);\n\nQuestion: what is the years when the notes is laredo, limited, overland and the engine is 5.7l hemi v8?"
},
{
"role": "assistant",
"content": "SELECT \"years\" FROM \"engines\" WHERE \"notes\"='laredo, limited, overland' AND \"engine\"='5.7l hemi v8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"engines\" (\n \"years\" text,\n \"engine\" text,\n \"power\" text,\n \"torque\" text,\n \"notes\" text\n);\n\nQuestion: what is the torque when the notes are laredo, limited, overland and the engine is 5.7l hemi v8?"
},
{
"role": "assistant",
"content": "SELECT \"torque\" FROM \"engines\" WHERE \"notes\"='laredo, limited, overland' AND \"engine\"='5.7l hemi v8';"
}
] |
[
{
"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: Who drove the ferrari that went 57 laps?"
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"race\" WHERE \"constructor\"='ferrari' AND \"laps\"=57;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"place\" real,\n \"name\" text,\n \"from\" real,\n \"until\" real,\n \"titles\" real,\n \"seconds\" text,\n \"thirds\" text\n);\n\nQuestion: What is place number of Frank Kleber who started in 2001?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"place\") FROM \"men\" WHERE \"name\"='frank kleber' AND \"from\"<2001;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"place\" real,\n \"name\" text,\n \"from\" real,\n \"until\" real,\n \"titles\" real,\n \"seconds\" text,\n \"thirds\" text\n);\n\nQuestion: How many seconds did the champion who started in 1971 and placed above 2 have?"
},
{
"role": "assistant",
"content": "SELECT \"seconds\" FROM \"men\" WHERE \"from\">1971 AND \"place\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"place\" real,\n \"name\" text,\n \"from\" real,\n \"until\" real,\n \"titles\" real,\n \"seconds\" text,\n \"thirds\" text\n);\n\nQuestion: What place did R. Wenzel, who was active after 1934, have?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"place\") FROM \"men\" WHERE \"name\"='r. wenzel' AND \"until\">1934;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"round\" text,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What's the time for a round of n/a when the opponent is mikhail ilyukhin?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"mixed_martial_arts_record\" WHERE \"round\"='n/a' AND \"opponent\"='mikhail ilyukhin';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"grands_prix\" (\n \"round\" real,\n \"grand_prix\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the pole position of the Portuguese Grand Prix?"
},
{
"role": "assistant",
"content": "SELECT \"pole_position\" FROM \"grands_prix\" WHERE \"grand_prix\"='portuguese grand prix';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"grands_prix\" (\n \"round\" real,\n \"grand_prix\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the pole position of the grand prix with 1 round?"
},
{
"role": "assistant",
"content": "SELECT \"pole_position\" FROM \"grands_prix\" WHERE \"round\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"grands_prix\" (\n \"round\" real,\n \"grand_prix\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the pole position of the Hungarian Grand Prix?"
},
{
"role": "assistant",
"content": "SELECT \"pole_position\" FROM \"grands_prix\" WHERE \"grand_prix\"='hungarian grand prix';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"grands_prix\" (\n \"round\" real,\n \"grand_prix\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the pole position of the Belgian Grand Prix?"
},
{
"role": "assistant",
"content": "SELECT \"pole_position\" FROM \"grands_prix\" WHERE \"grand_prix\"='belgian grand prix';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"grands_prix\" (\n \"round\" real,\n \"grand_prix\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the grand prix with Gerhard Berger as the fastest lap and Michael Schumacher as the pole position?"
},
{
"role": "assistant",
"content": "SELECT \"grand_prix\" FROM \"grands_prix\" WHERE \"fastest_lap\"='gerhard berger' AND \"pole_position\"='michael schumacher';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"6201_6300\" (\n \"ngc_number\" real,\n \"object_type\" text,\n \"constellation\" text,\n \"right_ascension_j2000\" text,\n \"declination_j2000\" text,\n \"apparent_magnitude\" real\n);\n\nQuestion: Tell me the declination for consellaion of ophiuchus and apparent magnitude less than 8.6 with right ascension of 16h47m14.5s"
},
{
"role": "assistant",
"content": "SELECT \"declination_j2000\" FROM \"6201_6300\" WHERE \"constellation\"='ophiuchus' AND \"apparent_magnitude\"<8.6 AND \"right_ascension_j2000\"='16h47m14.5s';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"6201_6300\" (\n \"ngc_number\" real,\n \"object_type\" text,\n \"constellation\" text,\n \"right_ascension_j2000\" text,\n \"declination_j2000\" text,\n \"apparent_magnitude\" real\n);\n\nQuestion: Tell me the right ascensuon for object type of globular cluster and apparent magnitude of 8.5 and NGC number of 6273"
},
{
"role": "assistant",
"content": "SELECT \"right_ascension_j2000\" FROM \"6201_6300\" WHERE \"object_type\"='globular cluster' AND \"apparent_magnitude\"=8.5 AND \"ngc_number\"=6273;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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: When was the game played where St Kilda was the home team?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_7\" WHERE \"home_team\"='st kilda';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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 home team score with an away team of Melbourne?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_7\" WHERE \"away_team\"='melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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 average amount of spectators when the home team scored 11.14 (80)?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"crowd\") FROM \"round_7\" WHERE \"home_team_score\"='11.14 (80)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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: Which away team had a home team that scored 12.19 (91)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_7\" WHERE \"home_team_score\"='12.19 (91)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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: Which away team played the home team of Footscray?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_7\" WHERE \"home_team\"='footscray';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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 spectators were present when the away team scored 10.12 (72)?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_7\" WHERE \"away_team_score\"='10.12 (72)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_oldest_sitting_m_ps_since_1945\" (\n \"born\" text,\n \"became_oldest_mp\" text,\n \"left_house\" text,\n \"age_on_leaving\" text,\n \"died\" text,\n \"political_party\" text\n);\n\nQuestion: How old was the conservative party member that left the house in 2001?"
},
{
"role": "assistant",
"content": "SELECT \"age_on_leaving\" FROM \"list_of_oldest_sitting_m_ps_since_1945\" WHERE \"political_party\"='conservative' AND \"left_house\"='2001';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text,\n \"arena\" text,\n \"points\" real\n);\n\nQuestion: What was the lowest Attendance for the Staples Center Arena when the Points were over 14?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"regular_season\" WHERE \"points\">14 AND \"arena\"='staples center';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"january\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Name the leading scorer for 12 january 2008"
},
{
"role": "assistant",
"content": "SELECT \"leading_scorer\" FROM \"january\" WHERE \"date\"='12 january 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"january\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Name the record for 21 january 2008"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"january\" WHERE \"date\"='21 january 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 date when the away team is melbourne?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_1\" WHERE \"away_team\"='melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 is the home team when the home team score is 18.17 (125)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_1\" WHERE \"home_team_score\"='18.17 (125)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 score for the home team for the venue glenferrie oval?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_1\" WHERE \"venue\"='glenferrie oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 is the home team when the home team score is 14.19 (103)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_1\" WHERE \"home_team_score\"='14.19 (103)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 venue when the away team score is 17.13 (115)?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_1\" WHERE \"away_team_score\"='17.13 (115)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\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 South Melbourne's score when they played as the away team?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_11\" WHERE \"away_team\"='south melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\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 attendance for the North Melbourne's home game?"
},
{
"role": "assistant",
"content": "SELECT \"crowd\" FROM \"round_11\" WHERE \"home_team\"='north melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 score of the home team that played at brunswick street oval with a crowd larger than 12,000?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_18\" WHERE \"crowd\">'12,000' AND \"venue\"='brunswick street oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 name of the venue where home team st kilda played?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_18\" WHERE \"home_team\"='st kilda';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 home team score that played away team carlton?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_18\" WHERE \"away_team\"='carlton';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1980s_bears_11_7\" (\n \"year\" real,\n \"date\" text,\n \"winner\" text,\n \"result\" text,\n \"loser\" text,\n \"attendance\" real,\n \"location\" text\n);\n\nQuestion: Who won in the game before 1985 attended by over 62,026?"
},
{
"role": "assistant",
"content": "SELECT \"winner\" FROM \"1980s_bears_11_7\" WHERE \"attendance\">'62,026' AND \"year\"<1985;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fox_nbc_era_2001_2006\" (\n \"year\" real,\n \"network\" text,\n \"lap_by_lap\" text,\n \"s_color_commentator\" text,\n \"pre_race_host\" text,\n \"ratings\" text\n);\n\nQuestion: When the Year is smaller than 2004, and Mike Joy is the Lap-by-lap, what are the Ratings?"
},
{
"role": "assistant",
"content": "SELECT \"ratings\" FROM \"fox_nbc_era_2001_2006\" WHERE \"year\"<2004 AND \"lap_by_lap\"='mike joy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fox_nbc_era_2001_2006\" (\n \"year\" real,\n \"network\" text,\n \"lap_by_lap\" text,\n \"s_color_commentator\" text,\n \"pre_race_host\" text,\n \"ratings\" text\n);\n\nQuestion: Which Network has Bill Weber for the Lap-by-lap?"
},
{
"role": "assistant",
"content": "SELECT \"network\" FROM \"fox_nbc_era_2001_2006\" WHERE \"lap_by_lap\"='bill weber';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fox_nbc_era_2001_2006\" (\n \"year\" real,\n \"network\" text,\n \"lap_by_lap\" text,\n \"s_color_commentator\" text,\n \"pre_race_host\" text,\n \"ratings\" text\n);\n\nQuestion: Who was the Pre-Race Host when Mike Joy was the Lap-by-lap in the Year 2005?"
},
{
"role": "assistant",
"content": "SELECT \"pre_race_host\" FROM \"fox_nbc_era_2001_2006\" WHERE \"lap_by_lap\"='mike joy' AND \"year\"=2005;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fox_nbc_era_2001_2006\" (\n \"year\" real,\n \"network\" text,\n \"lap_by_lap\" text,\n \"s_color_commentator\" text,\n \"pre_race_host\" text,\n \"ratings\" text\n);\n\nQuestion: How many Years have Ratings of 10.9/23?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year\") FROM \"fox_nbc_era_2001_2006\" WHERE \"ratings\"='10.9/23';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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 home team of lake oval's score?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_7\" WHERE \"venue\"='lake oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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: When was victoria park used as a venue?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_7\" WHERE \"venue\"='victoria park';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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: Which date has an Away team of fitzroy?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_7\" WHERE \"away_team\"='fitzroy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_7\" (\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 largest crowd for a Home team of carlton?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"crowd\") FROM \"round_7\" WHERE \"home_team\"='carlton';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\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: When the Away team scored 12.9 (81), what was the average Crowd size?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"crowd\") FROM \"round_17\" WHERE \"away_team_score\"='12.9 (81)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\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: When the Home team had a score of 16.10 (106), what was the Date?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_17\" WHERE \"home_team_score\"='16.10 (106)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\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: When the Away team is melbourne, what's the lowest Crowd attended?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_17\" WHERE \"away_team\"='melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\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: When the Away team is essendon, what's the Home team score?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_17\" WHERE \"away_team\"='essendon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_17\" (\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: If the Venue is brunswick street oval, what date was the game played ?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_17\" WHERE \"venue\"='brunswick street oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"olympians\" (\n \"last\" text,\n \"first\" text,\n \"year\" real,\n \"sport\" text,\n \"country\" text\n);\n\nQuestion: Name the first for countries of trinidad and tobago for hutchinson for years before 2004"
},
{
"role": "assistant",
"content": "SELECT \"first\" FROM \"olympians\" WHERE \"country\"='trinidad and tobago' AND \"last\"='hutchinson' AND \"year\"<2004;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"olympians\" (\n \"last\" text,\n \"first\" text,\n \"year\" real,\n \"sport\" text,\n \"country\" text\n);\n\nQuestion: Name the sport for canada in 2004"
},
{
"role": "assistant",
"content": "SELECT \"sport\" FROM \"olympians\" WHERE \"country\"='canada' AND \"year\"=2004;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"olympians\" (\n \"last\" text,\n \"first\" text,\n \"year\" real,\n \"sport\" text,\n \"country\" text\n);\n\nQuestion: Name the last for softball before 2000"
},
{
"role": "assistant",
"content": "SELECT \"last\" FROM \"olympians\" WHERE \"year\"<2000 AND \"sport\"='softball';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"olympians\" (\n \"last\" text,\n \"first\" text,\n \"year\" real,\n \"sport\" text,\n \"country\" text\n);\n\nQuestion: Name the sum of year for swimming and first of mike"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"olympians\" WHERE \"sport\"='swimming' AND \"first\"='mike';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"olympians\" (\n \"last\" text,\n \"first\" text,\n \"year\" real,\n \"sport\" text,\n \"country\" text\n);\n\nQuestion: Name the sport for puerto rico and year of 2000"
},
{
"role": "assistant",
"content": "SELECT \"sport\" FROM \"olympians\" WHERE \"country\"='puerto rico' AND \"year\"=2000;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"individual_2007_uci_pro_tour_standings_a\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"team\" text,\n \"points\" real\n);\n\nQuestion: Cumulative point total for all teams playing on the Discovery Channel?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"points\") FROM \"individual_2007_uci_pro_tour_standings_a\" WHERE \"team\"='discovery channel';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"individual_2007_uci_pro_tour_standings_a\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"team\" text,\n \"points\" real\n);\n\nQuestion: Which player is from Belgium?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"individual_2007_uci_pro_tour_standings_a\" WHERE \"nationality\"='belgium';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"december\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"record\" text\n);\n\nQuestion: Who was the visiting team that played against the Kings?"
},
{
"role": "assistant",
"content": "SELECT \"visitor\" FROM \"december\" WHERE \"home\"='kings';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"nationality\" text,\n \"college_junior_club_team_league\" text\n);\n\nQuestion: Tell me the player for round more than 5 and position of c"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"draft_picks\" WHERE \"round\">5 AND \"position\"='c';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"nationality\" text,\n \"college_junior_club_team_league\" text\n);\n\nQuestion: Tell me the college for carl hagelin"
},
{
"role": "assistant",
"content": "SELECT \"college_junior_club_team_league\" FROM \"draft_picks\" WHERE \"player\"='carl hagelin';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"l\" (\n \"player\" text,\n \"pos\" text,\n \"from\" real,\n \"school_country\" text,\n \"rebs\" real,\n \"asts\" real\n);\n\nQuestion: What year is the player who attended la salle with under 6 assists from?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"from\") FROM \"l\" WHERE \"school_country\"='la salle' AND \"asts\"<6;"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.