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 \"current_clubs_2014_season\" (\n \"club\" text,\n \"position_in_2013\" text,\n \"first_season\" real,\n \"first_season_of_current_spell\" real,\n \"number_of_seasons_in_superettan\" real,\n \"number_of_seasons_in_second_tier\" real\n);\n\nQuestion: Which First season of current spell is the highest one that has a Position in 2013 of 9th, and a Number of seasons in second tier larger than 14?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"first_season_of_current_spell\") FROM \"current_clubs_2014_season\" WHERE \"position_in_2013\"='9th' AND \"number_of_seasons_in_second_tier\">14;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"points\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"points\" real\n);\n\nQuestion: What was the ranking of Beirasar Rosal\u00eda, the year they played 32 games?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"points\" WHERE \"team\"='beirasar rosal\u00eda' AND \"games\"<32;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"points\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"points\" real\n);\n\nQuestion: How many points did Antwain Barbour score in the year he played 39 games?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points\") FROM \"points\" WHERE \"name\"='antwain barbour' AND \"games\"<39;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"points\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"points\" real\n);\n\nQuestion: What team was Paolo Quinteros on?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"points\" WHERE \"name\"='paolo quinteros';"
}
] |
[
{
"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 \"event\" text,\n \"round\" text,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: Was the record of 8-1 (1) a win or a loss?"
},
{
"role": "assistant",
"content": "SELECT \"res\" FROM \"mixed_martial_arts_record\" WHERE \"record\"='8-1 (1)';"
}
] |
[
{
"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 \"event\" text,\n \"round\" text,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: In what event was the technical decision (split) method used?"
},
{
"role": "assistant",
"content": "SELECT \"event\" FROM \"mixed_martial_arts_record\" WHERE \"method\"='technical decision (split)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"topscorers\" (\n \"player\" text,\n \"club\" text,\n \"league\" real,\n \"play_offs\" real,\n \"fa_cup\" real,\n \"fa_trophy\" real,\n \"total\" real\n);\n\nQuestion: What are the average play-offs that have an FA Cup greater than 3?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"play_offs\") FROM \"topscorers\" WHERE \"fa_cup\">3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"topscorers\" (\n \"player\" text,\n \"club\" text,\n \"league\" real,\n \"play_offs\" real,\n \"fa_cup\" real,\n \"fa_trophy\" real,\n \"total\" real\n);\n\nQuestion: How many totals have a play-off less than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") FROM \"topscorers\" WHERE \"play_offs\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"topscorers\" (\n \"player\" text,\n \"club\" text,\n \"league\" real,\n \"play_offs\" real,\n \"fa_cup\" real,\n \"fa_trophy\" real,\n \"total\" real\n);\n\nQuestion: Which league has an FA cup greater than 0, with a total greater than 21?"
},
{
"role": "assistant",
"content": "SELECT \"league\" FROM \"topscorers\" WHERE \"fa_cup\">0 AND \"total\">21;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"topscorers\" (\n \"player\" text,\n \"club\" text,\n \"league\" real,\n \"play_offs\" real,\n \"fa_cup\" real,\n \"fa_trophy\" real,\n \"total\" real\n);\n\nQuestion: What is the highest play-offs that have stevenage borough as the club, and a total greater than 21?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"play_offs\") FROM \"topscorers\" WHERE \"club\"='stevenage borough' AND \"total\">21;"
}
] |
[
{
"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 \"2003\" text,\n \"2004\" text,\n \"2012\" text,\n \"2013\" text\n);\n\nQuestion: What is the tournament in 2012 results that has a 2003 results of 2r and played at Wimbledon?"
},
{
"role": "assistant",
"content": "SELECT \"2012\" FROM \"doubles_performance_timeline\" WHERE \"2003\"='2r' AND \"tournament\"='wimbledon';"
}
] |
[
{
"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 \"2003\" text,\n \"2004\" text,\n \"2012\" text,\n \"2013\" text\n);\n\nQuestion: What results in 2012 also has 2013 results of 2r and the tournament was Wimbledon?"
},
{
"role": "assistant",
"content": "SELECT \"2012\" FROM \"doubles_performance_timeline\" WHERE \"2013\"='2r' AND \"tournament\"='wimbledon';"
}
] |
[
{
"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 \"2003\" text,\n \"2004\" text,\n \"2012\" text,\n \"2013\" text\n);\n\nQuestion: What is the results from 2003 that has a 2012 result of 1r and a 2004 result of 2r and from the Australian Open?"
},
{
"role": "assistant",
"content": "SELECT \"2003\" FROM \"doubles_performance_timeline\" WHERE \"2012\"='1r' AND \"2004\"='2r' AND \"tournament\"='australian open';"
}
] |
[
{
"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 \"2003\" text,\n \"2004\" text,\n \"2012\" text,\n \"2013\" text\n);\n\nQuestion: What is the name of the tournament that has the results of 2003 2r and 2004 1r?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"doubles_performance_timeline\" WHERE \"2003\"='2r' AND \"2004\"='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 \"2003\" text,\n \"2004\" text,\n \"2012\" text,\n \"2013\" text\n);\n\nQuestion: What is the results in 2004 that has a 2013 result of 2r?"
},
{
"role": "assistant",
"content": "SELECT \"2004\" FROM \"doubles_performance_timeline\" WHERE \"2013\"='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 \"2003\" text,\n \"2004\" text,\n \"2012\" text,\n \"2013\" text\n);\n\nQuestion: What is the result from 2003 from the US Open?"
},
{
"role": "assistant",
"content": "SELECT \"2003\" FROM \"doubles_performance_timeline\" WHERE \"tournament\"='us open';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"height_cm\" real,\n \"weight_kg\" real,\n \"birthdate\" text,\n \"birthplace\" text,\n \"1986_1987_team\" text\n);\n\nQuestion: What is the height of the player born on June 24, 1964, with a weight over 84 kg?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"height_cm\") FROM \"list_of_united_states_national_ice_hocke\" WHERE \"weight_kg\">84 AND \"birthdate\"='june 24, 1964';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"height_cm\" real,\n \"weight_kg\" real,\n \"birthdate\" text,\n \"birthplace\" text,\n \"1986_1987_team\" text\n);\n\nQuestion: On what date was the player from Melrose, Massachusetts born?"
},
{
"role": "assistant",
"content": "SELECT \"birthdate\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"birthplace\"='melrose, massachusetts';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"height_cm\" real,\n \"weight_kg\" real,\n \"birthdate\" text,\n \"birthplace\" text,\n \"1986_1987_team\" text\n);\n\nQuestion: What is the height of the player from the Washington Capitals, who was born in Detroit, Michigan and has a jersey number under #11?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"height_cm\") FROM \"list_of_united_states_national_ice_hocke\" WHERE \"1986_1987_team\"='washington capitals' AND \"birthplace\"='detroit, michigan' AND \"jersey_num\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What is Date, when Event is Billabong Pro?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"tournaments\" WHERE \"event\"='billabong pro';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What is Location, when Date is December 8-December 20?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"tournaments\" WHERE \"date\"='december 8-december 20';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What is Runner-up, when Event is Mancora Peru Classic?"
},
{
"role": "assistant",
"content": "SELECT \"runner_up\" FROM \"tournaments\" WHERE \"event\"='mancora peru classic';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What is Event, when Date is August 20-August 27?"
},
{
"role": "assistant",
"content": "SELECT \"event\" FROM \"tournaments\" WHERE \"date\"='august 20-august 27';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What is Date when Runner-up is Sof\u00eda Mul\u00e1novich ( per )?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"tournaments\" WHERE \"runner_up\"='sof\u00eda mul\u00e1novich ( per )';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What is Country, when Event is Rip Curl Women's Pro?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"tournaments\" WHERE \"event\"='rip curl women''s pro';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"seasons\" (\n \"season\" text,\n \"conference\" text,\n \"division\" text,\n \"finish\" text,\n \"wins\" real,\n \"losses\" real,\n \"winpct\" real\n);\n\nQuestion: What is the highest win percentage when there were 23 losses?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"winpct\") FROM \"seasons\" WHERE \"losses\"=23;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"seasons\" (\n \"season\" text,\n \"conference\" text,\n \"division\" text,\n \"finish\" text,\n \"wins\" real,\n \"losses\" real,\n \"winpct\" real\n);\n\nQuestion: Which finish had a win percentage that was more than 0.598 and also had less than 53 wins?"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"seasons\" WHERE \"winpct\">0.598 AND \"wins\"<53;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"signings\" (\n \"pos\" text,\n \"player\" text,\n \"free_agent_type\" text,\n \"2007_team\" text,\n \"contract\" text\n);\n\nQuestion: What is the 2007 Team with player Deshaun Foster?"
},
{
"role": "assistant",
"content": "SELECT \"2007_team\" FROM \"signings\" WHERE \"player\"='deshaun foster';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"signings\" (\n \"pos\" text,\n \"player\" text,\n \"free_agent_type\" text,\n \"2007_team\" text,\n \"contract\" text\n);\n\nQuestion: What is the Free Agent Type for player bryant johnson?"
},
{
"role": "assistant",
"content": "SELECT \"free_agent_type\" FROM \"signings\" WHERE \"player\"='bryant johnson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the High assists with a Date that is march 31?"
},
{
"role": "assistant",
"content": "SELECT \"high_assists\" FROM \"game_log\" WHERE \"date\"='march 31';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the Score with a Date that is march 12?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"date\"='march 12';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_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 lowest silver that has a bronze greater than 1, a gold less than 2, and a total less than 2?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"silver\") FROM \"medals_table\" WHERE \"bronze\">1 AND \"gold\"<2 AND \"total\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What average rank that has a silver less than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"medals_table\" WHERE \"silver\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many silver have 4 as the total with a bronze less than 2?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"silver\") FROM \"medals_table\" WHERE \"total\"=4 AND \"bronze\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many totals have a rank greater than 4, czech Republic as the nation, and a bronze greater than 0?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"total\") FROM \"medals_table\" WHERE \"rank\">4 AND \"nation\"='czech republic' AND \"bronze\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What average total has a gold greater than 0, and a silver greater than 0, with a bronze greater than 2?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"medals_table\" WHERE \"gold\">0 AND \"silver\">0 AND \"bronze\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uranium_demand_mining_production_and_def\" (\n \"country\" text,\n \"uranium_required_2006_08\" text,\n \"pct_of_world_demand\" text,\n \"indigenous_mining_production_2006\" text,\n \"deficit_surplus\" text\n);\n\nQuestion: Which country has an Indigenous mining production 2006 of 0?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"uranium_demand_mining_production_and_def\" WHERE \"indigenous_mining_production_2006\"='0';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity\" real,\n \"capacity_in_use\" text\n);\n\nQuestion: What is the total capacity of the airport ranked less than 7, has a capacity in use of 114.2%, and has less than 13,699,657 total passengers?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"capacity\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"rank\"<7 AND \"capacity_in_use\"='114.2%' AND \"total_passengers\"<'13,699,657';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity\" real,\n \"capacity_in_use\" text\n);\n\nQuestion: What is the highest capacity of the airport in Rio de Janeiro, which was ranked greater than 6 and had more than 5,099,643 total passengers?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"capacity\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"rank\">6 AND \"location\"='rio de janeiro' AND \"total_passengers\">'5,099,643';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity\" real,\n \"capacity_in_use\" text\n);\n\nQuestion: What is the capacity in use of the airport in Rio de Janeiro with an annual change of 40.53%?"
},
{
"role": "assistant",
"content": "SELECT \"capacity_in_use\" FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"location\"='rio de janeiro' AND \"annual_change\"='40.53%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of Silver when the total is less than 6, the rank is 6 and the Bulgaria is the nation?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"silver\") FROM \"medal_table\" WHERE \"total\"<6 AND \"rank\"='6' AND \"nation\"='bulgaria';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What nation has a bronze of 2 with a total less than 5 and rank of 6?"
},
{
"role": "assistant",
"content": "SELECT \"nation\" FROM \"medal_table\" WHERE \"bronze\"=2 AND \"total\"<5 AND \"rank\"='6';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest Total for rank 3 with more than 4 gold?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"medal_table\" WHERE \"rank\"='3' AND \"gold\">4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest Total for Italy with less than 0 silver?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"medal_table\" WHERE \"nation\"='italy' AND \"silver\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the Nation with less than 1 silver, and the total is 1, and bronze is less than 0?"
},
{
"role": "assistant",
"content": "SELECT \"nation\" FROM \"medal_table\" WHERE \"silver\"<1 AND \"total\"=1 AND \"bronze\"=0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"b\" (\n \"name\" text,\n \"position\" text,\n \"number\" text,\n \"season\" text,\n \"acquisition_via\" text\n);\n\nQuestion: What number has 2002-2003 as the season?"
},
{
"role": "assistant",
"content": "SELECT \"number\" FROM \"b\" WHERE \"season\"='2002-2003';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"b\" (\n \"name\" text,\n \"position\" text,\n \"number\" text,\n \"season\" text,\n \"acquisition_via\" text\n);\n\nQuestion: What position has 2008 as the season?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"b\" WHERE \"season\"='2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"b\" (\n \"name\" text,\n \"position\" text,\n \"number\" text,\n \"season\" text,\n \"acquisition_via\" text\n);\n\nQuestion: What name has 50 as the number?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"b\" WHERE \"number\"='50';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"b\" (\n \"name\" text,\n \"position\" text,\n \"number\" text,\n \"season\" text,\n \"acquisition_via\" text\n);\n\nQuestion: What number has 2008 as the season?"
},
{
"role": "assistant",
"content": "SELECT \"number\" FROM \"b\" WHERE \"season\"='2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"b\" (\n \"name\" text,\n \"position\" text,\n \"number\" text,\n \"season\" text,\n \"acquisition_via\" text\n);\n\nQuestion: What name has 8 as the number?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"b\" WHERE \"number\"='8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"b\" (\n \"name\" text,\n \"position\" text,\n \"number\" text,\n \"season\" text,\n \"acquisition_via\" text\n);\n\nQuestion: What position has ronjay buenafe as the name?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"b\" WHERE \"name\"='ronjay buenafe';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"att\" real,\n \"yards\" real,\n \"avg\" real,\n \"long\" real,\n \"fum_l\" real\n);\n\nQuestion: What was the lowest long with 26 yards?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"long\") FROM \"rushing\" WHERE \"yards\"=26;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"att\" real,\n \"yards\" real,\n \"avg\" real,\n \"long\" real,\n \"fum_l\" real\n);\n\nQuestion: What was the highest average when Fuml was 0?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"avg\") FROM \"rushing\" WHERE \"fum_l\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"esiliiga\" (\n \"club\" text,\n \"2012\" text,\n \"seasons_in_esiliiga\" real,\n \"current_run_since\" real,\n \"titles\" real,\n \"last_title\" text\n);\n\nQuestion: What is the highest run currently since the last title in 2010, and a season in Esiliiga larger than 10?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"current_run_since\") FROM \"esiliiga\" WHERE \"last_title\"='2010' AND \"seasons_in_esiliiga\">10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"esiliiga\" (\n \"club\" text,\n \"2012\" text,\n \"seasons_in_esiliiga\" real,\n \"current_run_since\" real,\n \"titles\" real,\n \"last_title\" text\n);\n\nQuestion: What is the 2012 season in Esiliiga more than 4, and more than 0 titles?"
},
{
"role": "assistant",
"content": "SELECT \"2012\" FROM \"esiliiga\" WHERE \"seasons_in_esiliiga\">4 AND \"titles\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"economic_data\" (\n \"country\" text,\n \"population\" real,\n \"gdp_2011_in_millions_usd\" real,\n \"gdp_2012_in_millions_usd\" real,\n \"per_capita\" real\n);\n\nQuestion: What is the population on average with a per capita of 1,158, and a 2011 GDP less than 6,199?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"population\") FROM \"economic_data\" WHERE \"per_capita\"='1,158' AND \"gdp_2011_in_millions_usd\"<'6,199';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_stats\" (\n \"season\" text,\n \"pat_pct\" text,\n \"20_29\" text,\n \"30_39\" text,\n \"40_49\" text,\n \"fg_fga\" text,\n \"fg_pct\" text,\n \"long\" real,\n \"points\" real\n);\n\nQuestion: What 20-29 was in season 2008?"
},
{
"role": "assistant",
"content": "SELECT \"20_29\" FROM \"career_stats\" WHERE \"season\"='2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_stats\" (\n \"season\" text,\n \"pat_pct\" text,\n \"20_29\" text,\n \"30_39\" text,\n \"40_49\" text,\n \"fg_fga\" text,\n \"fg_pct\" text,\n \"long\" real,\n \"points\" real\n);\n\nQuestion: What were the lowest amount of points for season 1994?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"career_stats\" WHERE \"season\"='1994';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"career_stats\" (\n \"season\" text,\n \"pat_pct\" text,\n \"20_29\" text,\n \"30_39\" text,\n \"40_49\" text,\n \"fg_fga\" text,\n \"fg_pct\" text,\n \"long\" real,\n \"points\" real\n);\n\nQuestion: Which 20-29 had a season of 1997?"
},
{
"role": "assistant",
"content": "SELECT \"20_29\" FROM \"career_stats\" WHERE \"season\"='1997';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"birthdate\" text,\n \"birthplace\" text,\n \"club_team\" text\n);\n\nQuestion: What is the Postion, when the Name is Rod Paavola?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"name\"='rod paavola';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"birthdate\" text,\n \"birthplace\" text,\n \"club_team\" text\n);\n\nQuestion: What is the total number of Jersey #, when the Position is W, and when the Birthdate is 17 October 1932?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"jersey_num\") FROM \"list_of_united_states_national_ice_hocke\" WHERE \"position\"='w' AND \"birthdate\"='17 october 1932';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"birthdate\" text,\n \"birthplace\" text,\n \"club_team\" text\n);\n\nQuestion: What is the Birthplace, when the Name is Bob Mcvey?"
},
{
"role": "assistant",
"content": "SELECT \"birthplace\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"name\"='bob mcvey';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"birthdate\" text,\n \"birthplace\" text,\n \"club_team\" text\n);\n\nQuestion: What is the Name, when the Position is W, and when the Jersey # is 11?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"position\"='w' AND \"jersey_num\"=11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"birthdate\" text,\n \"birthplace\" text,\n \"club_team\" text\n);\n\nQuestion: What is the Postion, when the Club/Team is Warroad Lakers, and when the Name is Roger Christian?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"club_team\"='warroad lakers' AND \"name\"='roger christian';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_twelve\" (\n \"date\" text,\n \"time\" text,\n \"home\" text,\n \"away\" text,\n \"score\" text,\n \"ground\" text\n);\n\nQuestion: What home has 122-28 as the score?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"round_twelve\" WHERE \"score\"='122-28';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_twelve\" (\n \"date\" text,\n \"time\" text,\n \"home\" text,\n \"away\" text,\n \"score\" text,\n \"ground\" text\n);\n\nQuestion: What ground has etobicoke kangaroos as the home?"
},
{
"role": "assistant",
"content": "SELECT \"ground\" FROM \"round_twelve\" WHERE \"home\"='etobicoke kangaroos';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_twelve\" (\n \"date\" text,\n \"time\" text,\n \"home\" text,\n \"away\" text,\n \"score\" text,\n \"ground\" text\n);\n\nQuestion: What time has humber college north as the ground, and toronto downtown dingos as the home?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"round_twelve\" WHERE \"ground\"='humber college north' AND \"home\"='toronto downtown dingos';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_twelve\" (\n \"date\" text,\n \"time\" text,\n \"home\" text,\n \"away\" text,\n \"score\" text,\n \"ground\" text\n);\n\nQuestion: What score has Toronto Eagles as the home?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"round_twelve\" WHERE \"home\"='toronto eagles';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_twelve\" (\n \"date\" text,\n \"time\" text,\n \"home\" text,\n \"away\" text,\n \"score\" text,\n \"ground\" text\n);\n\nQuestion: What date has high park demons as the away?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_twelve\" WHERE \"away\"='high park demons';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_twelve\" (\n \"date\" text,\n \"time\" text,\n \"home\" text,\n \"away\" text,\n \"score\" text,\n \"ground\" text\n);\n\nQuestion: What away has toronto downtown dingos as the home?"
},
{
"role": "assistant",
"content": "SELECT \"away\" FROM \"round_twelve\" WHERE \"home\"='toronto downtown dingos';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: Who was the winner from the Rip Curl Pro Search?"
},
{
"role": "assistant",
"content": "SELECT \"winner\" FROM \"tournaments\" WHERE \"event\"='rip curl pro search';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What was the location of the tournament held in Spain?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"tournaments\" WHERE \"country\"='spain';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournaments\" (\n \"date\" text,\n \"location\" text,\n \"country\" text,\n \"event\" text,\n \"winner\" text,\n \"runner_up\" text\n);\n\nQuestion: What was the date of the tournament held in Indonesia?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"tournaments\" WHERE \"country\"='indonesia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_paulista\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: What is the average Lost when the difference is - 3, and a Played is less than 10?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"lost\") FROM \"campeonato_paulista\" WHERE \"difference\"='- 3' AND \"played\"<10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_paulista\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: What is the Position when the Drawn is less than 2, with a Difference of 2?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"campeonato_paulista\" WHERE \"drawn\"<2 AND \"difference\"='2';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_paulista\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: What is the sum of Against when the drawn is less than 2, the position is more than 8, and the lost is more than 6."
},
{
"role": "assistant",
"content": "SELECT SUM(\"against\") FROM \"campeonato_paulista\" WHERE \"drawn\"<2 AND \"position\">8 AND \"lost\">6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"campeonato_paulista\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: What is the Difference with a position of less than 3, and, 17 points."
},
{
"role": "assistant",
"content": "SELECT \"difference\" FROM \"campeonato_paulista\" WHERE \"position\"<3 AND \"points\"=17;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average Top-5, when Tournament is U.S. Open, and when Cuts Made is greater than 10?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"top_5\") FROM \"summary\" WHERE \"tournament\"='u.s. open' AND \"cuts_made\">10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the sum of Events, when Top-10 is 7, and when Top-5 is greater than 4?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"events\") FROM \"summary\" WHERE \"top_10\"=7 AND \"top_5\">4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the sum of Top-5, when Tournament is Totals, and when Events is greater than 86?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"top_5\") FROM \"summary\" WHERE \"tournament\"='totals' AND \"events\">86;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average Top-10, when Wins is less than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"top_10\") FROM \"summary\" WHERE \"wins\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the total number of Top-25, when Events is greater than 86?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"top_25\") FROM \"summary\" WHERE \"events\">86;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text\n);\n\nQuestion: What 2011 has 4r as the 2008?"
},
{
"role": "assistant",
"content": "SELECT \"2011\" FROM \"singles_performance_timeline\" WHERE \"2008\"='4r';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text\n);\n\nQuestion: What 2007 has wimbledon as the tournament?"
},
{
"role": "assistant",
"content": "SELECT \"2007\" FROM \"singles_performance_timeline\" WHERE \"tournament\"='wimbledon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text\n);\n\nQuestion: What 2006 has 1r as the 2007?"
},
{
"role": "assistant",
"content": "SELECT \"2006\" FROM \"singles_performance_timeline\" WHERE \"2007\"='1r';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text\n);\n\nQuestion: What tournament has q2 as the 2004?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"singles_performance_timeline\" WHERE \"2004\"='q2';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text\n);\n\nQuestion: What 2009 has grand slam tournaments of 2008?"
},
{
"role": "assistant",
"content": "SELECT \"2009\" FROM \"singles_performance_timeline\" WHERE \"2008\"='grand slam tournaments';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2004\" text,\n \"2005\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text\n);\n\nQuestion: What 2006 has 0-0 as the 2011?"
},
{
"role": "assistant",
"content": "SELECT \"2006\" FROM \"singles_performance_timeline\" WHERE \"2011\"='0-0';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"matches_and_goals_scored_at_world_cup_an\" (\n \"match\" text,\n \"date\" text,\n \"location\" text,\n \"lineup\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: What is the Lineup from a Match that is 27?"
},
{
"role": "assistant",
"content": "SELECT \"lineup\" FROM \"matches_and_goals_scored_at_world_cup_an\" WHERE \"match\"='27';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"number\" real,\n \"name\" text,\n \"builder\" text,\n \"type\" text,\n \"date\" text,\n \"works_number\" text\n);\n\nQuestion: What is the date for Orangeville?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"locomotives\" WHERE \"name\"='orangeville';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"number\" real,\n \"name\" text,\n \"builder\" text,\n \"type\" text,\n \"date\" text,\n \"works_number\" text\n);\n\nQuestion: Who is the builder with a works number of 2534?"
},
{
"role": "assistant",
"content": "SELECT \"builder\" FROM \"locomotives\" WHERE \"works_number\"='2534';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"number\" real,\n \"name\" text,\n \"builder\" text,\n \"type\" text,\n \"date\" text,\n \"works_number\" text\n);\n\nQuestion: Who is the name with a works number of 809?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"locomotives\" WHERE \"works_number\"='809';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"number\" real,\n \"name\" text,\n \"builder\" text,\n \"type\" text,\n \"date\" text,\n \"works_number\" text\n);\n\nQuestion: In early 1873, Owen sound had what works number?"
},
{
"role": "assistant",
"content": "SELECT \"works_number\" FROM \"locomotives\" WHERE \"date\"='early 1873' AND \"name\"='owen sound';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"number\" real,\n \"name\" text,\n \"builder\" text,\n \"type\" text,\n \"date\" text,\n \"works_number\" text\n);\n\nQuestion: What was the name for the locomotive with a type of 2-8-0 and a number of 20?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"locomotives\" WHERE \"type\"='2-8-0' AND \"number\"=20;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the Year won for the player with a larger than 4 To par and less the 157 Total?"
},
{
"role": "assistant",
"content": "SELECT \"year_won\" FROM \"missed_the_cut\" WHERE \"to_par\">4 AND \"total\"<157;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the Total for the Player who won after 1983 with less than 4 To par?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"missed_the_cut\" WHERE \"to_par\"<4 AND \"year_won\">1983;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the Total of the player who won before 1983 with a smaller than 4 To par?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") FROM \"missed_the_cut\" WHERE \"to_par\"<4 AND \"year_won\"<1983;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"england_in_south_africa_1913_4\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: Which venue led to a draw?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"england_in_south_africa_1913_4\" WHERE \"result\"='draw';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"standings\" (\n \"nation\" text,\n \"skip\" text,\n \"ends_won\" real,\n \"ends_lost\" real,\n \"blank_ends\" real,\n \"stolen_ends\" real,\n \"shot_pct\" text\n);\n\nQuestion: What is the highest Stolen Ends when ludmila privivkova shows for skip?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"stolen_ends\") FROM \"standings\" WHERE \"skip\"='ludmila privivkova';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"standings\" (\n \"nation\" text,\n \"skip\" text,\n \"ends_won\" real,\n \"ends_lost\" real,\n \"blank_ends\" real,\n \"stolen_ends\" real,\n \"shot_pct\" text\n);\n\nQuestion: What is the sum of Blank Ends for Denmark when less than 42 is the ends lost?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"blank_ends\") FROM \"standings\" WHERE \"nation\"='denmark' AND \"ends_lost\"<42;"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.