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 \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" text\n);\n\nQuestion: What is the To par when the score was 72-67-68-71=278?"
},
{
"role": "assistant",
"content": "SELECT \"to_par\" FROM \"final_round\" WHERE \"score\"='72-67-68-71=278';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" text\n);\n\nQuestion: What is the Place when Steve Pate was the player?"
},
{
"role": "assistant",
"content": "SELECT \"place\" FROM \"final_round\" WHERE \"player\"='steve pate';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"dorsa\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What is the diameter for 1997 when longitude is 212.0e and latitude is 47.0n?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"diameter_km\") FROM \"dorsa\" WHERE \"year_named\"=1997 AND \"longitude\"='212.0e' AND \"latitude\"='47.0n';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"dorsa\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What's the latitude when the longitude is 152.0e later than 1997?"
},
{
"role": "assistant",
"content": "SELECT \"latitude\" FROM \"dorsa\" WHERE \"year_named\">1997 AND \"longitude\"='152.0e';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"dorsa\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What's the diameter when longitude is 105.0e before 2003?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"diameter_km\") FROM \"dorsa\" WHERE \"longitude\"='105.0e' AND \"year_named\"<2003;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"dorsa\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What's the average year for the name aida-wedo dorsa with a diameter less than 450?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year_named\") FROM \"dorsa\" WHERE \"name\"='aida-wedo dorsa' AND \"diameter_km\"<450;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"dorsa\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What's the total diameter when longitude is 357.8e later than 1985?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"diameter_km\") FROM \"dorsa\" WHERE \"longitude\"='357.8e' AND \"year_named\">1985;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2_ukrainians\" (\n \"c_w_15\" real,\n \"oblast_age\" text,\n \"15_to_17\" real,\n \"18_to_19\" text,\n \"20_to_24\" real,\n \"25_to_29\" real,\n \"30_to_34\" real,\n \"35_to_39\" real,\n \"40_to_44\" real,\n \"45_to_49\" real,\n \"50_to_54\" real,\n \"55_to_59\" real,\n \"60_to_64\" real,\n \"65_to_69\" real\n);\n\nQuestion: what is the average 65 to 69 when the oblast\\age is belgorod and 40 to 44 is more than 1,906?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"65_to_69\") FROM \"2_ukrainians\" WHERE \"oblast_age\"='belgorod' AND \"40_to_44\">'1,906';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2_ukrainians\" (\n \"c_w_15\" real,\n \"oblast_age\" text,\n \"15_to_17\" real,\n \"18_to_19\" text,\n \"20_to_24\" real,\n \"25_to_29\" real,\n \"30_to_34\" real,\n \"35_to_39\" real,\n \"40_to_44\" real,\n \"45_to_49\" real,\n \"50_to_54\" real,\n \"55_to_59\" real,\n \"60_to_64\" real,\n \"65_to_69\" real\n);\n\nQuestion: what is the average 60 to 64 when 50 to 54 is less than 2,054, 35 to 39 is more than 1,704, 30 to 34 is less than 1,381 and oblast\\age is evenkia?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"60_to_64\") FROM \"2_ukrainians\" WHERE \"50_to_54\"<'2,054' AND \"35_to_39\">'1,704' AND \"30_to_34\"<'1,381' AND \"oblast_age\"='evenkia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2_ukrainians\" (\n \"c_w_15\" real,\n \"oblast_age\" text,\n \"15_to_17\" real,\n \"18_to_19\" text,\n \"20_to_24\" real,\n \"25_to_29\" real,\n \"30_to_34\" real,\n \"35_to_39\" real,\n \"40_to_44\" real,\n \"45_to_49\" real,\n \"50_to_54\" real,\n \"55_to_59\" real,\n \"60_to_64\" real,\n \"65_to_69\" real\n);\n\nQuestion: How many times is 55 to 59 less than 1,677, oblast\\age is gorod moscow and 50 to 54 is more than 1,562?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"c_w_15\") FROM \"2_ukrainians\" WHERE \"55_to_59\"<'1,677' AND \"oblast_age\"='gorod moscow' AND \"50_to_54\">'1,562';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2_ukrainians\" (\n \"c_w_15\" real,\n \"oblast_age\" text,\n \"15_to_17\" real,\n \"18_to_19\" text,\n \"20_to_24\" real,\n \"25_to_29\" real,\n \"30_to_34\" real,\n \"35_to_39\" real,\n \"40_to_44\" real,\n \"45_to_49\" real,\n \"50_to_54\" real,\n \"55_to_59\" real,\n \"60_to_64\" real,\n \"65_to_69\" real\n);\n\nQuestion: what is the average c/w 15+ when 18 to 19 is 132 and 65 to 69 is more than 1,869?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"c_w_15\") FROM \"2_ukrainians\" WHERE \"18_to_19\"='132' AND \"65_to_69\">'1,869';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"original_london_production\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: In what year was Lesli Margherita nominated?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"original_london_production\" WHERE \"nominee\"='lesli margherita';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"original_london_production\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: Who was nominated for Best Theatre Choreographer?"
},
{
"role": "assistant",
"content": "SELECT \"nominee\" FROM \"original_london_production\" WHERE \"category\"='best theatre choreographer';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_roster_2014\" (\n \"name\" text,\n \"height\" text,\n \"year\" text,\n \"hometown\" text,\n \"club\" text\n);\n\nQuestion: What hometown was FR Year, and ha Brown's Gymnastics club?"
},
{
"role": "assistant",
"content": "SELECT \"hometown\" FROM \"current_roster_2014\" WHERE \"year\"='fr' AND \"club\"='brown''s gymnastics';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_roster_2014\" (\n \"name\" text,\n \"height\" text,\n \"year\" text,\n \"hometown\" text,\n \"club\" text\n);\n\nQuestion: What year was Asi Peko?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"current_roster_2014\" WHERE \"name\"='asi peko';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_roster_2014\" (\n \"name\" text,\n \"height\" text,\n \"year\" text,\n \"hometown\" text,\n \"club\" text\n);\n\nQuestion: What is the height for the Oakville Gymnastics Club?"
},
{
"role": "assistant",
"content": "SELECT \"height\" FROM \"current_roster_2014\" WHERE \"club\"='oakville gymnastics club';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"loans_in\" (\n \"name\" text,\n \"country\" text,\n \"loan_club\" text,\n \"started\" text,\n \"ended\" text,\n \"start_source\" text,\n \"end_source\" text\n);\n\nQuestion: when was the loan ended when the loan club is spartak moscow?"
},
{
"role": "assistant",
"content": "SELECT \"ended\" FROM \"loans_in\" WHERE \"loan_club\"='spartak moscow';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"loans_in\" (\n \"name\" text,\n \"country\" text,\n \"loan_club\" text,\n \"started\" text,\n \"ended\" text,\n \"start_source\" text,\n \"end_source\" text\n);\n\nQuestion: What is the loan start source when the loan club is fulham?"
},
{
"role": "assistant",
"content": "SELECT \"start_source\" FROM \"loans_in\" WHERE \"loan_club\"='fulham';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"loans_in\" (\n \"name\" text,\n \"country\" text,\n \"loan_club\" text,\n \"started\" text,\n \"ended\" text,\n \"start_source\" text,\n \"end_source\" text\n);\n\nQuestion: When was the loan started when the coutry is eng, the loan club is sunderland and the end source is south wales echo?"
},
{
"role": "assistant",
"content": "SELECT \"started\" FROM \"loans_in\" WHERE \"country\"='eng' AND \"loan_club\"='sunderland' AND \"end_source\"='south wales echo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"loans_in\" (\n \"name\" text,\n \"country\" text,\n \"loan_club\" text,\n \"started\" text,\n \"ended\" text,\n \"start_source\" text,\n \"end_source\" text\n);\n\nQuestion: when was the loan ended when the country is ghana?"
},
{
"role": "assistant",
"content": "SELECT \"ended\" FROM \"loans_in\" WHERE \"country\"='ghana';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"loans_in\" (\n \"name\" text,\n \"country\" text,\n \"loan_club\" text,\n \"started\" text,\n \"ended\" text,\n \"start_source\" text,\n \"end_source\" text\n);\n\nQuestion: what is the loan club with the start source is bbc sport and started on 9 february?"
},
{
"role": "assistant",
"content": "SELECT \"loan_club\" FROM \"loans_in\" WHERE \"start_source\"='bbc sport' AND \"started\"='9 february';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"loans_in\" (\n \"name\" text,\n \"country\" text,\n \"loan_club\" text,\n \"started\" text,\n \"ended\" text,\n \"start_source\" text,\n \"end_source\" text\n);\n\nQuestion: what is the start source when started on 2 february?"
},
{
"role": "assistant",
"content": "SELECT \"start_source\" FROM \"loans_in\" WHERE \"started\"='2 february';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"post_positions\" (\n \"finished\" real,\n \"time_behind\" text,\n \"post\" real,\n \"horse\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text\n);\n\nQuestion: What is the lowest Finished, when Post is less than 2?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"finished\") FROM \"post_positions\" WHERE \"post\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"post_positions\" (\n \"finished\" real,\n \"time_behind\" text,\n \"post\" real,\n \"horse\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text\n);\n\nQuestion: What is Owner, when Finished is less than 15, when Trainer is \"Steve Asmussen\", and when Horse is \"Z Fortune\"?"
},
{
"role": "assistant",
"content": "SELECT \"owner\" FROM \"post_positions\" WHERE \"finished\"<15 AND \"trainer\"='steve asmussen' AND \"horse\"='z fortune';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"post_positions\" (\n \"finished\" real,\n \"time_behind\" text,\n \"post\" real,\n \"horse\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text\n);\n\nQuestion: What is the Time/ Behind, when Jockey is \"Jose Lezcano\"?"
},
{
"role": "assistant",
"content": "SELECT \"time_behind\" FROM \"post_positions\" WHERE \"jockey\"='jose lezcano';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"post_positions\" (\n \"finished\" real,\n \"time_behind\" text,\n \"post\" real,\n \"horse\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text\n);\n\nQuestion: What is Jockey, when Post is 12?"
},
{
"role": "assistant",
"content": "SELECT \"jockey\" FROM \"post_positions\" WHERE \"post\"=12;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"post_positions\" (\n \"finished\" real,\n \"time_behind\" text,\n \"post\" real,\n \"horse\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text\n);\n\nQuestion: What is the total number of Post, when Trainer is \"Steve Asmussen\", and when Time/ Behind is 19 \u00bd?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"post\") FROM \"post_positions\" WHERE \"trainer\"='steve asmussen' AND \"time_behind\"='19 \u00bd';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"post_positions\" (\n \"finished\" real,\n \"time_behind\" text,\n \"post\" real,\n \"horse\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text\n);\n\nQuestion: What is Jockey, when Horse is \"Eight Belles\"?"
},
{
"role": "assistant",
"content": "SELECT \"jockey\" FROM \"post_positions\" WHERE \"horse\"='eight belles';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"overview\" (\n \"club\" text,\n \"location\" text,\n \"current_manager\" text,\n \"team_captain\" text,\n \"stadium\" text,\n \"capacity\" real\n);\n\nQuestion: Who is the team captain of the Guldensporen Stadion with a stadium capacity larger than 12,919?"
},
{
"role": "assistant",
"content": "SELECT \"team_captain\" FROM \"overview\" WHERE \"capacity\">'12,919' AND \"stadium\"='guldensporen stadion';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"overview\" (\n \"club\" text,\n \"location\" text,\n \"current_manager\" text,\n \"team_captain\" text,\n \"stadium\" text,\n \"capacity\" real\n);\n\nQuestion: Who is the team captain of Regenboogstadion?"
},
{
"role": "assistant",
"content": "SELECT \"team_captain\" FROM \"overview\" WHERE \"stadium\"='regenboogstadion';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"overview\" (\n \"club\" text,\n \"location\" text,\n \"current_manager\" text,\n \"team_captain\" text,\n \"stadium\" text,\n \"capacity\" real\n);\n\nQuestion: Who is the current manager of the team located in tubize?"
},
{
"role": "assistant",
"content": "SELECT \"current_manager\" FROM \"overview\" WHERE \"location\"='tubize';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"overview\" (\n \"club\" text,\n \"location\" text,\n \"current_manager\" text,\n \"team_captain\" text,\n \"stadium\" text,\n \"capacity\" real\n);\n\nQuestion: Where is the location of the team with a current manager of Ariel Jacobs?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"overview\" WHERE \"current_manager\"='ariel jacobs';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_data\" (\n \"finish\" text,\n \"race\" text,\n \"distance\" text,\n \"jockey\" text,\n \"time\" text,\n \"victory_margin_in_lengths\" text,\n \"runner_up\" text,\n \"track\" text,\n \"surface\" text,\n \"date\" text\n);\n\nQuestion: What was the victory margin for a finish of 1st with a rider of Kent Desormeaux, with a time of 1:35.66?"
},
{
"role": "assistant",
"content": "SELECT \"victory_margin_in_lengths\" FROM \"race_data\" WHERE \"finish\"='1st' AND \"jockey\"='kent desormeaux' AND \"time\"='1:35.66';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_data\" (\n \"finish\" text,\n \"race\" text,\n \"distance\" text,\n \"jockey\" text,\n \"time\" text,\n \"victory_margin_in_lengths\" text,\n \"runner_up\" text,\n \"track\" text,\n \"surface\" text,\n \"date\" text\n);\n\nQuestion: What was the time of the Kentucky Derby?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"race_data\" WHERE \"race\"='kentucky derby';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_data\" (\n \"finish\" text,\n \"race\" text,\n \"distance\" text,\n \"jockey\" text,\n \"time\" text,\n \"victory_margin_in_lengths\" text,\n \"runner_up\" text,\n \"track\" text,\n \"surface\" text,\n \"date\" text\n);\n\nQuestion: What was the finish of the Kentucky Derby?"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"race_data\" WHERE \"race\"='kentucky derby';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_data\" (\n \"finish\" text,\n \"race\" text,\n \"distance\" text,\n \"jockey\" text,\n \"time\" text,\n \"victory_margin_in_lengths\" text,\n \"runner_up\" text,\n \"track\" text,\n \"surface\" text,\n \"date\" text\n);\n\nQuestion: Which race had a finish of 1st at Saratoga Race Course?"
},
{
"role": "assistant",
"content": "SELECT \"race\" FROM \"race_data\" WHERE \"finish\"='1st' AND \"track\"='saratoga race course';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" text,\n \"player\" text,\n \"team\" text,\n \"league\" text,\n \"position\" text\n);\n\nQuestion: Who was the player in 1981?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"winners\" WHERE \"year\"='1981';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" text,\n \"player\" text,\n \"team\" text,\n \"league\" text,\n \"position\" text\n);\n\nQuestion: What is the team for 1976?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"winners\" WHERE \"year\"='1976';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"preseason\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"record\" text\n);\n\nQuestion: What is the opponent for the date of august 5?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"preseason\" WHERE \"date\"='august 5';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"preseason\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"record\" text\n);\n\nQuestion: What is the result for the date of august 23?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"preseason\" WHERE \"date\"='august 23';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"preseason\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"result\" text,\n \"record\" text\n);\n\nQuestion: When the opponent is houston oilers what is the result?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"preseason\" WHERE \"opponent\"='houston oilers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_average_1\" real,\n \"points_2\" real\n);\n\nQuestion: Which Goals Against has a Drawn larger than 9, a Lost larger than 15, a Position of 24, and a Played smaller than 46?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"goals_against\") FROM \"final_table\" WHERE \"drawn\">9 AND \"lost\">15 AND \"position\"=24 AND \"played\"<46;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_average_1\" real,\n \"points_2\" real\n);\n\nQuestion: Which Points 2 has Drawn of 15, a Position larger than 20, and a Goals For smaller than 45?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points_2\") FROM \"final_table\" WHERE \"drawn\"=15 AND \"position\">20 AND \"goals_for\"<45;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_average_1\" real,\n \"points_2\" real\n);\n\nQuestion: Which Goals For has a Position larger than 2, a Lost larger than 18, a Team of matlock town, and a Goals Against larger than 79?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals_for\") FROM \"final_table\" WHERE \"position\">2 AND \"lost\">18 AND \"team\"='matlock town' AND \"goals_against\">79;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_average_1\" real,\n \"points_2\" real\n);\n\nQuestion: Which Points 2 has a Goal Average 1 larger than 1.17, a Goals Against larger than 48, and a Position larger than 6?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points_2\") FROM \"final_table\" WHERE \"goal_average_1\">1.17 AND \"goals_against\">48 AND \"position\">6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"tournament\" text,\n \"1984\" text,\n \"1985\" text,\n \"1986\" text,\n \"1987\" text,\n \"1988\" text,\n \"1989\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text,\n \"1997\" text,\n \"1998\" text,\n \"1999\" text,\n \"2000\" text\n);\n\nQuestion: What is the 1986 value with A in 1991 and A in 1987?"
},
{
"role": "assistant",
"content": "SELECT \"1986\" FROM \"singles\" WHERE \"1991\"='a' AND \"1987\"='a';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"tournament\" text,\n \"1984\" text,\n \"1985\" text,\n \"1986\" text,\n \"1987\" text,\n \"1988\" text,\n \"1989\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text,\n \"1997\" text,\n \"1998\" text,\n \"1999\" text,\n \"2000\" text\n);\n\nQuestion: What is the 1995 value with A in 1986 and 2r in 1992?"
},
{
"role": "assistant",
"content": "SELECT \"1995\" FROM \"singles\" WHERE \"1986\"='a' AND \"1992\"='2r';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"tournament\" text,\n \"1984\" text,\n \"1985\" text,\n \"1986\" text,\n \"1987\" text,\n \"1988\" text,\n \"1989\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text,\n \"1997\" text,\n \"1998\" text,\n \"1999\" text,\n \"2000\" text\n);\n\nQuestion: What is the 1989 value with F in 1990?"
},
{
"role": "assistant",
"content": "SELECT \"1989\" FROM \"singles\" WHERE \"1990\"='f';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"tournament\" text,\n \"1984\" text,\n \"1985\" text,\n \"1986\" text,\n \"1987\" text,\n \"1988\" text,\n \"1989\" text,\n \"1990\" text,\n \"1991\" text,\n \"1992\" text,\n \"1993\" text,\n \"1994\" text,\n \"1995\" text,\n \"1996\" text,\n \"1997\" text,\n \"1998\" text,\n \"1999\" text,\n \"2000\" text\n);\n\nQuestion: What is the 1987 value of the 1994 atp masters series?"
},
{
"role": "assistant",
"content": "SELECT \"1987\" FROM \"singles\" WHERE \"1994\"='atp masters series';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the lowest round that a pick had a position of ls?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"round\") FROM \"washington_redskins_draft_history\" WHERE \"position\"='ls';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What was the sum of the rounds for the player who had a position of LS and an overall draft pick bigger than 230?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"round\") FROM \"washington_redskins_draft_history\" WHERE \"position\"='ls' AND \"overall\">230;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"chinese_taipei_women_s_national_football\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"competition\" text,\n \"report\" text\n);\n\nQuestion: WHAT IS THE VENUE ON MARCH 28, 2008?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"chinese_taipei_women_s_national_football\" WHERE \"date\"='march 28, 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"houston_astros_vs_new_york_mets\" (\n \"game\" real,\n \"date\" text,\n \"score\" text,\n \"location\" text,\n \"time\" text,\n \"attendance\" real\n);\n\nQuestion: How many were in Attendance on October 8?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") FROM \"houston_astros_vs_new_york_mets\" WHERE \"date\"='october 8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"houston_astros_vs_new_york_mets\" (\n \"game\" real,\n \"date\" text,\n \"score\" text,\n \"location\" text,\n \"time\" text,\n \"attendance\" real\n);\n\nQuestion: In what Game was the Attendance more than 45,718 with a Time of 2:55?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"game\") FROM \"houston_astros_vs_new_york_mets\" WHERE \"attendance\">'45,718' AND \"time\"='2:55';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"houston_astros_vs_new_york_mets\" (\n \"game\" real,\n \"date\" text,\n \"score\" text,\n \"location\" text,\n \"time\" text,\n \"attendance\" real\n);\n\nQuestion: What is the Location of the Game on October 8?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"houston_astros_vs_new_york_mets\" WHERE \"date\"='october 8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"squad_information\" (\n \"nat\" text,\n \"name\" text,\n \"since\" text,\n \"goals\" real,\n \"ends\" real,\n \"transfer_fee\" text\n);\n\nQuestion: What is the nationality for the player with over 64 goals?"
},
{
"role": "assistant",
"content": "SELECT \"nat\" FROM \"squad_information\" WHERE \"goals\">64;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"attendance\" real,\n \"record\" text,\n \"points\" real\n);\n\nQuestion: What was the score of the game where Philadelphia was the visitor?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"visitor\"='philadelphia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2006_fifa_world_cup\" (\n \"date\" text,\n \"time_cet\" real,\n \"res\" text,\n \"round\" text,\n \"spectators\" real\n);\n\nQuestion: What are the average spectators from the Group H Round?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"spectators\") FROM \"2006_fifa_world_cup\" WHERE \"round\"='group h';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"125cc_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: Can you tell me the Manufacturer that has the Rider of stefan bradl?"
},
{
"role": "assistant",
"content": "SELECT \"manufacturer\" FROM \"125cc_classification\" WHERE \"rider\"='stefan bradl';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"125cc_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: Can you tell me the highest Grid that has the Time of +15.532, and the Laps larger than 23?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"grid\") FROM \"125cc_classification\" WHERE \"time\"='+15.532' AND \"laps\">23;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"125cc_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: Can you tell me the sum of Grid that has the Time of +6.355, and the Laps larger than 23?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"grid\") FROM \"125cc_classification\" WHERE \"time\"='+6.355' AND \"laps\">23;"
}
] |
[
{
"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 \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is Time, when Location is \"Savannah, Georgia , United States\"?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"mixed_martial_arts_record\" WHERE \"location\"='savannah, georgia , united states';"
}
] |
[
{
"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 \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the total number of Round(s), when Time is \"N/A\", when Location is \"Alabama , United States\", and when Record is \"1-2-0\"?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"round\") FROM \"mixed_martial_arts_record\" WHERE \"time\"='n/a' AND \"location\"='alabama , united states' AND \"record\"='1-2-0';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"programs_returning_in_1987\" (\n \"show\" text,\n \"last_aired\" real,\n \"previous_network\" text,\n \"retitled_as_same\" text,\n \"new_returning_same_network\" text,\n \"returning\" text\n);\n\nQuestion: Which Retitled as/Same has a Last Aired larger than 1982, and a Show of we got it made?"
},
{
"role": "assistant",
"content": "SELECT \"retitled_as_same\" FROM \"programs_returning_in_1987\" WHERE \"last_aired\">1982 AND \"show\"='we got it made';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"programs_returning_in_1987\" (\n \"show\" text,\n \"last_aired\" real,\n \"previous_network\" text,\n \"retitled_as_same\" text,\n \"new_returning_same_network\" text,\n \"returning\" text\n);\n\nQuestion: Which New/Returning/Same Network has a Last Aired of 1982?"
},
{
"role": "assistant",
"content": "SELECT \"new_returning_same_network\" FROM \"programs_returning_in_1987\" WHERE \"last_aired\"=1982;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"programs_returning_in_1987\" (\n \"show\" text,\n \"last_aired\" real,\n \"previous_network\" text,\n \"retitled_as_same\" text,\n \"new_returning_same_network\" text,\n \"returning\" text\n);\n\nQuestion: Which New/Returning/Same Network has a Previous Network of nbc, and a Show of blockbusters?"
},
{
"role": "assistant",
"content": "SELECT \"new_returning_same_network\" FROM \"programs_returning_in_1987\" WHERE \"previous_network\"='nbc' AND \"show\"='blockbusters';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"programs_returning_in_1987\" (\n \"show\" text,\n \"last_aired\" real,\n \"previous_network\" text,\n \"retitled_as_same\" text,\n \"new_returning_same_network\" text,\n \"returning\" text\n);\n\nQuestion: Which New/Returning/Same Network has a Retitled as/Same of same, and a Last Aired larger than 1984?"
},
{
"role": "assistant",
"content": "SELECT \"new_returning_same_network\" FROM \"programs_returning_in_1987\" WHERE \"retitled_as_same\"='same' AND \"last_aired\">1984;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"programs_returning_in_1987\" (\n \"show\" text,\n \"last_aired\" real,\n \"previous_network\" text,\n \"retitled_as_same\" text,\n \"new_returning_same_network\" text,\n \"returning\" text\n);\n\nQuestion: Which Last Aired has a Retitled as/Same of classic concentration?"
},
{
"role": "assistant",
"content": "SELECT \"last_aired\" FROM \"programs_returning_in_1987\" WHERE \"retitled_as_same\"='classic concentration';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"races\" (\n \"round\" real,\n \"name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"winning_car\" text\n);\n\nQuestion: How many rounds had a race name of anglia tv trophy?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"round\") FROM \"races\" WHERE \"name\"='anglia tv trophy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"races\" (\n \"round\" real,\n \"name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"winning_car\" text\n);\n\nQuestion: What circuit was the race named international trophy raced at by the winning driver eliseo salazar?"
},
{
"role": "assistant",
"content": "SELECT \"circuit\" FROM \"races\" WHERE \"winning_driver\"='eliseo salazar' AND \"name\"='international trophy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"races\" (\n \"round\" real,\n \"name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"winning_car\" text\n);\n\nQuestion: What circuit did emilio de villota win on at the pace petroleum trophy?"
},
{
"role": "assistant",
"content": "SELECT \"circuit\" FROM \"races\" WHERE \"winning_driver\"='emilio de villota' AND \"name\"='pace petroleum trophy';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What is the to par of the player from the United States with a t6 place and a score of 70-73-68-73=284?"
},
{
"role": "assistant",
"content": "SELECT \"to_par\" FROM \"final_round\" WHERE \"country\"='united states' AND \"place\"='t6' AND \"score\"='70-73-68-73=284';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: Who is the player from Australia with a to par of +5?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"final_round\" WHERE \"to_par\"='+5' AND \"country\"='australia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What is the highest amount of money a player with a score of 69-71-71-73=284 has?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"money\") FROM \"final_round\" WHERE \"score\"='69-71-71-73=284';"
}
] |
[
{
"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 of the match with 3 rounds and a 9-3 record?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"mixed_martial_arts_record\" WHERE \"round\"=3 AND \"record\"='9-3';"
}
] |
[
{
"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 method of the match with a win res., 1 round, and a 3-2 record?"
},
{
"role": "assistant",
"content": "SELECT \"method\" FROM \"mixed_martial_arts_record\" WHERE \"res\"='win' AND \"round\"=1 AND \"record\"='3-2';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"contestants\" (\n \"name\" text,\n \"occupation\" text,\n \"hometown\" text,\n \"season\" text,\n \"finish\" text\n);\n\nQuestion: Who was the sports agent who finished 9th?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"contestants\" WHERE \"finish\"='9th' AND \"occupation\"='sports agent';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: What is the lowest score that wes ellis got?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"score\") FROM \"first_round\" WHERE \"player\"='wes ellis';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: What was the score for the player from the United states that was +1 to par?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"first_round\" WHERE \"to_par\"='+1' AND \"country\"='united states';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: Who was the player who placed t10?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"first_round\" WHERE \"place\"='t10';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: How far to par did ed furgol from the United States get when he scored less than 72 and was placed at t3?"
},
{
"role": "assistant",
"content": "SELECT \"to_par\" FROM \"first_round\" WHERE \"country\"='united states' AND \"score\"<72 AND \"place\"='t3' AND \"player\"='ed furgol';"
}
] |
[
{
"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 game was played at Philadelphia?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"game\") FROM \"game_log\" WHERE \"team\"='philadelphia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tv_ratings\" (\n \"order\" text,\n \"episode\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_millions\" real,\n \"rank_night\" real,\n \"rank_timeslot\" real,\n \"rank_week\" real\n);\n\nQuestion: What is the sum of share with a rating larger than 1.2, a 3 rank timeslot, and 6.07 million viewers?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"share\") FROM \"tv_ratings\" WHERE \"rating\">1.2 AND \"rank_timeslot\"=3 AND \"viewers_millions\"=6.07;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tv_ratings\" (\n \"order\" text,\n \"episode\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_millions\" real,\n \"rank_night\" real,\n \"rank_timeslot\" real,\n \"rank_week\" real\n);\n\nQuestion: What is the average week rank with 1.2 ratings, less than 1.94 million viewers, and a night rank less than 11?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank_week\") FROM \"tv_ratings\" WHERE \"rating\"=1.2 AND \"viewers_millions\"<1.94 AND \"rank_night\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: what is the round when the college is syracuse and the pick is less than 3?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"round\") FROM \"washington_redskins_draft_history\" WHERE \"college\"='syracuse' AND \"pick\"<3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: what is the position when the pick is more than 2, the overall is more than 28 and the college is nebraska?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"washington_redskins_draft_history\" WHERE \"pick\">2 AND \"overall\">28 AND \"college\"='nebraska';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: what is the pick when the college is arkansas and the overall is more than 316?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"pick\") FROM \"washington_redskins_draft_history\" WHERE \"college\"='arkansas' AND \"overall\">316;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: what is the lowest overall when the pick is less than 2?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"pick\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: what is the round when the college is north carolina and the overall is more than 124?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"round\") FROM \"washington_redskins_draft_history\" WHERE \"college\"='north carolina' AND \"overall\">124;"
}
] |
[
{
"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 \"tv_time\" text\n);\n\nQuestion: October 28, 2001 was what week of the season?"
},
{
"role": "assistant",
"content": "SELECT \"week\" FROM \"schedule\" WHERE \"date\"='october 28, 2001';"
}
] |
[
{
"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 \"tv_time\" text\n);\n\nQuestion: What was the result of week 11?"
},
{
"role": "assistant",
"content": "SELECT \"result\" 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 \"tv_time\" text\n);\n\nQuestion: What was the date of a week larger than 16?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"week\">16;"
}
] |
[
{
"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 \"tv_time\" text\n);\n\nQuestion: November 25, 2001 was what week of the season?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"week\") FROM \"schedule\" WHERE \"date\"='november 25, 2001';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"electric_locomotives\" (\n \"railway\" text,\n \"builder\" text,\n \"built\" real,\n \"wheels\" text,\n \"location\" text,\n \"object_number\" text\n);\n\nQuestion: Which Wheels has Built smaller than 1958, a Location of york, and a Railway of nsr?"
},
{
"role": "assistant",
"content": "SELECT \"wheels\" FROM \"electric_locomotives\" WHERE \"built\"<1958 AND \"location\"='york' AND \"railway\"='nsr';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"electric_locomotives\" (\n \"railway\" text,\n \"builder\" text,\n \"built\" real,\n \"wheels\" text,\n \"location\" text,\n \"object_number\" text\n);\n\nQuestion: Which Built has a Builder of brel crewe?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"built\") FROM \"electric_locomotives\" WHERE \"builder\"='brel crewe';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"electric_locomotives\" (\n \"railway\" text,\n \"builder\" text,\n \"built\" real,\n \"wheels\" text,\n \"location\" text,\n \"object_number\" text\n);\n\nQuestion: Which Railway has a Location of shildon, and an ObjectNumber of 1978-7006?"
},
{
"role": "assistant",
"content": "SELECT \"railway\" FROM \"electric_locomotives\" WHERE \"location\"='shildon' AND \"object_number\"='1978-7006';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"electric_locomotives\" (\n \"railway\" text,\n \"builder\" text,\n \"built\" real,\n \"wheels\" text,\n \"location\" text,\n \"object_number\" text\n);\n\nQuestion: Which Railway has a Location of shildon, and an ObjectNumber of 1975-7022?"
},
{
"role": "assistant",
"content": "SELECT \"railway\" FROM \"electric_locomotives\" WHERE \"location\"='shildon' AND \"object_number\"='1975-7022';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"electric_locomotives\" (\n \"railway\" text,\n \"builder\" text,\n \"built\" real,\n \"wheels\" text,\n \"location\" text,\n \"object_number\" text\n);\n\nQuestion: Which Location has an ObjectNumber of 2005-7698?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"electric_locomotives\" WHERE \"object_number\"='2005-7698';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notable_former_players\" (\n \"name\" text,\n \"club\" text,\n \"position\" text,\n \"years\" text,\n \"current_status\" text\n);\n\nQuestion: What is the Club during the Years 1995\u20131996?"
},
{
"role": "assistant",
"content": "SELECT \"club\" FROM \"notable_former_players\" WHERE \"years\"='1995\u20131996';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"notable_former_players\" (\n \"name\" text,\n \"club\" text,\n \"position\" text,\n \"years\" text,\n \"current_status\" text\n);\n\nQuestion: In what Years was the Player in MF Position?"
},
{
"role": "assistant",
"content": "SELECT \"years\" FROM \"notable_former_players\" WHERE \"position\"='mf';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.