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 \"emmy_awards\" (\n \"year\" real,\n \"category\" text,\n \"recipients_and_nominees\" text,\n \"role_episode\" text,\n \"result\" text\n);\n\nQuestion: Which Category were Libby Goldstein and Junie Lowry-Johnson recipients and nominees for?"
},
{
"role": "assistant",
"content": "SELECT \"category\" FROM \"emmy_awards\" WHERE \"recipients_and_nominees\"='libby goldstein and junie lowry-johnson';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_record\" (\n \"race\" text,\n \"dist_f\" real,\n \"course\" text,\n \"runners\" real,\n \"placing\" real,\n \"margin\" real,\n \"jockey\" text,\n \"trainer\" text\n);\n\nQuestion: what is the highest runners when the jockey is frankie dettori and the placing is higher than 1?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"runners\") FROM \"race_record\" WHERE \"jockey\"='frankie dettori' AND \"placing\">1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_record\" (\n \"race\" text,\n \"dist_f\" real,\n \"course\" text,\n \"runners\" real,\n \"placing\" real,\n \"margin\" real,\n \"jockey\" text,\n \"trainer\" text\n);\n\nQuestion: what is the race when the jockey is frankie dettori, the margin is more than 3 and the course is yarmouth?"
},
{
"role": "assistant",
"content": "SELECT \"race\" FROM \"race_record\" WHERE \"jockey\"='frankie dettori' AND \"margin\">3 AND \"course\"='yarmouth';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_9_4_titles_5_runner_ups\" (\n \"outcome\" text,\n \"year\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partnering\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: Who is the Partner in the match with a Score of 6-4, 2-6, 7-6?"
},
{
"role": "assistant",
"content": "SELECT \"partnering\" FROM \"doubles_9_4_titles_5_runner_ups\" WHERE \"score\"='6-4, 2-6, 7-6';"
}
]
|
[
{
"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: what is the competition when the result is won and the date is september 13, 1996?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"international_goals\" WHERE \"result\"='won' AND \"date\"='september 13, 1996';"
}
]
|
[
{
"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: what is the date when the competition is 1996 tiger cup and the result is drew?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"international_goals\" WHERE \"competition\"='1996 tiger cup' AND \"result\"='drew';"
}
]
|
[
{
"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: what is the score when the competition is 1995 southeast asian games?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"international_goals\" WHERE \"competition\"='1995 southeast asian games';"
}
]
|
[
{
"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: what is the result when the venue is singapore on september 8, 1996?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"international_goals\" WHERE \"venue\"='singapore' AND \"date\"='september 8, 1996';"
}
]
|
[
{
"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: what is the competition when the result is won and the score is 8-0?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"international_goals\" WHERE \"result\"='won' AND \"score\"='8-0';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"team\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real,\n \"points\" real\n);\n\nQuestion: Waht laps have points smaller than 1, and a team of dale coyne racing, and the grid larger than 13?"
},
{
"role": "assistant",
"content": "SELECT \"laps\" FROM \"race\" WHERE \"points\"<1 AND \"team\"='dale coyne racing' AND \"grid\">13;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"team\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real,\n \"points\" real\n);\n\nQuestion: What is the total number of laps for a team of team player's, and has a grid of 9, and points larger than 10?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"laps\") FROM \"race\" WHERE \"team\"='team player''s' AND \"grid\"=9 AND \"points\">10;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"team\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real,\n \"points\" real\n);\n\nQuestion: What is the lowest points for a time/retired of +30.7 secs, and laps smaller than 165?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"race\" WHERE \"time_retired\"='+30.7 secs' AND \"laps\"<165;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_qualifying_round\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What was the first leg score of the matchup with a 2nd leg of 80-70?"
},
{
"role": "assistant",
"content": "SELECT \"1st_leg\" FROM \"second_qualifying_round\" WHERE \"2nd_leg\"='80-70';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_qualifying_round\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: Who was the team 2 in the game with a team 1 of Liege Basket?"
},
{
"role": "assistant",
"content": "SELECT \"team_num2\" FROM \"second_qualifying_round\" WHERE \"team_num1\"='liege basket';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_qualifying_round\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What was the 1st leg score in the matchup with a 2nd leg of 72-89?"
},
{
"role": "assistant",
"content": "SELECT \"1st_leg\" FROM \"second_qualifying_round\" WHERE \"2nd_leg\"='72-89';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_qualifying_round\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What was the aggregate score of the matchup with a leg 2 of 72-64?"
},
{
"role": "assistant",
"content": "SELECT \"agg\" FROM \"second_qualifying_round\" WHERE \"2nd_leg\"='72-64';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_qualifying_round\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What was the 2nd leg score in the matchup with a team 2 of KK Borac?"
},
{
"role": "assistant",
"content": "SELECT \"2nd_leg\" FROM \"second_qualifying_round\" WHERE \"team_num2\"='kk borac';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"4_8_4\" (\n \"class\" text,\n \"wheel_arrangement\" text,\n \"fleet_number_s\" text,\n \"manufacturer\" text,\n \"serial_numbers\" text,\n \"year_made\" text,\n \"quantity_made\" text,\n \"quantity_preserved\" text,\n \"year_s_retired\" text\n);\n\nQuestion: What are the serial numbers for the locomotives of Class 4-8-4 \u2014 oooooooo \u2014 northern?"
},
{
"role": "assistant",
"content": "SELECT \"serial_numbers\" FROM \"4_8_4\" WHERE \"class\"='4-8-4 \u2014 oooooooo \u2014 northern';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"4_8_4\" (\n \"class\" text,\n \"wheel_arrangement\" text,\n \"fleet_number_s\" text,\n \"manufacturer\" text,\n \"serial_numbers\" text,\n \"year_made\" text,\n \"quantity_made\" text,\n \"quantity_preserved\" text,\n \"year_s_retired\" text\n);\n\nQuestion: What is the fleet number for the model with Serial number 68056?"
},
{
"role": "assistant",
"content": "SELECT \"fleet_number_s\" FROM \"4_8_4\" WHERE \"serial_numbers\"='68056';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"4_8_4\" (\n \"class\" text,\n \"wheel_arrangement\" text,\n \"fleet_number_s\" text,\n \"manufacturer\" text,\n \"serial_numbers\" text,\n \"year_made\" text,\n \"quantity_made\" text,\n \"quantity_preserved\" text,\n \"year_s_retired\" text\n);\n\nQuestion: What is the serial number of the model made in 1930?"
},
{
"role": "assistant",
"content": "SELECT \"serial_numbers\" FROM \"4_8_4\" WHERE \"year_made\"='1930';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"4_8_4\" (\n \"class\" text,\n \"wheel_arrangement\" text,\n \"fleet_number_s\" text,\n \"manufacturer\" text,\n \"serial_numbers\" text,\n \"year_made\" text,\n \"quantity_made\" text,\n \"quantity_preserved\" text,\n \"year_s_retired\" text\n);\n\nQuestion: What is the wheel arrangement for the model that was retired in 1955?"
},
{
"role": "assistant",
"content": "SELECT \"wheel_arrangement\" FROM \"4_8_4\" WHERE \"year_s_retired\"='1955';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"calendar\" (\n \"round\" text,\n \"date\" text,\n \"matches\" real,\n \"clubs\" text,\n \"new_entries_this_round\" text,\n \"prize_money\" text\n);\n\nQuestion: What is the lowest number of matches that has a Clubs of 46 \u2192 32?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"matches\") FROM \"calendar\" WHERE \"clubs\"='46 \u2192 32';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"calendar\" (\n \"round\" text,\n \"date\" text,\n \"matches\" real,\n \"clubs\" text,\n \"new_entries_this_round\" text,\n \"prize_money\" text\n);\n\nQuestion: What is the highest number of matches that has a round of Third Round?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"matches\") FROM \"calendar\" WHERE \"round\"='third round';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"calendar\" (\n \"round\" text,\n \"date\" text,\n \"matches\" real,\n \"clubs\" text,\n \"new_entries_this_round\" text,\n \"prize_money\" text\n);\n\nQuestion: What is the prize money for the final round?"
},
{
"role": "assistant",
"content": "SELECT \"prize_money\" FROM \"calendar\" WHERE \"round\"='final';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"calendar\" (\n \"round\" text,\n \"date\" text,\n \"matches\" real,\n \"clubs\" text,\n \"new_entries_this_round\" text,\n \"prize_money\" text\n);\n\nQuestion: What is the date for the row with a new entries this round of 44?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"calendar\" WHERE \"new_entries_this_round\"='44';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Against has Wins of 11, and Losses smaller than 7?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"against\") FROM \"2012_ladder\" WHERE \"wins\"=11 AND \"losses\"<7;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Draws have Losses larger than 8, and a Hampden FL of terang-mortlake?"
},
{
"role": "assistant",
"content": "SELECT \"draws\" FROM \"2012_ladder\" WHERE \"losses\">8 AND \"hampden_fl\"='terang-mortlake';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Byes have Losses smaller than 4?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"byes\") FROM \"2012_ladder\" WHERE \"losses\"<4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010_ladder\" (\n \"wimmera_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What's the total draws when the losses are less than 10, less than 2 byes, and 13 wins?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"draws\") FROM \"2010_ladder\" WHERE \"losses\"<10 AND \"wins\"=13 AND \"byes\"<2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010_ladder\" (\n \"wimmera_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What's the total draws for Ararat when the byes are less than 2?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"draws\") FROM \"2010_ladder\" WHERE \"wimmera_fl\"='ararat' AND \"byes\"<2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010_ladder\" (\n \"wimmera_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What's the total losses when there are 8 wins and less than 2 byes?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"losses\") FROM \"2010_ladder\" WHERE \"wins\"=8 AND \"byes\"<2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010_ladder\" (\n \"wimmera_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What's the least losses for Horsham Saints with more than 13 wins and less than 1211 against?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"losses\") FROM \"2010_ladder\" WHERE \"against\"<1211 AND \"wimmera_fl\"='horsham saints' AND \"wins\">13;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010_ladder\" (\n \"wimmera_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What are the draws when the losses are less than 1?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"draws\") FROM \"2010_ladder\" WHERE \"losses\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010_ladder\" (\n \"wimmera_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What are the amount of wins when the draws are less than 0 and the against is 1348?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"wins\") FROM \"2010_ladder\" WHERE \"against\"=1348 AND \"draws\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"punjab\" (\n \"serial_no\" real,\n \"district\" text,\n \"headquartered_city\" text,\n \"city_population_2009\" real,\n \"city_area_km_2\" real\n);\n\nQuestion: What was the total city area for vehari city with a serial number bigger than 36?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"city_area_km_2\") FROM \"punjab\" WHERE \"headquartered_city\"='vehari city' AND \"serial_no\">36;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"punjab\" (\n \"serial_no\" real,\n \"district\" text,\n \"headquartered_city\" text,\n \"city_population_2009\" real,\n \"city_area_km_2\" real\n);\n\nQuestion: What was the lowest city population for the district of rajanpur district with a area of 6 km squared and a serial number less than 29?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"city_population_2009\") FROM \"punjab\" WHERE \"city_area_km_2\"=6 AND \"district\"='rajanpur district' AND \"serial_no\"<29;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"punjab\" (\n \"serial_no\" real,\n \"district\" text,\n \"headquartered_city\" text,\n \"city_population_2009\" real,\n \"city_area_km_2\" real\n);\n\nQuestion: What is the sum of the serial numbers for narowal city?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"serial_no\") FROM \"punjab\" WHERE \"headquartered_city\"='narowal city';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"punjab\" (\n \"serial_no\" real,\n \"district\" text,\n \"headquartered_city\" text,\n \"city_population_2009\" real,\n \"city_area_km_2\" real\n);\n\nQuestion: What is the sum of the area for the bahawalnagar district with a population more than 134,936?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"city_area_km_2\") FROM \"punjab\" WHERE \"district\"='bahawalnagar district' AND \"city_population_2009\">'134,936';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"punjab\" (\n \"serial_no\" real,\n \"district\" text,\n \"headquartered_city\" text,\n \"city_population_2009\" real,\n \"city_area_km_2\" real\n);\n\nQuestion: What district was the city with an area smaller than 12 square kilometers and a serial number of 35?"
},
{
"role": "assistant",
"content": "SELECT \"district\" FROM \"punjab\" WHERE \"city_area_km_2\"<12 AND \"serial_no\"=35;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: After pick number 158, what is the next round a USC player was picked?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"round\") FROM \"nfl_draft\" WHERE \"school\"='usc' AND \"pick\">158;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: Jim Obradovich, picked after round 2, but before pick 183, plays what position?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"nfl_draft\" WHERE \"round\">2 AND \"pick\"<183 AND \"player\"='jim obradovich';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"heat_5\" (\n \"rank\" real,\n \"athlete\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What time has q as the notes, and Australia as the country?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"heat_5\" WHERE \"notes\"='q' AND \"country\"='australia';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"heat_5\" (\n \"rank\" real,\n \"athlete\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What notes have a rank greater than 2, with mexico as the country?"
},
{
"role": "assistant",
"content": "SELECT \"notes\" FROM \"heat_5\" WHERE \"rank\">2 AND \"country\"='mexico';"
}
]
|
[
{
"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 bronzes for teams with more than 0 silver and a total under 1?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"bronze\") FROM \"medal_table\" WHERE \"silver\">0 AND \"total\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average number of golds for teams with 1 bronze, less than 3 silver, and a total over 2?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"gold\") FROM \"medal_table\" WHERE \"bronze\"=1 AND \"total\">2 AND \"silver\"<3;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"handicap_results_top_10\" (\n \"position\" real,\n \"sail_number\" text,\n \"yacht\" text,\n \"state_country\" text,\n \"yacht_type\" text,\n \"loa_metres\" real,\n \"skipper\" text,\n \"corrected_time_d_hh_mm_ss\" text\n);\n\nQuestion: What type of yacht has a LOA of 15.15 metres?"
},
{
"role": "assistant",
"content": "SELECT \"yacht_type\" FROM \"handicap_results_top_10\" WHERE \"loa_metres\"=15.15;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"finland\" (\n \"actor\" text,\n \"character\" text,\n \"soap_opera\" text,\n \"years\" text,\n \"duration\" text\n);\n\nQuestion: What Soap Opera with the character Teemu Luotola?"
},
{
"role": "assistant",
"content": "SELECT \"soap_opera\" FROM \"finland\" WHERE \"character\"='teemu luotola';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pure_alcohol_consumption_among_adults_ag\" (\n \"country\" text,\n \"recorded\" real,\n \"unrecorded\" real,\n \"total\" real,\n \"beer\" real,\n \"wine\" real,\n \"spirits\" real,\n \"other\" real\n);\n\nQuestion: What beer has a record of 4.08?"
},
{
"role": "assistant",
"content": "SELECT \"beer\" FROM \"pure_alcohol_consumption_among_adults_ag\" WHERE \"recorded\"=4.08;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fa_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: Which round has an Opposing Team of manchester united?"
},
{
"role": "assistant",
"content": "SELECT \"round\" FROM \"fa_cup\" WHERE \"opposing_team\"='manchester united';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fa_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: Which Date has an Against larger than 0?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"fa_cup\" WHERE \"against\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fa_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: Which Against has a Round of fourth round?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"against\") FROM \"fa_cup\" WHERE \"round\"='fourth round';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fa_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: What was the venue on 17/02/2008?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"fa_cup\" WHERE \"date\"='17/02/2008';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"iron_coaches\" (\n \"class_to_1928\" text,\n \"class_from_1928\" text,\n \"seats\" text,\n \"quantity\" real,\n \"year_s_of_manufacture\" text,\n \"remarks\" text\n);\n\nQuestion: What is the average quantity for coaches manufactured in 1921/23, and had 40 seats?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"quantity\") FROM \"iron_coaches\" WHERE \"year_s_of_manufacture\"='1921/23' AND \"seats\"='40';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"iron_coaches\" (\n \"class_to_1928\" text,\n \"class_from_1928\" text,\n \"seats\" text,\n \"quantity\" real,\n \"year_s_of_manufacture\" text,\n \"remarks\" text\n);\n\nQuestion: Which class to 1928 value had years of manufacture of 1921/23 and class from 1928 of BCi-21?"
},
{
"role": "assistant",
"content": "SELECT \"class_to_1928\" FROM \"iron_coaches\" WHERE \"year_s_of_manufacture\"='1921/23' AND \"class_from_1928\"='bci-21';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"iron_coaches\" (\n \"class_to_1928\" text,\n \"class_from_1928\" text,\n \"seats\" text,\n \"quantity\" real,\n \"year_s_of_manufacture\" text,\n \"remarks\" text\n);\n\nQuestion: What is the smallest quantity having a Class to 1928 of BDi-21?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"quantity\") FROM \"iron_coaches\" WHERE \"class_to_1928\"='bdi-21';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"iron_coaches\" (\n \"class_to_1928\" text,\n \"class_from_1928\" text,\n \"seats\" text,\n \"quantity\" real,\n \"year_s_of_manufacture\" text,\n \"remarks\" text\n);\n\nQuestion: Which class from 1928 had a class to 1928 of BDi-21?"
},
{
"role": "assistant",
"content": "SELECT \"class_from_1928\" FROM \"iron_coaches\" WHERE \"class_to_1928\"='bdi-21';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"iron_coaches\" (\n \"class_to_1928\" text,\n \"class_from_1928\" text,\n \"seats\" text,\n \"quantity\" real,\n \"year_s_of_manufacture\" text,\n \"remarks\" text\n);\n\nQuestion: What were the remarks for the coach having a class from 1928 of Cid-21B?"
},
{
"role": "assistant",
"content": "SELECT \"remarks\" FROM \"iron_coaches\" WHERE \"class_from_1928\"='cid-21b';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualified_competitors\" (\n \"position\" real,\n \"gymnast\" text,\n \"a_score\" real,\n \"b_score\" real,\n \"total\" real\n);\n\nQuestion: Which B Score has a Total larger than 15.325, and an A Score smaller than 6.4?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"b_score\") FROM \"qualified_competitors\" WHERE \"total\">15.325 AND \"a_score\"<6.4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualified_competitors\" (\n \"position\" real,\n \"gymnast\" text,\n \"a_score\" real,\n \"b_score\" real,\n \"total\" real\n);\n\nQuestion: Which Total has an A Score of 6.5, and a Position larger than 5?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"qualified_competitors\" WHERE \"a_score\"=6.5 AND \"position\">5;"
}
]
|
[
{
"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 \"attendance\" text\n);\n\nQuestion: What is the date of week 11?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"week\"=11;"
}
]
|
[
{
"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 \"attendance\" text\n);\n\nQuestion: What is the latest week when the chicago bears are the opponent?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"week\") FROM \"schedule\" WHERE \"opponent\"='chicago bears';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_of_heat_3\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"percentage\" text,\n \"place\" real\n);\n\nQuestion: What song placed higher than#4?"
},
{
"role": "assistant",
"content": "SELECT \"song\" FROM \"results_of_heat_3\" WHERE \"place\">4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_of_heat_3\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"percentage\" text,\n \"place\" real\n);\n\nQuestion: Who is the artist that drew higher than 4?"
},
{
"role": "assistant",
"content": "SELECT \"artist\" FROM \"results_of_heat_3\" WHERE \"draw\">4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers\" (\n \"driver\" text,\n \"starts\" real,\n \"finishes\" real,\n \"wins\" real,\n \"podiums\" real,\n \"stage_wins\" real,\n \"points\" real\n);\n\nQuestion: What's the total starts with more points than 1 and the driver is Nasser Al-Attiyah?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"starts\") FROM \"drivers\" WHERE \"driver\"='nasser al-attiyah' AND \"points\">1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers\" (\n \"driver\" text,\n \"starts\" real,\n \"finishes\" real,\n \"wins\" real,\n \"podiums\" real,\n \"stage_wins\" real,\n \"points\" real\n);\n\nQuestion: What's the smallest number of podiums having more than 6 starts and 5 finishes?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"podiums\") FROM \"drivers\" WHERE \"finishes\"=5 AND \"starts\">6;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers\" (\n \"driver\" text,\n \"starts\" real,\n \"finishes\" real,\n \"wins\" real,\n \"podiums\" real,\n \"stage_wins\" real,\n \"points\" real\n);\n\nQuestion: What's the number of stage wins for Federico Villagra having more than 1 finish, less than 8 starts and less than 1 podium?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"stage_wins\") FROM \"drivers\" WHERE \"finishes\">1 AND \"podiums\"<1 AND \"driver\"='federico villagra' AND \"starts\"<8;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers\" (\n \"driver\" text,\n \"starts\" real,\n \"finishes\" real,\n \"wins\" real,\n \"podiums\" real,\n \"stage_wins\" real,\n \"points\" real\n);\n\nQuestion: What's the finishes for Lambros Athanassoulas having 0 podiums and 0 stage wins?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"finishes\") FROM \"drivers\" WHERE \"podiums\"=0 AND \"stage_wins\"=0 AND \"driver\"='lambros athanassoulas';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"assembly_segments\" (\n \"constituency_number\" text,\n \"name\" text,\n \"reserved_for_sc_st_none\" text,\n \"district\" text,\n \"number_of_electorates_2003\" real\n);\n\nQuestion: What is the average number of electorates (2003) reserved for sc with a constituency number of 50?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"number_of_electorates_2003\") FROM \"assembly_segments\" WHERE \"reserved_for_sc_st_none\"='sc' AND \"constituency_number\"='50';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"goal_scorers\" (\n \"name\" text,\n \"pre_season\" real,\n \"a_league\" real,\n \"finals\" real,\n \"total\" real\n);\n\nQuestion: Which Finals have a Pre-Season larger than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"finals\") FROM \"goal_scorers\" WHERE \"pre_season\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"goal_scorers\" (\n \"name\" text,\n \"pre_season\" real,\n \"a_league\" real,\n \"finals\" real,\n \"total\" real\n);\n\nQuestion: How much A-League has a Pre-Season larger than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"a_league\") FROM \"goal_scorers\" WHERE \"pre_season\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"serialized_titles\" (\n \"title\" text,\n \"author\" text,\n \"first_issue\" text,\n \"last_issue\" text,\n \"completed\" text\n);\n\nQuestion: What is the last issue entry for Aron's Absurd Armada?"
},
{
"role": "assistant",
"content": "SELECT \"last_issue\" FROM \"serialized_titles\" WHERE \"title\"='aron''s absurd armada';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"serialized_titles\" (\n \"title\" text,\n \"author\" text,\n \"first_issue\" text,\n \"last_issue\" text,\n \"completed\" text\n);\n\nQuestion: What is the title that was first published in August 2010?"
},
{
"role": "assistant",
"content": "SELECT \"title\" FROM \"serialized_titles\" WHERE \"first_issue\"='august 2010';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"serialized_titles\" (\n \"title\" text,\n \"author\" text,\n \"first_issue\" text,\n \"last_issue\" text,\n \"completed\" text\n);\n\nQuestion: What is the completed entry for Aron's Absurd Armada?"
},
{
"role": "assistant",
"content": "SELECT \"completed\" FROM \"serialized_titles\" WHERE \"title\"='aron''s absurd armada';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"serialized_titles\" (\n \"title\" text,\n \"author\" text,\n \"first_issue\" text,\n \"last_issue\" text,\n \"completed\" text\n);\n\nQuestion: What is the title that was first published in February 2009 and is still ongoing?"
},
{
"role": "assistant",
"content": "SELECT \"title\" FROM \"serialized_titles\" WHERE \"last_issue\"='ongoing' AND \"first_issue\"='february 2009';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"serialized_titles\" (\n \"title\" text,\n \"author\" text,\n \"first_issue\" text,\n \"last_issue\" text,\n \"completed\" text\n);\n\nQuestion: What is the last issue entry of Time and Again?"
},
{
"role": "assistant",
"content": "SELECT \"last_issue\" FROM \"serialized_titles\" WHERE \"title\"='time and again';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"semifinal_1\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: What the rank of the Virgin Islands athlete with react under 0.168?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"semifinal_1\" WHERE \"react\"<0.168 AND \"nationality\"='virgin islands';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"semifinal_1\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: What is the lowest rank for Chris Brown with react greater than 0.244?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rank\") FROM \"semifinal_1\" WHERE \"athlete\"='chris brown' AND \"react\">0.244;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"semifinal_1\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: What is the highest rank of an athlete from Belgium with react greater than 0.162?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"semifinal_1\" WHERE \"nationality\"='belgium' AND \"react\">0.162;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"rank\" real,\n \"largest_u_s_city\" text,\n \"total\" real,\n \"partners\" real,\n \"other\" real\n);\n\nQuestion: What is the average number of partners for the firm with a rank under 71, other over 77, and largest city of Philadelphia?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"partners\") FROM \"see_also\" WHERE \"rank\"<71 AND \"largest_u_s_city\"='philadelphia' AND \"other\">77;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"rank\" real,\n \"largest_u_s_city\" text,\n \"total\" real,\n \"partners\" real,\n \"other\" real\n);\n\nQuestion: What is the smallest rank for the city having partners of 342, other under 147, and largest city of Cleveland?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rank\") FROM \"see_also\" WHERE \"partners\"=342 AND \"largest_u_s_city\"='cleveland' AND \"other\"<147;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"rank\" real,\n \"largest_u_s_city\" text,\n \"total\" real,\n \"partners\" real,\n \"other\" real\n);\n\nQuestion: What is the number of partners for the city ranked under 294, total over 264, largest city of Chicago, and other over 46?"
},
{
"role": "assistant",
"content": "SELECT \"partners\" FROM \"see_also\" WHERE \"rank\"<294 AND \"total\">264 AND \"largest_u_s_city\"='chicago' AND \"other\">46;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"popularity_of_terrestrial_tv_stations\" (\n \"tv_station_operator\" text,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011_1_h\" real\n);\n\nQuestion: What's the 2008 that has 3.4 in 2009 and more than 2.9 in 2005?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"2008\") FROM \"popularity_of_terrestrial_tv_stations\" WHERE \"2009\"=3.4 AND \"2005\">2.9;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"popularity_of_terrestrial_tv_stations\" (\n \"tv_station_operator\" text,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011_1_h\" real\n);\n\nQuestion: What's the 2006 if there's less than 6.7 in 2007 and less than 3.4 in 2009?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"2006\") FROM \"popularity_of_terrestrial_tv_stations\" WHERE \"2007\"<6.7 AND \"2009\"<3.4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"popularity_of_terrestrial_tv_stations\" (\n \"tv_station_operator\" text,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011_1_h\" real\n);\n\nQuestion: What's the total in 2005 if there's more than 10.2 in 2006, less than 29.5 in 2007, more than 4.9 in 2009 and less than 43.8 in 2010?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"2005\") FROM \"popularity_of_terrestrial_tv_stations\" WHERE \"2010\"<43.8 AND \"2007\"<29.5 AND \"2009\">4.9 AND \"2006\">10.2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"popularity_of_terrestrial_tv_stations\" (\n \"tv_station_operator\" text,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011_1_h\" real\n);\n\nQuestion: What is the 2009 when there's 11.8 in 2005 and less than 12.6 in 2006?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"2009\") FROM \"popularity_of_terrestrial_tv_stations\" WHERE \"2005\"=11.8 AND \"2006\"<12.6;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"popularity_of_terrestrial_tv_stations\" (\n \"tv_station_operator\" text,\n \"2005\" real,\n \"2006\" real,\n \"2007\" real,\n \"2008\" real,\n \"2009\" real,\n \"2010\" real,\n \"2011_1_h\" real\n);\n\nQuestion: What's the 2005 of TV3 when there is less than 42 in 2007 and less than 29.5 in 2010?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"2005\") FROM \"popularity_of_terrestrial_tv_stations\" WHERE \"2007\"<42 AND \"tv_station_operator\"='tv3' AND \"2010\"<29.5;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"wins_13\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponent_in_final\" text,\n \"score\" text\n);\n\nQuestion: What date had Alexander Krasnorutskiy as a partner with a score of 6\u20133, 4\u20136, 6\u20132?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"wins_13\" WHERE \"partner\"='alexander krasnorutskiy' AND \"score\"='6\u20133, 4\u20136, 6\u20132';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schools\" (\n \"school\" text,\n \"city\" text,\n \"mascot\" text,\n \"enrollment\" real,\n \"ihsaa_class\" text,\n \"county\" text\n);\n\nQuestion: Which IHSAA Class has a Mascot of eagles, and a City of evansville?"
},
{
"role": "assistant",
"content": "SELECT \"ihsaa_class\" FROM \"schools\" WHERE \"mascot\"='eagles' AND \"city\"='evansville';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schools\" (\n \"school\" text,\n \"city\" text,\n \"mascot\" text,\n \"enrollment\" real,\n \"ihsaa_class\" text,\n \"county\" text\n);\n\nQuestion: Which City has a School of indianapolis brebeuf?"
},
{
"role": "assistant",
"content": "SELECT \"city\" FROM \"schools\" WHERE \"school\"='indianapolis brebeuf';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schools\" (\n \"school\" text,\n \"city\" text,\n \"mascot\" text,\n \"enrollment\" real,\n \"ihsaa_class\" text,\n \"county\" text\n);\n\nQuestion: How much Enrollment has a School of indianapolis tindley?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"enrollment\") FROM \"schools\" WHERE \"school\"='indianapolis tindley';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schools\" (\n \"school\" text,\n \"city\" text,\n \"mascot\" text,\n \"enrollment\" real,\n \"ihsaa_class\" text,\n \"county\" text\n);\n\nQuestion: Which County has an IHSAA Class of aaaa, and a Mascot of cardinals?"
},
{
"role": "assistant",
"content": "SELECT \"county\" FROM \"schools\" WHERE \"ihsaa_class\"='aaaa' AND \"mascot\"='cardinals';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appearances_and_goals\" (\n \"name\" text,\n \"position\" text,\n \"league_apps\" text,\n \"league_goals\" real,\n \"fa_cup_apps\" text,\n \"fa_cup_goals\" real,\n \"league_cup_apps\" real,\n \"league_cup_goals\" real,\n \"total_apps\" text,\n \"total_goals\" real\n);\n\nQuestion: How many Total Goals values have 0 League Cup Goals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total_goals\") FROM \"appearances_and_goals\" WHERE \"league_cup_goals\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appearances_and_goals\" (\n \"name\" text,\n \"position\" text,\n \"league_apps\" text,\n \"league_goals\" real,\n \"fa_cup_apps\" text,\n \"fa_cup_goals\" real,\n \"league_cup_apps\" real,\n \"league_cup_goals\" real,\n \"total_apps\" text,\n \"total_goals\" real\n);\n\nQuestion: What is the smallest number of FA Cup Goals for players with 4 FA Cup Appearances, 49 Total Appearances, and more than 17 total goals?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"fa_cup_goals\") FROM \"appearances_and_goals\" WHERE \"fa_cup_apps\"='4' AND \"total_apps\"='49' AND \"total_goals\">17;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appearances_and_goals\" (\n \"name\" text,\n \"position\" text,\n \"league_apps\" text,\n \"league_goals\" real,\n \"fa_cup_apps\" text,\n \"fa_cup_goals\" real,\n \"league_cup_apps\" real,\n \"league_cup_goals\" real,\n \"total_apps\" text,\n \"total_goals\" real\n);\n\nQuestion: What is the average number of League Goals for palyers with 0 FA Cup Goals?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"league_goals\") FROM \"appearances_and_goals\" WHERE \"fa_cup_goals\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championships_total_medals\" (\n \"rank\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" text\n);\n\nQuestion: what is the highest silver when the total is 4 and bronze is less than 1?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"silver\") FROM \"world_championships_total_medals\" WHERE \"total\"='4' AND \"bronze\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championships_total_medals\" (\n \"rank\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" text\n);\n\nQuestion: what is the gold when the bronze is 1, total is 6 and silver is less than 3?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"world_championships_total_medals\" WHERE \"bronze\"=1 AND \"total\"='6' AND \"silver\"<3;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"delegates\" (\n \"province_community\" text,\n \"contestant\" text,\n \"height\" real,\n \"hometown\" text,\n \"geographical_regions\" text\n);\n\nQuestion: What is province of community with height larger than 1.8 and is in el cibao region?"
},
{
"role": "assistant",
"content": "SELECT \"province_community\" FROM \"delegates\" WHERE \"geographical_regions\"='el cibao' AND \"height\">1.8;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"delegates\" (\n \"province_community\" text,\n \"contestant\" text,\n \"height\" real,\n \"hometown\" text,\n \"geographical_regions\" text\n);\n\nQuestion: What contestant is from santo domingo este and has height smaller than 1.79?"
},
{
"role": "assistant",
"content": "SELECT \"contestant\" FROM \"delegates\" WHERE \"height\"<1.79 AND \"hometown\"='santo domingo este';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"delegates\" (\n \"province_community\" text,\n \"contestant\" text,\n \"height\" real,\n \"hometown\" text,\n \"geographical_regions\" text\n);\n\nQuestion: What is total number of height of province, with community of com. dom. lto. America?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"height\") FROM \"delegates\" WHERE \"province_community\"='com. dom. lto. america';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"former_members\" (\n \"school\" text,\n \"location\" text,\n \"mascot\" text,\n \"county\" text,\n \"year_joined\" text,\n \"previous_conference\" text,\n \"year_left\" text\n);\n\nQuestion: what is the previous conference when the year joined is 1932 and the mascot is tigers?"
},
{
"role": "assistant",
"content": "SELECT \"previous_conference\" FROM \"former_members\" WHERE \"year_joined\"='1932' AND \"mascot\"='tigers';"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.