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 \"1482_1700\" (\n \"name\" text,\n \"father\" text,\n \"birth\" text,\n \"marriage\" text,\n \"became_countess\" text,\n \"ceased_to_be_countess\" text,\n \"death\" text,\n \"spouse\" text\n);\n\nQuestion: When did elisabeth of valois die?"
},
{
"role": "assistant",
"content": "SELECT \"death\" FROM \"1482_1700\" WHERE \"name\"='elisabeth of valois';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: Who is entered earlier than 1975 and has a Lotus 20 chassis?"
},
{
"role": "assistant",
"content": "SELECT \"entrant\" FROM \"complete_formula_one_world_championship_\" WHERE \"year\"<1975 AND \"chassis\"='lotus 20';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: Which engine has a Lotus 49c chassis?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"complete_formula_one_world_championship_\" WHERE \"chassis\"='lotus 49c';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What are the average points of Scuderia Scribante with a Brabham bt11 chassis before 1968?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"points\") FROM \"complete_formula_one_world_championship_\" WHERE \"entrant\"='scuderia scribante' AND \"chassis\"='brabham bt11' AND \"year\"<1968;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: How many points are there for a Mclaren m23 chassis later than 1972?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"points\") FROM \"complete_formula_one_world_championship_\" WHERE \"year\">1972 AND \"chassis\"='mclaren m23';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"rural_municipality_rm\" text,\n \"rm_no\" text,\n \"sarm_div_no\" text,\n \"census_div_no\" text,\n \"population_2011\" real,\n \"population_2006\" real,\n \"change_pct\" real,\n \"land_area_km\" real,\n \"population_density_per_km\" real\n);\n\nQuestion: What is the average change to have a land area of 546.74 and a population density greater than 0.5?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"change_pct\") FROM \"list\" WHERE \"land_area_km\"=546.74 AND \"population_density_per_km\">0.5;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What was the result after 1994 for team MB2 and 31 starts?"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"daytona_500_results\" WHERE \"year\">1994 AND \"team\"='mb2' AND \"start\"='31';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What team has 33 starts?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"daytona_500_results\" WHERE \"start\"='33';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What team finished 35 in a ford before 1997?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"daytona_500_results\" WHERE \"year\"<1997 AND \"manufacturer\"='ford' AND \"finish\"='35';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"venue\" text,\n \"winner\" text,\n \"country\" text,\n \"score\" real\n);\n\nQuestion: What was the sum of the scores before the year 2002, that had the venue of Halmstad?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"score\") FROM \"winners\" WHERE \"venue\"='halmstad' AND \"year\"<2002;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"venue\" text,\n \"winner\" text,\n \"country\" text,\n \"score\" real\n);\n\nQuestion: What was France's highest score when the venue was Bokskogens?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"score\") FROM \"winners\" WHERE \"country\"='france' AND \"venue\"='bokskogens';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"venue\" text,\n \"winner\" text,\n \"country\" text,\n \"score\" real\n);\n\nQuestion: What was the earliest year during which the winner was Matthew King, and during which the score was higher than 270?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"winners\" WHERE \"winner\"='matthew king' AND \"score\">270;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"venue\" text,\n \"winner\" text,\n \"country\" text,\n \"score\" real\n);\n\nQuestion: What was the average year during which the score was 270?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"winners\" WHERE \"score\"=270;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"venue\" text,\n \"winner\" text,\n \"country\" text,\n \"score\" real\n);\n\nQuestion: What were the total number scores after 2005, when the winner was David Patrick?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"score\") FROM \"winners\" WHERE \"winner\"='david patrick' AND \"year\">2005;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"venue\" text,\n \"winner\" text,\n \"country\" text,\n \"score\" real\n);\n\nQuestion: What was the average year that the venue was Bokskogens?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"winners\" WHERE \"venue\"='bokskogens';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who did the Toronto Blue Jays play against where the score was 4 - 2?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"score\"='4 - 2';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who did the Blue Jays play against on April 11?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"date\"='april 11';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who did the Blue Jays play against on April 24?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"date\"='april 24';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_rankings\" (\n \"rank\" real,\n \"team\" text,\n \"country\" text,\n \"value_m\" real,\n \"debt_as_pctof_value\" real,\n \"pct_change_on_year\" text,\n \"revenue_m\" real,\n \"operating_income_m\" real\n);\n\nQuestion: What was the average Value ($M) when the Country was England, the Operating income($m) was greater than -5, and the Revenue ($M) was smaller than 103?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"value_m\") FROM \"2008_rankings\" WHERE \"country\"='england' AND \"operating_income_m\">-5 AND \"revenue_m\"<103;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_rankings\" (\n \"rank\" real,\n \"team\" text,\n \"country\" text,\n \"value_m\" real,\n \"debt_as_pctof_value\" real,\n \"pct_change_on_year\" text,\n \"revenue_m\" real,\n \"operating_income_m\" real\n);\n\nQuestion: What was the total amount of Value ($M), when the Country was Spain, the Rank was 19, and the Debt as % of value was larger than 159?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"value_m\") FROM \"2008_rankings\" WHERE \"country\"='spain' AND \"rank\"=19 AND \"debt_as_pctof_value\">159;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_rankings\" (\n \"rank\" real,\n \"team\" text,\n \"country\" text,\n \"value_m\" real,\n \"debt_as_pctof_value\" real,\n \"pct_change_on_year\" text,\n \"revenue_m\" real,\n \"operating_income_m\" real\n);\n\nQuestion: What was the sum of Value ($M), when the Revenue ($M) was less than 307, the Team was Valencia, and the Rank was smaller than 19?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"value_m\") FROM \"2008_rankings\" WHERE \"revenue_m\"<307 AND \"team\"='valencia' AND \"rank\"<19;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_rankings\" (\n \"rank\" real,\n \"team\" text,\n \"country\" text,\n \"value_m\" real,\n \"debt_as_pctof_value\" real,\n \"pct_change_on_year\" text,\n \"revenue_m\" real,\n \"operating_income_m\" real\n);\n\nQuestion: What was the total amount of Value ($M), when the Rank was higher than 6, and the % change on year was -27?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"value_m\") FROM \"2008_rankings\" WHERE \"rank\">6 AND \"pct_change_on_year\"='-27';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_rankings\" (\n \"rank\" real,\n \"team\" text,\n \"country\" text,\n \"value_m\" real,\n \"debt_as_pctof_value\" real,\n \"pct_change_on_year\" text,\n \"revenue_m\" real,\n \"operating_income_m\" real\n);\n\nQuestion: What was the sum of Revenue ($M), when the Debt as % of value was higher than 27, and the Operating income($m) was 77?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"revenue_m\") FROM \"2008_rankings\" WHERE \"debt_as_pctof_value\">27 AND \"operating_income_m\"=77;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"negotiation_progress\" (\n \"screening_started\" text,\n \"screening_completed\" text,\n \"chapter_unfrozen\" text,\n \"chapter_opened\" text,\n \"chapter_closed\" text\n);\n\nQuestion: Name the screening completed for screening started 23 january 2006"
},
{
"role": "assistant",
"content": "SELECT \"screening_completed\" FROM \"negotiation_progress\" WHERE \"screening_started\"='23 january 2006';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"negotiation_progress\" (\n \"screening_started\" text,\n \"screening_completed\" text,\n \"chapter_unfrozen\" text,\n \"chapter_opened\" text,\n \"chapter_closed\" text\n);\n\nQuestion: Name the screening started when it was completed 3 may 2006"
},
{
"role": "assistant",
"content": "SELECT \"screening_started\" FROM \"negotiation_progress\" WHERE \"screening_completed\"='3 may 2006';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_nominations\" (\n \"year\" real,\n \"ceremony\" text,\n \"result\" text,\n \"award\" text,\n \"work\" text\n);\n\nQuestion: What award was Trent Tesoro nominated for in 2007?"
},
{
"role": "assistant",
"content": "SELECT \"award\" FROM \"awards_nominations\" WHERE \"result\"='nominated' AND \"year\"=2007;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"site\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What is the score for the team that has a record of 80-64?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"record\"='80-64';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indianapolis_500_results\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What position did team scandia finish when their engine was cosworth?"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"indianapolis_500_results\" WHERE \"engine\"='cosworth' AND \"team\"='team scandia';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indianapolis_500_results\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What was the position of the team that used an oldsmobile engine and DNQ?"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"indianapolis_500_results\" WHERE \"engine\"='oldsmobile' AND \"start\"='dnq';"
}
]
|
[
{
"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 least bronze when gold is more than 0 for russia?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"bronze\") FROM \"medal_table\" WHERE \"gold\">0 AND \"nation\"='russia';"
}
]
|
[
{
"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 highest rank for italy when gold is more than 1?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"medal_table\" WHERE \"nation\"='italy' AND \"gold\">1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: what is the total when bronze is more than 1 and gold smaller than 1?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"total\") FROM \"medal_table\" WHERE \"bronze\">1 AND \"gold\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"sigma_mass_storage_devices\" (\n \"device\" real,\n \"device_type\" text,\n \"capacity_mb\" text,\n \"avg_seek_time_ms\" text,\n \"avg_rotational_delay_ms\" real,\n \"avg_transfer_rate_k_b_s\" real\n);\n\nQuestion: What is the avg seek time for a device that is less than 3231?"
},
{
"role": "assistant",
"content": "SELECT \"avg_seek_time_ms\" FROM \"sigma_mass_storage_devices\" WHERE \"device\"<3231;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"sigma_mass_storage_devices\" (\n \"device\" real,\n \"device_type\" text,\n \"capacity_mb\" text,\n \"avg_seek_time_ms\" text,\n \"avg_rotational_delay_ms\" real,\n \"avg_transfer_rate_k_b_s\" real\n);\n\nQuestion: What is the smallest transfer rate for a 3243 device?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"avg_transfer_rate_k_b_s\") FROM \"sigma_mass_storage_devices\" WHERE \"device\"=3243;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: Which entrant has a year after 1955?"
},
{
"role": "assistant",
"content": "SELECT \"entrant\" FROM \"complete_formula_one_world_championship_\" WHERE \"year\">1955;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: How many draws has a Club of real valladolid that was played less than 38?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"draws\") FROM \"final_table\" WHERE \"club\"='real valladolid' AND \"played\"<38;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: How many losses are there with 5 goal differences, drew more than 10 times, and 43 goals against?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"losses\") FROM \"final_table\" WHERE \"goal_difference\"=5 AND \"draws\">10 AND \"goals_against\"=43;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"award_show\" text,\n \"category\" text,\n \"recipient_s\" text,\n \"result\" text\n);\n\nQuestion: On which award show was Bad Girls nominated for Most Popular Drama in 2004?"
},
{
"role": "assistant",
"content": "SELECT \"award_show\" FROM \"awards_and_nominations\" WHERE \"year\"=2004 AND \"category\"='most popular drama';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"award_show\" text,\n \"category\" text,\n \"recipient_s\" text,\n \"result\" text\n);\n\nQuestion: Who was the recipient when the show was nominated for Most Popular Drama after 2004?"
},
{
"role": "assistant",
"content": "SELECT \"recipient_s\" FROM \"awards_and_nominations\" WHERE \"result\"='nominated' AND \"category\"='most popular drama' AND \"year\">2004;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"award_show\" text,\n \"category\" text,\n \"recipient_s\" text,\n \"result\" text\n);\n\nQuestion: In what award show was Bad Girls nominated for Best Loved Drama in 2002?"
},
{
"role": "assistant",
"content": "SELECT \"award_show\" FROM \"awards_and_nominations\" WHERE \"category\"='best loved drama' AND \"year\"=2002;"
}
]
|
[
{
"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 number of medals for a nation with 2 silver medals and a rank larger than 7?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"medal_table\" WHERE \"silver\"=2 AND \"rank\">7;"
}
]
|
[
{
"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 lowest rank of Ukraine with fewer than 14 silver medals, fewer than 3 bronze medals, and a total of 4 medals?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rank\") FROM \"medal_table\" WHERE \"silver\"<14 AND \"bronze\"<3 AND \"total\"=4 AND \"nation\"='ukraine';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total of bronze medals from nations with more than 16 total medals and ranks larger than 3?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"bronze\") FROM \"medal_table\" WHERE \"total\"=16 AND \"rank\">3;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total number of bronze medals with a total of 4 medals and 1 gold medal?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"bronze\") FROM \"medal_table\" WHERE \"total\"=4 AND \"gold\"=1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indy_500_results\" (\n \"year\" text,\n \"start\" text,\n \"qual\" text,\n \"rank\" text,\n \"finish\" text,\n \"laps\" real\n);\n\nQuestion: What was the qualification with more than 162 laps in 1953?"
},
{
"role": "assistant",
"content": "SELECT \"qual\" FROM \"indy_500_results\" WHERE \"laps\">162 AND \"year\"='1953';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indy_500_results\" (\n \"year\" text,\n \"start\" text,\n \"qual\" text,\n \"rank\" text,\n \"finish\" text,\n \"laps\" real\n);\n\nQuestion: What was the qualification with more than 585 laps?"
},
{
"role": "assistant",
"content": "SELECT \"qual\" FROM \"indy_500_results\" WHERE \"laps\"=585;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indy_500_results\" (\n \"year\" text,\n \"start\" text,\n \"qual\" text,\n \"rank\" text,\n \"finish\" text,\n \"laps\" real\n);\n\nQuestion: How many laps had a qualification of 136.168?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"laps\") FROM \"indy_500_results\" WHERE \"qual\"='136.168';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"representative\" text,\n \"title\" text,\n \"presentation_of_credentials\" text,\n \"termination_of_mission\" text,\n \"appointed_by\" text\n);\n\nQuestion: Who was appointed with the title of envoy extraordinary and minister plenipotentiary, and a termination of mission of march 16, 1905?"
},
{
"role": "assistant",
"content": "SELECT \"appointed_by\" FROM \"see_also\" WHERE \"title\"='envoy extraordinary and minister plenipotentiary' AND \"termination_of_mission\"='march 16, 1905';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_enlargement\" (\n \"member_countries\" text,\n \"population\" text,\n \"area_km\" text,\n \"gdp_billion_us\" text,\n \"gdp_per_capita_us\" text\n);\n\nQuestion: What is the GDP (billion US$) of the country that has a GDP per capita (US$) of 8,861?"
},
{
"role": "assistant",
"content": "SELECT \"gdp_billion_us\" FROM \"2004_enlargement\" WHERE \"gdp_per_capita_us\"='8,861';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_enlargement\" (\n \"member_countries\" text,\n \"population\" text,\n \"area_km\" text,\n \"gdp_billion_us\" text,\n \"gdp_per_capita_us\" text\n);\n\nQuestion: What is the name of the member country that has a Population of 1,341,664?"
},
{
"role": "assistant",
"content": "SELECT \"member_countries\" FROM \"2004_enlargement\" WHERE \"population\"='1,341,664';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_enlargement\" (\n \"member_countries\" text,\n \"population\" text,\n \"area_km\" text,\n \"gdp_billion_us\" text,\n \"gdp_per_capita_us\" text\n);\n\nQuestion: What is the total population of the country that has a GDP per capita (US$) of 15,054?"
},
{
"role": "assistant",
"content": "SELECT \"population\" FROM \"2004_enlargement\" WHERE \"gdp_per_capita_us\"='15,054';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_enlargement\" (\n \"member_countries\" text,\n \"population\" text,\n \"area_km\" text,\n \"gdp_billion_us\" text,\n \"gdp_per_capita_us\" text\n);\n\nQuestion: What is the name of the country that has an Area (km\u00b2) of 49,036?"
},
{
"role": "assistant",
"content": "SELECT \"member_countries\" FROM \"2004_enlargement\" WHERE \"area_km\"='49,036';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_enlargement\" (\n \"member_countries\" text,\n \"population\" text,\n \"area_km\" text,\n \"gdp_billion_us\" text,\n \"gdp_per_capita_us\" text\n);\n\nQuestion: What is the GDP (billion US$) of the country that has an Area (km\u00b2) of 316?"
},
{
"role": "assistant",
"content": "SELECT \"gdp_billion_us\" FROM \"2004_enlargement\" WHERE \"area_km\"='316';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_enlargement\" (\n \"member_countries\" text,\n \"population\" text,\n \"area_km\" text,\n \"gdp_billion_us\" text,\n \"gdp_per_capita_us\" text\n);\n\nQuestion: What is the GDP per capita (US$) of the country that has a Population of 2,011,473?"
},
{
"role": "assistant",
"content": "SELECT \"gdp_per_capita_us\" FROM \"2004_enlargement\" WHERE \"population\"='2,011,473';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"country\" text,\n \"film_title_used_in_nomination\" text,\n \"language\" text,\n \"original_title\" text,\n \"director\" text\n);\n\nQuestion: What is the original title for the Korean language film?"
},
{
"role": "assistant",
"content": "SELECT \"original_title\" FROM \"references\" WHERE \"language\"='korean';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"country\" text,\n \"film_title_used_in_nomination\" text,\n \"language\" text,\n \"original_title\" text,\n \"director\" text\n);\n\nQuestion: What language is the film La Diagonale du Fou in?"
},
{
"role": "assistant",
"content": "SELECT \"language\" FROM \"references\" WHERE \"original_title\"='la diagonale du fou';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"country\" text,\n \"film_title_used_in_nomination\" text,\n \"language\" text,\n \"original_title\" text,\n \"director\" text\n);\n\nQuestion: What was the original title of the Hindi film?"
},
{
"role": "assistant",
"content": "SELECT \"original_title\" FROM \"references\" WHERE \"language\"='hindi';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"country\" text,\n \"film_title_used_in_nomination\" text,\n \"language\" text,\n \"original_title\" text,\n \"director\" text\n);\n\nQuestion: What language is the film Karnal in?"
},
{
"role": "assistant",
"content": "SELECT \"language\" FROM \"references\" WHERE \"original_title\"='karnal';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"country\" text,\n \"film_title_used_in_nomination\" text,\n \"language\" text,\n \"original_title\" text,\n \"director\" text\n);\n\nQuestion: What was the film title nominated from the Netherlands?"
},
{
"role": "assistant",
"content": "SELECT \"film_title_used_in_nomination\" FROM \"references\" WHERE \"country\"='netherlands';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"country\" text,\n \"film_title_used_in_nomination\" text,\n \"language\" text,\n \"original_title\" text,\n \"director\" text\n);\n\nQuestion: What was the film title nominated from the Sweden?"
},
{
"role": "assistant",
"content": "SELECT \"film_title_used_in_nomination\" FROM \"references\" WHERE \"country\"='sweden';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: On the Date of 15 June 1992 what is the Score that is listed?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"international_goals\" WHERE \"date\"='15 june 1992';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notes_and_references\" (\n \"school\" text,\n \"location\" text,\n \"total\" real,\n \"crimean_war\" real,\n \"persian_war\" real,\n \"indian_mutiny\" real,\n \"1860_1878\" real,\n \"zulu_war\" real,\n \"second_afghan_war\" text\n);\n\nQuestion: How many Persian Wars have a School of rashtriya indian military college, and an 1860-1878 smaller than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"persian_war\") FROM \"notes_and_references\" WHERE \"school\"='rashtriya indian military college' AND \"1860_1878\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notes_and_references\" (\n \"school\" text,\n \"location\" text,\n \"total\" real,\n \"crimean_war\" real,\n \"persian_war\" real,\n \"indian_mutiny\" real,\n \"1860_1878\" real,\n \"zulu_war\" real,\n \"second_afghan_war\" text\n);\n\nQuestion: What is the largest Persian War with a Crimean War of 0, an 1860-1878 larger than 0, a Location of united kingdom, and a Zulu War smaller than 1?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"persian_war\") FROM \"notes_and_references\" WHERE \"crimean_war\"=0 AND \"1860_1878\">0 AND \"location\"='united kingdom' AND \"zulu_war\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notes_and_references\" (\n \"school\" text,\n \"location\" text,\n \"total\" real,\n \"crimean_war\" real,\n \"persian_war\" real,\n \"indian_mutiny\" real,\n \"1860_1878\" real,\n \"zulu_war\" real,\n \"second_afghan_war\" text\n);\n\nQuestion: What is the average Crimean War with a Second Afghan War totaling 1, and a School of hamblin and porter's school, cork?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"crimean_war\") FROM \"notes_and_references\" WHERE \"second_afghan_war\"='1' AND \"school\"='hamblin and porter''s school, cork';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notes_and_references\" (\n \"school\" text,\n \"location\" text,\n \"total\" real,\n \"crimean_war\" real,\n \"persian_war\" real,\n \"indian_mutiny\" real,\n \"1860_1878\" real,\n \"zulu_war\" real,\n \"second_afghan_war\" text\n);\n\nQuestion: Which Crimean War has a 1860-1878 of 0, a Total of 1, and an Indian Mutiny larger than 0?"
},
{
"role": "assistant",
"content": "SELECT \"crimean_war\" FROM \"notes_and_references\" WHERE \"1860_1878\"=0 AND \"total\"=1 AND \"indian_mutiny\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notes_and_references\" (\n \"school\" text,\n \"location\" text,\n \"total\" real,\n \"crimean_war\" real,\n \"persian_war\" real,\n \"indian_mutiny\" real,\n \"1860_1878\" real,\n \"zulu_war\" real,\n \"second_afghan_war\" text\n);\n\nQuestion: Which school has an 1860-1878 larger than 0, and a Second Afghan War of 0?"
},
{
"role": "assistant",
"content": "SELECT \"school\" FROM \"notes_and_references\" WHERE \"1860_1878\">0 AND \"second_afghan_war\"='0';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"saint_petersburg_teams\" (\n \"club\" text,\n \"league\" text,\n \"sport\" text,\n \"venue\" text,\n \"established\" real\n);\n\nQuestion: What Venue has Basketball as a Sport?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"saint_petersburg_teams\" WHERE \"sport\"='basketball';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"saint_petersburg_teams\" (\n \"club\" text,\n \"league\" text,\n \"sport\" text,\n \"venue\" text,\n \"established\" real\n);\n\nQuestion: What Venue has Spartak St. Petersburg Club?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"saint_petersburg_teams\" WHERE \"club\"='spartak st. petersburg';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"saint_petersburg_teams\" (\n \"club\" text,\n \"league\" text,\n \"sport\" text,\n \"venue\" text,\n \"established\" real\n);\n\nQuestion: What League of VSL Sport was Established in 1935?"
},
{
"role": "assistant",
"content": "SELECT \"sport\" FROM \"saint_petersburg_teams\" WHERE \"established\"=1935 AND \"league\"='vsl';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"saint_petersburg_teams\" (\n \"club\" text,\n \"league\" text,\n \"sport\" text,\n \"venue\" text,\n \"established\" real\n);\n\nQuestion: What Club Established in 2010 has a League of MHL?"
},
{
"role": "assistant",
"content": "SELECT \"club\" FROM \"saint_petersburg_teams\" WHERE \"league\"='mhl' AND \"established\"=2010;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"record\" text,\n \"attendance\" real\n);\n\nQuestion: What was the highest attendance week 12?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"attendance\") FROM \"schedule\" WHERE \"week\"=12;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"record\" text,\n \"attendance\" real\n);\n\nQuestion: What is the record for the result w 33-3?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"schedule\" WHERE \"result\"='w 33-3';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"members\" (\n \"district\" text,\n \"counties_represented\" text,\n \"delegate\" text,\n \"party\" text,\n \"first_elected\" real,\n \"committee\" text\n);\n\nQuestion: What Committee has the First Elected of 1993?"
},
{
"role": "assistant",
"content": "SELECT \"committee\" FROM \"members\" WHERE \"first_elected\"=1993;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"members\" (\n \"district\" text,\n \"counties_represented\" text,\n \"delegate\" text,\n \"party\" text,\n \"first_elected\" real,\n \"committee\" text\n);\n\nQuestion: What is the total number of First Elected that has counties represented of Anne Arundel, District of 30, and a Ways and Means Committee?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"first_elected\") FROM \"members\" WHERE \"counties_represented\"='anne arundel' AND \"district\"='30' AND \"committee\"='ways and means';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"members\" (\n \"district\" text,\n \"counties_represented\" text,\n \"delegate\" text,\n \"party\" text,\n \"first_elected\" real,\n \"committee\" text\n);\n\nQuestion: What counties represented have a First Elected of 2006 and a Ways and Means Committee?"
},
{
"role": "assistant",
"content": "SELECT \"counties_represented\" FROM \"members\" WHERE \"first_elected\"=2006 AND \"committee\"='ways and means';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"currency\" (\n \"country\" text,\n \"currency\" text,\n \"1_euro\" real,\n \"1_usd\" real,\n \"central_bank\" text\n);\n\nQuestion: For Central Bank of Uruguay, what's the 1USD=?"
},
{
"role": "assistant",
"content": "SELECT \"1_usd\" FROM \"currency\" WHERE \"central_bank\"='central bank of uruguay';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"currency\" (\n \"country\" text,\n \"currency\" text,\n \"1_euro\" real,\n \"1_usd\" real,\n \"central_bank\" text\n);\n\nQuestion: What is the 1USD= that has the Uruguayan Peso (uyu) and 1 Euro is greater than 25.3797?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"1_usd\") FROM \"currency\" WHERE \"currency\"='uruguayan peso (uyu)' AND \"1_euro\">25.3797;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"currency\" (\n \"country\" text,\n \"currency\" text,\n \"1_euro\" real,\n \"1_usd\" real,\n \"central_bank\" text\n);\n\nQuestion: What is the 1USD= in Chile and has 1 Euro greater than 635.134?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"1_usd\") FROM \"currency\" WHERE \"country\"='chile' AND \"1_euro\">635.134;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"currency\" (\n \"country\" text,\n \"currency\" text,\n \"1_euro\" real,\n \"1_usd\" real,\n \"central_bank\" text\n);\n\nQuestion: If the 1USD= 5,916.27, what is the lowest 1 Euro amount?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"1_euro\") FROM \"currency\" WHERE \"1_usd\"='5,916.27';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: What is the venue when the year is after 2001 for the summer olympics?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"achievements\" WHERE \"year\">2001 AND \"competition\"='summer olympics';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What is the total attendance for the August 8 game?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"game_log\" WHERE \"date\"='august 8';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Which opponent led to a 56-59 record?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='56-59';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"super_league_tries\" (\n \"date\" text,\n \"venue\" text,\n \"opponent\" text,\n \"result\" text,\n \"tournament\" text,\n \"scored\" real\n);\n\nQuestion: Where did they play that the score was 22-12?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"super_league_tries\" WHERE \"result\"='22-12';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"title\" text,\n \"role\" text,\n \"language\" text,\n \"notes\" text\n);\n\nQuestion: What language is spoken after 2007 for the role of urvashi mathur?"
},
{
"role": "assistant",
"content": "SELECT \"language\" FROM \"films\" WHERE \"year\">2007 AND \"role\"='urvashi mathur';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"title\" text,\n \"role\" text,\n \"language\" text,\n \"notes\" text\n);\n\nQuestion: What role is spoken in hindi in 2011?"
},
{
"role": "assistant",
"content": "SELECT \"role\" FROM \"films\" WHERE \"language\"='hindi' AND \"year\"=2011;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"title\" text,\n \"role\" text,\n \"language\" text,\n \"notes\" text\n);\n\nQuestion: What is the note section for the role with a language of hindi and a title of miley naa miley hum?"
},
{
"role": "assistant",
"content": "SELECT \"notes\" FROM \"films\" WHERE \"language\"='hindi' AND \"title\"='miley naa miley hum';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"track_listing\" (\n \"title\" text,\n \"english_translation\" text,\n \"lyrics_by\" text,\n \"music_by\" text,\n \"time\" text\n);\n\nQuestion: What is the title of the song that has a translation of Without Me?"
},
{
"role": "assistant",
"content": "SELECT \"title\" FROM \"track_listing\" WHERE \"english_translation\"='without me';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"composition_by_molecule_type\" (\n \"molecule\" text,\n \"percent_of_mass\" text,\n \"mol_weight_daltons\" text,\n \"molecules\" text,\n \"percent_of_molecules\" text\n);\n\nQuestion: what is the molecules when the percent mass is 1.0?"
},
{
"role": "assistant",
"content": "SELECT \"molecules\" FROM \"composition_by_molecule_type\" WHERE \"percent_of_mass\"='1.0';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"composition_by_molecule_type\" (\n \"molecule\" text,\n \"percent_of_mass\" text,\n \"mol_weight_daltons\" text,\n \"molecules\" text,\n \"percent_of_molecules\" text\n);\n\nQuestion: What is the percent of molecules when the mol.weight (daltons) is n/a and the molecule is other s inorganic?"
},
{
"role": "assistant",
"content": "SELECT \"percent_of_molecules\" FROM \"composition_by_molecule_type\" WHERE \"mol_weight_daltons\"='n/a' AND \"molecule\"='other s inorganic';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"composition_by_molecule_type\" (\n \"molecule\" text,\n \"percent_of_mass\" text,\n \"mol_weight_daltons\" text,\n \"molecules\" text,\n \"percent_of_molecules\" text\n);\n\nQuestion: what is the mol.weight (daltons) when the percent of mass is 1.5?"
},
{
"role": "assistant",
"content": "SELECT \"mol_weight_daltons\" FROM \"composition_by_molecule_type\" WHERE \"percent_of_mass\"='1.5';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"composition_by_molecule_type\" (\n \"molecule\" text,\n \"percent_of_mass\" text,\n \"mol_weight_daltons\" text,\n \"molecules\" text,\n \"percent_of_molecules\" text\n);\n\nQuestion: what is the perfect of mass when the molecules is 1.74e14*?"
},
{
"role": "assistant",
"content": "SELECT \"percent_of_mass\" FROM \"composition_by_molecule_type\" WHERE \"molecules\"='1.74e14*';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"composition_by_molecule_type\" (\n \"molecule\" text,\n \"percent_of_mass\" text,\n \"mol_weight_daltons\" text,\n \"molecules\" text,\n \"percent_of_molecules\" text\n);\n\nQuestion: what is the percent of mass when the mol.weight (daltons) is 1e11?"
},
{
"role": "assistant",
"content": "SELECT \"percent_of_mass\" FROM \"composition_by_molecule_type\" WHERE \"mol_weight_daltons\"='1e11';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"top_attendances\" (\n \"rank\" real,\n \"round\" text,\n \"home_team\" text,\n \"away_team\" text,\n \"result\" text,\n \"location\" text,\n \"attendance\" real\n);\n\nQuestion: How many people attended the game when the away team was dynamo kyiv, and a Home team of torpedo zaporizhia?"
},
{
"role": "assistant",
"content": "SELECT \"attendance\" FROM \"top_attendances\" WHERE \"away_team\"='dynamo kyiv' AND \"home_team\"='torpedo zaporizhia';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"top_attendances\" (\n \"rank\" real,\n \"round\" text,\n \"home_team\" text,\n \"away_team\" text,\n \"result\" text,\n \"location\" text,\n \"attendance\" real\n);\n\nQuestion: What was the round when the home team was chornomorets odessa?"
},
{
"role": "assistant",
"content": "SELECT \"round\" FROM \"top_attendances\" WHERE \"home_team\"='chornomorets odessa';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"top_attendances\" (\n \"rank\" real,\n \"round\" text,\n \"home_team\" text,\n \"away_team\" text,\n \"result\" text,\n \"location\" text,\n \"attendance\" real\n);\n\nQuestion: What is the rank when the game was at dnipro stadium , kremenchuk?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"top_attendances\" WHERE \"location\"='dnipro stadium , kremenchuk';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What are the lowest points for the engines of the Lamborghini v12 and the Chassis on Minardi m191b?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"complete_formula_one_results\" WHERE \"engine\"='lamborghini v12' AND \"chassis\"='minardi m191b';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What is the Chassis from before 1997 with a Lamborghini v12 engine?"
},
{
"role": "assistant",
"content": "SELECT \"chassis\" FROM \"complete_formula_one_results\" WHERE \"year\"<1997 AND \"engine\"='lamborghini v12';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What is the total of the year with a point larger than 0 or the Chassis of Minardi m190?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"complete_formula_one_results\" WHERE \"chassis\"='minardi m190' AND \"points\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What are the lowest points from 1992 with a Chassis of Minardi m192?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"complete_formula_one_results\" WHERE \"year\"=1992 AND \"chassis\"='minardi m192';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What Entrant has 0 points and from 1997?"
},
{
"role": "assistant",
"content": "SELECT \"entrant\" FROM \"complete_formula_one_results\" WHERE \"points\"=0 AND \"year\"=1997;"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.