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 \"grand_prix_motorcycle_racing_results\" (\n \"year\" real,\n \"class\" text,\n \"team\" text,\n \"points\" real,\n \"rank\" text,\n \"wins\" real\n);\n\nQuestion: What is team Yamaha with 3 points ranked?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"grand_prix_motorcycle_racing_results\" WHERE \"team\"='yamaha' AND \"points\"=3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What years did the player ranked less than 8 and had 447 matches play?"
},
{
"role": "assistant",
"content": "SELECT \"years\" FROM \"list_of_top_association_football_goal_sc\" WHERE \"rank\"<8 AND \"matches\"=447;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the Time with a Record that is 15-7?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"mixed_martial_arts_record\" WHERE \"record\"='15-7';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the Event with a Time that is 3:06?"
},
{
"role": "assistant",
"content": "SELECT \"event\" FROM \"mixed_martial_arts_record\" WHERE \"time\"='3:06';"
}
] |
[
{
"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: How many silvers did Turkey get?"
},
{
"role": "assistant",
"content": "SELECT \"silver\" FROM \"medal_table\" WHERE \"nation\"='turkey';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick_num\" real,\n \"nfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What position does Denard Walker play?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"nfl_draft\" WHERE \"player\"='denard walker';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick_num\" real,\n \"nfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What was the pick number for the wide receiver drafted from Michigan State?"
},
{
"role": "assistant",
"content": "SELECT \"pick_num\" FROM \"nfl_draft\" WHERE \"position\"='wide receiver' AND \"college\"='michigan state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick_num\" real,\n \"nfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: Which player came from Kent State?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"nfl_draft\" WHERE \"college\"='kent state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\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, and 4 silver medals, and 2 gold medals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"bronze\") FROM \"men\" WHERE \"silver\"=4 AND \"gold\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_11_3_8\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: Which Tournament has a score of 2\u20136 6\u20134 [10\u20138]?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"doubles_11_3_8\" WHERE \"score\"='2\u20136 6\u20134 [10\u20138]';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_11_3_8\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: Which Tournament has a Score of 6(4)\u20137 2\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"tournament\" FROM \"doubles_11_3_8\" WHERE \"score\"='6(4)\u20137 2\u20136';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_11_3_8\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is the Score of the match where Opponents in the Final was Vitalia Diatchenko Irena Pavlovic?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"doubles_11_3_8\" WHERE \"opponents_in_the_final\"='vitalia diatchenko irena pavlovic';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the High rebounds with a Game that is 62?"
},
{
"role": "assistant",
"content": "SELECT \"high_rebounds\" FROM \"game_log\" WHERE \"game\"=62;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the Team with a Score that is l 79\u201392 (ot)?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"game_log\" WHERE \"score\"='l 79\u201392 (ot)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"p_premier_r_runner_up_m_minor_premier_f_\" (\n \"competition\" text,\n \"ladder_position\" text,\n \"coach\" text,\n \"captain_s\" text,\n \"details\" text\n);\n\nQuestion: Who is the coach of the 2012 Gold Coast Titans season?"
},
{
"role": "assistant",
"content": "SELECT \"coach\" FROM \"p_premier_r_runner_up_m_minor_premier_f_\" WHERE \"details\"='2012 gold coast titans season';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"p_premier_r_runner_up_m_minor_premier_f_\" (\n \"competition\" text,\n \"ladder_position\" text,\n \"coach\" text,\n \"captain_s\" text,\n \"details\" text\n);\n\nQuestion: Who is the coach of the 2010 Gold Coast Titans season?"
},
{
"role": "assistant",
"content": "SELECT \"coach\" FROM \"p_premier_r_runner_up_m_minor_premier_f_\" WHERE \"details\"='2010 gold coast titans season';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"p_premier_r_runner_up_m_minor_premier_f_\" (\n \"competition\" text,\n \"ladder_position\" text,\n \"coach\" text,\n \"captain_s\" text,\n \"details\" text\n);\n\nQuestion: Who is the captain of the 2012 NRL season competition?"
},
{
"role": "assistant",
"content": "SELECT \"captain_s\" FROM \"p_premier_r_runner_up_m_minor_premier_f_\" WHERE \"competition\"='2012 nrl season';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: How many wins were in the PGA Championship when there were more than 10 events?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"wins\") FROM \"summary\" WHERE \"tournament\"='pga championship' AND \"events\">10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the smallest number of cuts when there were more than 0 wins?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"cuts_made\") FROM \"summary\" WHERE \"wins\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What is the total number of Rank for 1996\u20132007, when there are more than 108 goals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"years\"='1996\u20132007' AND \"goals\">108;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What is the lowest Rank when the goals are less than 124 for Jeff Cunningham?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"goals\">124 AND \"name\"='jeff cunningham';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What is the total number of Rank with 100 goals, and less than 300 matches?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"goals\"=100 AND \"matches\"<300;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What is the highest Rank for Jason Kreis, with less than 305 matches?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"name\"='jason kreis' AND \"matches\"<305;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the least number of wins when the top 10 is more than 8?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"wins\") FROM \"summary\" WHERE \"top_10\">8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the sum of cuts made when the top-5 is 2, and there are 12 events?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"cuts_made\") FROM \"summary\" WHERE \"top_5\"=2 AND \"events\"=12;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the mean number in the top 5 when the top 25 is 1 and there's fewer than 0 wins?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"top_5\") FROM \"summary\" WHERE \"top_25\"=1 AND \"wins\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the mean number of events when top-5 is 1?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"events\") FROM \"summary\" WHERE \"top_5\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: How many top-25s are associated with more than 91 events?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"top_25\") FROM \"summary\" WHERE \"events\">91;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the lowest Wins with a Top-10 that is larger than 9?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"wins\") FROM \"summary\" WHERE \"top_10\">9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average Cuts that were made with a Top-10 that is larger than 9?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"cuts_made\") FROM \"summary\" WHERE \"top_10\">9;"
}
] |
[
{
"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 \"game_site\" text,\n \"final_score\" text,\n \"record\" text,\n \"attendance\" text\n);\n\nQuestion: Which record has 64,053 as the attendance?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"schedule\" WHERE \"attendance\"='64,053';"
}
] |
[
{
"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 \"game_site\" text,\n \"final_score\" text,\n \"record\" text,\n \"attendance\" text\n);\n\nQuestion: Which date has rich stadium as the game site for week 1?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"game_site\"='rich stadium' AND \"week\"=1;"
}
] |
[
{
"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 \"game_site\" text,\n \"final_score\" text,\n \"record\" text,\n \"attendance\" text\n);\n\nQuestion: Which date has 1 as the week?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"week\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"studio_albums\" (\n \"year\" real,\n \"title\" text,\n \"label\" text,\n \"riaa_sales_certification\" text,\n \"billboard_200_peak\" real\n);\n\nQuestion: Which Title was awarded the gold RIAA Sales Certification?"
},
{
"role": "assistant",
"content": "SELECT \"title\" FROM \"studio_albums\" WHERE \"riaa_sales_certification\"='gold';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"studio_albums\" (\n \"year\" real,\n \"title\" text,\n \"label\" text,\n \"riaa_sales_certification\" text,\n \"billboard_200_peak\" real\n);\n\nQuestion: For how many years did the song \"Lost Without Your Love\" win the gold RIAA Sales Certification, and have a Billboard 200 Peak greater than 26?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"studio_albums\" WHERE \"riaa_sales_certification\"='gold' AND \"title\"='lost without your love' AND \"billboard_200_peak\">26;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"studio_albums\" (\n \"year\" real,\n \"title\" text,\n \"label\" text,\n \"riaa_sales_certification\" text,\n \"billboard_200_peak\" real\n);\n\nQuestion: Before the Year 1972, what RIAA Sales Certification was awarded to the song that had a Billboard 200 Peak less than 18?"
},
{
"role": "assistant",
"content": "SELECT \"riaa_sales_certification\" FROM \"studio_albums\" WHERE \"billboard_200_peak\"<18 AND \"year\"<1972;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"studio_albums\" (\n \"year\" real,\n \"title\" text,\n \"label\" text,\n \"riaa_sales_certification\" text,\n \"billboard_200_peak\" real\n);\n\nQuestion: What RIAA Sales Certification was awarded to the song that had a Billboard 200 Peak of 21?"
},
{
"role": "assistant",
"content": "SELECT \"riaa_sales_certification\" FROM \"studio_albums\" WHERE \"billboard_200_peak\"=21;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"studio_albums\" (\n \"year\" real,\n \"title\" text,\n \"label\" text,\n \"riaa_sales_certification\" text,\n \"billboard_200_peak\" real\n);\n\nQuestion: What is the sum of the Billboard 200 Peak scores after the Year 1971?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"billboard_200_peak\") FROM \"studio_albums\" WHERE \"year\">1971;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"studio_albums\" (\n \"year\" real,\n \"title\" text,\n \"label\" text,\n \"riaa_sales_certification\" text,\n \"billboard_200_peak\" real\n);\n\nQuestion: What is the sum of the Billboard 200 Peak scores given to the song with the Title Bread?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"billboard_200_peak\") FROM \"studio_albums\" WHERE \"title\"='bread';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the number of gold when the silver is 1, bronze is 1, and the nation is Austria?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medals_table\" WHERE \"silver\"=1 AND \"bronze\"=1 AND \"nation\"='austria';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What nation has 2 bronze and a rank of 9?"
},
{
"role": "assistant",
"content": "SELECT \"nation\" FROM \"medals_table\" WHERE \"bronze\"=2 AND \"rank\"=9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the highest gold when bronze is 1, and rank is 5?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"gold\") FROM \"medals_table\" WHERE \"bronze\"=1 AND \"rank\"=5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest gold when there are 0 bronze and the total is less than 2, and silver is less than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"gold\") FROM \"medals_table\" WHERE \"bronze\"=0 AND \"total\"<2 AND \"silver\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of rank when total is 3 and the nation is Australia?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"rank\") FROM \"medals_table\" WHERE \"total\"=3 AND \"nation\"='australia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What is the Rank with a Goal number smaller than 66?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"list_of_top_association_football_goal_sc\" WHERE \"goals\"<66;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010s\" (\n \"spoofed_title\" text,\n \"actual_title\" text,\n \"writer\" text,\n \"artist\" text,\n \"issue\" real\n);\n\nQuestion: What is the spoofed title for Parks and Recreation with an issue larger than 509?"
},
{
"role": "assistant",
"content": "SELECT \"spoofed_title\" FROM \"2010s\" WHERE \"issue\">509 AND \"actual_title\"='parks and recreation';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010s\" (\n \"spoofed_title\" text,\n \"actual_title\" text,\n \"writer\" text,\n \"artist\" text,\n \"issue\" real\n);\n\nQuestion: What was the actual title of the show that had an issue number less than 508, was written by Desmond Devlin, and for which Tom Richmond was the artist?"
},
{
"role": "assistant",
"content": "SELECT \"actual_title\" FROM \"2010s\" WHERE \"artist\"='tom richmond' AND \"issue\"<508 AND \"writer\"='desmond devlin';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010s\" (\n \"spoofed_title\" text,\n \"actual_title\" text,\n \"writer\" text,\n \"artist\" text,\n \"issue\" real\n);\n\nQuestion: What issue was the spoofed title Ho-Hum land?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"issue\") FROM \"2010s\" WHERE \"spoofed_title\"='ho-hum land';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2010s\" (\n \"spoofed_title\" text,\n \"actual_title\" text,\n \"writer\" text,\n \"artist\" text,\n \"issue\" real\n);\n\nQuestion: Game of Thrones was done by which artist?"
},
{
"role": "assistant",
"content": "SELECT \"artist\" FROM \"2010s\" WHERE \"actual_title\"='game of thrones';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_9_2_7\" (\n \"outcome\" text,\n \"date\" text,\n \"championship\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is the Surface when Todd Woodbridge was the runner-up, and a Date of 24 february 1997?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"singles_9_2_7\" WHERE \"outcome\"='runner-up' AND \"date\"='24 february 1997';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_9_2_7\" (\n \"outcome\" text,\n \"date\" text,\n \"championship\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is the Opponent when Todd Woodbridge was the runner-up, and a Date of 26 august 1996?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"singles_9_2_7\" WHERE \"outcome\"='runner-up' AND \"date\"='26 august 1996';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_9_2_7\" (\n \"outcome\" text,\n \"date\" text,\n \"championship\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is the Surface when the score was 4\u20136, 6\u20133, 6\u20137 (5\u20137)?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"singles_9_2_7\" WHERE \"score\"='4\u20136, 6\u20133, 6\u20137 (5\u20137)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles_9_2_7\" (\n \"outcome\" text,\n \"date\" text,\n \"championship\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What is the Score when there was a hard surface and the Championship is new haven , usa?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"singles_9_2_7\" WHERE \"surface\"='hard' AND \"championship\"='new haven , usa';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"height_cm\" real,\n \"weight_kg\" real,\n \"birthdate\" text,\n \"birthplace\" text,\n \"2005_2006_team\" text\n);\n\nQuestion: Which Position player was born June 30, 1981?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"birthdate\"='june 30, 1981';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_united_states_national_ice_hocke\" (\n \"position\" text,\n \"jersey_num\" real,\n \"name\" text,\n \"height_cm\" real,\n \"weight_kg\" real,\n \"birthdate\" text,\n \"birthplace\" text,\n \"2005_2006_team\" text\n);\n\nQuestion: What is the 2005-2006 team for player Phil Kessel?"
},
{
"role": "assistant",
"content": "SELECT \"2005_2006_team\" FROM \"list_of_united_states_national_ice_hocke\" WHERE \"name\"='phil kessel';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"european_records\" (\n \"competition\" text,\n \"appearances\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: What is the total sum of the goals at competitions with more than 10 draws?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"goals_for\") FROM \"european_records\" WHERE \"drawn\">10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: For the teams that had more than 2 Byes, what was the highest number of Wins?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"wins\") FROM \"2003_ladder\" WHERE \"byes\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: For the teams that had fewer than 4 Losses, and less than 16 Wins, what was the total number of Draws?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"draws\") FROM \"2003_ladder\" WHERE \"losses\"<4 AND \"wins\"<16;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: For the teams that had less than 1 loss, what was the average number of Wins?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"wins\") FROM \"2003_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 \"2003_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: For the teams that had fewer than 1 Byes, what was the lowest number of Draws?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"draws\") FROM \"2003_ladder\" WHERE \"byes\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What was the highest number of Draws scored by Sebastapol when the value for Against was less than 1802?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"draws\") FROM \"2003_ladder\" WHERE \"ballarat_fl\"='sebastapol' AND \"against\"<1802;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s_incorporation\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"series\" text\n);\n\nQuestion: What is the Season when the Opponent was zenit st. petersburg?"
},
{
"role": "assistant",
"content": "SELECT \"season\" FROM \"2000s_incorporation\" WHERE \"opponent\"='zenit st. petersburg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s_incorporation\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"series\" text\n);\n\nQuestion: What is the Opponent with a Round of q2, in the 2005\u201306 season?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"2000s_incorporation\" WHERE \"round\"='q2' AND \"season\"='2005\u201306';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s_incorporation\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"series\" text\n);\n\nQuestion: What is the Competition for Season 2002\u201303, and the Opponent was zenit st. petersburg?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"2000s_incorporation\" WHERE \"season\"='2002\u201303' AND \"opponent\"='zenit st. petersburg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s_incorporation\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"series\" text\n);\n\nQuestion: What is the Round when the series shows 5th place, and a Season of 2006\u201307?"
},
{
"role": "assistant",
"content": "SELECT \"round\" FROM \"2000s_incorporation\" WHERE \"series\"='5th place' AND \"season\"='2006\u201307';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s_incorporation\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"series\" text\n);\n\nQuestion: What is the Series for the uefa cup, in the 2006\u201307 season, and a Round of group, and an opponent of az?"
},
{
"role": "assistant",
"content": "SELECT \"series\" FROM \"2000s_incorporation\" WHERE \"competition\"='uefa cup' AND \"season\"='2006\u201307' AND \"round\"='group' AND \"opponent\"='az';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_fleet\" (\n \"ship\" text,\n \"built\" real,\n \"builder\" text,\n \"entered_service_for_aida\" text,\n \"gross_tonnage\" text,\n \"flag\" text\n);\n\nQuestion: Which Flag did the Ship Aidavita have?"
},
{
"role": "assistant",
"content": "SELECT \"flag\" FROM \"current_fleet\" WHERE \"ship\"='aidavita';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_pool_a\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"set_4\" text,\n \"set_5\" text,\n \"total\" text\n);\n\nQuestion: What shows for Set 5 when the Total was 77 - 65?"
},
{
"role": "assistant",
"content": "SELECT \"set_5\" FROM \"results_pool_a\" WHERE \"total\"='77 - 65';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_pool_a\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"set_4\" text,\n \"set_5\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 3 when the Total was 98 - 92?"
},
{
"role": "assistant",
"content": "SELECT \"set_3\" FROM \"results_pool_a\" WHERE \"total\"='98 - 92';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_pool_a\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"set_4\" text,\n \"set_5\" text,\n \"total\" text\n);\n\nQuestion: What is the Total when the Set 3 was 25-15?"
},
{
"role": "assistant",
"content": "SELECT \"total\" FROM \"results_pool_a\" WHERE \"set_3\"='25-15';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_pool_a\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"set_4\" text,\n \"set_5\" text,\n \"total\" text\n);\n\nQuestion: What is the Set 3 when the Total was 62 - 75?"
},
{
"role": "assistant",
"content": "SELECT \"set_3\" FROM \"results_pool_a\" WHERE \"total\"='62 - 75';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results_pool_a\" (\n \"date\" text,\n \"score\" text,\n \"set_1\" text,\n \"set_2\" text,\n \"set_3\" text,\n \"set_4\" text,\n \"set_5\" text,\n \"total\" text\n);\n\nQuestion: What is the Score when Set 2 shows 25-20, and a Total of 75 - 49?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"results_pool_a\" WHERE \"set_2\"='25-20' AND \"total\"='75 - 49';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appliances\" (\n \"name\" text,\n \"processor\" text,\n \"hard_drive\" text,\n \"ethernet_ports\" text,\n \"dimensions\" text\n);\n\nQuestion: What is the ethernet ports of the m1500 appliance?"
},
{
"role": "assistant",
"content": "SELECT \"ethernet_ports\" FROM \"appliances\" WHERE \"name\"='m1500';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appliances\" (\n \"name\" text,\n \"processor\" text,\n \"hard_drive\" text,\n \"ethernet_ports\" text,\n \"dimensions\" text\n);\n\nQuestion: What is the ethernet ports of the u150 appliance?"
},
{
"role": "assistant",
"content": "SELECT \"ethernet_ports\" FROM \"appliances\" WHERE \"name\"='u150';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appliances\" (\n \"name\" text,\n \"processor\" text,\n \"hard_drive\" text,\n \"ethernet_ports\" text,\n \"dimensions\" text\n);\n\nQuestion: What is the dimensions of the u50 appliance?"
},
{
"role": "assistant",
"content": "SELECT \"dimensions\" FROM \"appliances\" WHERE \"name\"='u50';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"appliances\" (\n \"name\" text,\n \"processor\" text,\n \"hard_drive\" text,\n \"ethernet_ports\" text,\n \"dimensions\" text\n);\n\nQuestion: What is the ethernet ports of the u10 appliance?"
},
{
"role": "assistant",
"content": "SELECT \"ethernet_ports\" FROM \"appliances\" WHERE \"name\"='u10';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total number of Silver medals for the Nation with less than 1 Bronze?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"silver\") FROM \"medals_table\" WHERE \"bronze\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total number of Gold medals for the Nation with more than 1 Bronze and more the 4 Total medals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medals_table\" WHERE \"bronze\">1 AND \"total\">4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total number of Gold medals for the Nation with more than 3 Bronze?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medals_table\" WHERE \"bronze\">3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many Gold medals did Great Britain with a Total of more than 2 medals receive?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"gold\") FROM \"medals_table\" WHERE \"nation\"='great britain' AND \"total\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many Silver medals did the Nation with a Rank of less than 1 receive?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"silver\") FROM \"medals_table\" WHERE \"rank\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"topscorers\" (\n \"player\" text,\n \"club\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"fa_trophy\" real,\n \"league_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the average total with 1 FA cup and more than 0 FA trophies?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"topscorers\" WHERE \"fa_cup\"=1 AND \"fa_trophy\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"topscorers\" (\n \"player\" text,\n \"club\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"fa_trophy\" real,\n \"league_cup\" real,\n \"total\" real\n);\n\nQuestion: Which club had more than 2 FA trophies and more than 2 FA cups?"
},
{
"role": "assistant",
"content": "SELECT \"club\" FROM \"topscorers\" WHERE \"fa_trophy\">2 AND \"fa_cup\">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 \"number\" real,\n \"result\" text,\n \"date\" text,\n \"score\" text,\n \"opponent\" text,\n \"record\" text\n);\n\nQuestion: Who was the opponent when the Maroons record was 11\u20134\u20131?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='11\u20134\u20131';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"number\" real,\n \"result\" text,\n \"date\" text,\n \"score\" text,\n \"opponent\" text,\n \"record\" text\n);\n\nQuestion: What was the result of the game on January 5, 1926?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"game_log\" WHERE \"date\"='january 5, 1926';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"lpga_tour_8\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What date had a margin victory of 2 strokes?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"lpga_tour_8\" WHERE \"margin_of_victory\"='2 strokes';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"lpga_tour_8\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is the margin of victory in a semgroup championship?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"lpga_tour_8\" WHERE \"tournament\"='semgroup championship';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"lpga_tour_8\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What was the winning score with a margin victory of 2 strokes?"
},
{
"role": "assistant",
"content": "SELECT \"winning_score\" FROM \"lpga_tour_8\" WHERE \"margin_of_victory\"='2 strokes';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_by_season_results\" (\n \"season\" text,\n \"games\" real,\n \"lost\" real,\n \"points\" real,\n \"pct_pct\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"playoffs\" text\n);\n\nQuestion: What is the highest Pct %, when Goals Against is less than 229?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"pct_pct\") FROM \"season_by_season_results\" WHERE \"goals_against\"<229;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_by_season_results\" (\n \"season\" text,\n \"games\" real,\n \"lost\" real,\n \"points\" real,\n \"pct_pct\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"playoffs\" text\n);\n\nQuestion: What is the average Goals, when Playoffs is Lost in Round 2, and when Games is less than 81?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"goals_for\") FROM \"season_by_season_results\" WHERE \"playoffs\"='lost in round 2' AND \"games\"<81;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_by_season_results\" (\n \"season\" text,\n \"games\" real,\n \"lost\" real,\n \"points\" real,\n \"pct_pct\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"playoffs\" text\n);\n\nQuestion: What is the sum of Goals Against, when Lost is 45, and when Points is greater than 68?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"goals_against\") FROM \"season_by_season_results\" WHERE \"lost\"=45 AND \"points\">68;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_by_season_results\" (\n \"season\" text,\n \"games\" real,\n \"lost\" real,\n \"points\" real,\n \"pct_pct\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"playoffs\" text\n);\n\nQuestion: What is the average Lost, when Games is less than 82, when Points is less than 95, and when Pct % is less than 0.506?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"lost\") FROM \"season_by_season_results\" WHERE \"games\"<82 AND \"points\"<95 AND \"pct_pct\"<0.506;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fleet\" (\n \"number\" real,\n \"class\" real,\n \"name\" text,\n \"livery\" text,\n \"notes\" text\n);\n\nQuestion: What is the Class when Wessex Trains Pink is the Livery?"
},
{
"role": "assistant",
"content": "SELECT \"class\" FROM \"fleet\" WHERE \"livery\"='wessex trains pink';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fleet\" (\n \"number\" real,\n \"class\" real,\n \"name\" text,\n \"livery\" text,\n \"notes\" text\n);\n\nQuestion: What is the Livery when the Number is 31468?"
},
{
"role": "assistant",
"content": "SELECT \"livery\" FROM \"fleet\" WHERE \"number\"=31468;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"nation\" text,\n \"skip\" text,\n \"third\" text,\n \"second\" text,\n \"lead\" text,\n \"alternate\" text,\n \"club\" text\n);\n\nQuestion: What was the Skip for Germany?"
},
{
"role": "assistant",
"content": "SELECT \"skip\" FROM \"teams\" WHERE \"nation\"='germany';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"nation\" text,\n \"skip\" text,\n \"third\" text,\n \"second\" text,\n \"lead\" text,\n \"alternate\" text,\n \"club\" text\n);\n\nQuestion: What was the club for Great Britain?"
},
{
"role": "assistant",
"content": "SELECT \"club\" FROM \"teams\" WHERE \"nation\"='great britain';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"nation\" text,\n \"skip\" text,\n \"third\" text,\n \"second\" text,\n \"lead\" text,\n \"alternate\" text,\n \"club\" text\n);\n\nQuestion: Who is the alternate for Magnus Swartling as Second?"
},
{
"role": "assistant",
"content": "SELECT \"alternate\" FROM \"teams\" WHERE \"second\"='magnus swartling';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"nation\" text,\n \"skip\" text,\n \"third\" text,\n \"second\" text,\n \"lead\" text,\n \"alternate\" text,\n \"club\" text\n);\n\nQuestion: Which club has Jamie Korab as Lead?"
},
{
"role": "assistant",
"content": "SELECT \"club\" FROM \"teams\" WHERE \"lead\"='jamie korab';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"nation\" text,\n \"skip\" text,\n \"third\" text,\n \"second\" text,\n \"lead\" text,\n \"alternate\" text,\n \"club\" text\n);\n\nQuestion: Which Lead has Hans Frauenlob as a Third?"
},
{
"role": "assistant",
"content": "SELECT \"lead\" FROM \"teams\" WHERE \"third\"='hans frauenlob';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"england_in_australia_1903_4\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: Who was the Home captain when the Result was Aus by 218 runs?"
},
{
"role": "assistant",
"content": "SELECT \"home_captain\" FROM \"england_in_australia_1903_4\" WHERE \"result\"='aus by 218 runs';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.