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 \"sovereign_states\" (\n \"name\" text,\n \"subdivisions\" text,\n \"area_km\" real,\n \"population_1_july_2005_est\" real,\n \"population_density_per_km\" real,\n \"capital\" text\n);\n\nQuestion: What is Population density (per km\u00b2), when Name is Antigua and Barbuda, and when Capital is St. John's?" }, { "role": "assistant", "content": "SELECT \"population_density_per_km\" FROM \"sovereign_states\" WHERE \"name\"='antigua and barbuda' AND \"capital\"='st. john''s';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_slam_men_s_doubles_finals_20_16_4\" (\n \"outcome\" text,\n \"year\" real,\n \"championship\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents\" text,\n \"score\" text\n);\n\nQuestion: Who were the opponents on grass when playing with Mark Woodforde, and the outcome of winner, and a year greater than 1996?" }, { "role": "assistant", "content": "SELECT \"opponents\" FROM \"grand_slam_men_s_doubles_finals_20_16_4\" WHERE \"surface\"='grass' AND \"partner\"='mark woodforde' AND \"outcome\"='winner' AND \"year\">1996;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_slam_men_s_doubles_finals_20_16_4\" (\n \"outcome\" text,\n \"year\" real,\n \"championship\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents\" text,\n \"score\" text\n);\n\nQuestion: Who was the partner at the Australian Open, Melbourne when the score was 2\u20136, 7\u20135, 6\u20132, 4\u20136, 3\u20136?" }, { "role": "assistant", "content": "SELECT \"partner\" FROM \"grand_slam_men_s_doubles_finals_20_16_4\" WHERE \"championship\"='australian open, melbourne' AND \"score\"='2\u20136, 7\u20135, 6\u20132, 4\u20136, 3\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_slam_men_s_doubles_finals_20_16_4\" (\n \"outcome\" text,\n \"year\" real,\n \"championship\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents\" text,\n \"score\" text\n);\n\nQuestion: When playing on grass who was the opponents in a year greater than 1993, and playing with Jonas Bj\u00f6rkman?" }, { "role": "assistant", "content": "SELECT \"opponents\" FROM \"grand_slam_men_s_doubles_finals_20_16_4\" WHERE \"surface\"='grass' AND \"year\">1993 AND \"partner\"='jonas bj\u00f6rkman';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"year_by_year\" (\n \"year\" real,\n \"division\" real,\n \"league\" text,\n \"regular_season\" text,\n \"playoffs\" text,\n \"open_canada_cup\" text\n);\n\nQuestion: Which league's playoffs was national semi-finals?" }, { "role": "assistant", "content": "SELECT \"league\" FROM \"year_by_year\" WHERE \"playoffs\"='national semi-finals';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: Which country is Lemd the ICAO of?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"references\" WHERE \"icao\"='lemd';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: Paris-Charles de Gaulle airport is in which country?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"references\" WHERE \"airport\"='paris-charles de gaulle airport';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: What is the ICAO for Riyadh, Saudi Arabia?" }, { "role": "assistant", "content": "SELECT \"icao\" FROM \"references\" WHERE \"country\"='saudi arabia' AND \"city\"='riyadh';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: What is the IATA for Benghazi, Libya?" }, { "role": "assistant", "content": "SELECT \"iata\" FROM \"references\" WHERE \"country\"='libya' AND \"city\"='benghazi';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"superbike_race_1_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: What is the average Grid for the honda cbr1000rr, with 18 laps and a time of +1:12.884?" }, { "role": "assistant", "content": "SELECT AVG(\"grid\") FROM \"superbike_race_1_classification\" WHERE \"bike\"='honda cbr1000rr' AND \"laps\"=18 AND \"time\"='+1:12.884';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"superbike_race_1_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: What is the Bike with 18 laps and +41.280 as the time?" }, { "role": "assistant", "content": "SELECT \"bike\" FROM \"superbike_race_1_classification\" WHERE \"laps\"=18 AND \"time\"='+41.280';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"superbike_race_1_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: What is the Time when there are 18 laps, grid larger than 15, and Rider of Russell Holland?" }, { "role": "assistant", "content": "SELECT \"time\" FROM \"superbike_race_1_classification\" WHERE \"laps\"=18 AND \"grid\">15 AND \"rider\"='russell holland';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"superbike_race_1_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: What is the Bike with a grid more than 4 and the rider is Michel Fabrizio?" }, { "role": "assistant", "content": "SELECT \"bike\" FROM \"superbike_race_1_classification\" WHERE \"grid\">4 AND \"rider\"='michel fabrizio';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"most_goals\" (\n \"name\" text,\n \"career\" text,\n \"goals\" real,\n \"appearances\" real,\n \"goals_game_ratio\" real\n);\n\nQuestion: What was Lee Smith's highest number of goals when he made fewer than 364 appearances?" }, { "role": "assistant", "content": "SELECT MAX(\"goals\") FROM \"most_goals\" WHERE \"name\"='lee smith' AND \"appearances\"<364;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"most_goals\" (\n \"name\" text,\n \"career\" text,\n \"goals\" real,\n \"appearances\" real,\n \"goals_game_ratio\" real\n);\n\nQuestion: What is the sum of Rob Coldray's goals when he made fewer than 348 appearances with goals/game ratio less than 0.313?" }, { "role": "assistant", "content": "SELECT SUM(\"goals\") FROM \"most_goals\" WHERE \"goals_game_ratio\"<0.313 AND \"name\"='rob coldray' AND \"appearances\"<348;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"most_goals\" (\n \"name\" text,\n \"career\" text,\n \"goals\" real,\n \"appearances\" real,\n \"goals_game_ratio\" real\n);\n\nQuestion: Which goals/game ratio has fewer than 201 goals and fewer than 170 appearances?" }, { "role": "assistant", "content": "SELECT \"goals_game_ratio\" FROM \"most_goals\" WHERE \"goals\"<201 AND \"appearances\"<170;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: What is the average rank of the airport in S\u00e3o Paulo with passengers totaling less than 18,795,596?" }, { "role": "assistant", "content": "SELECT AVG(\"rank\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"location\"='s\u00e3o paulo' AND \"total_passengers\"<'18,795,596';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: What is the average rank of the airport with a 9.3% annual change?" }, { "role": "assistant", "content": "SELECT AVG(\"rank\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"annual_change\"='9.3%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: Where is the airport located that has a 98.9% in use capacity?" }, { "role": "assistant", "content": "SELECT \"location\" FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"capacity_in_use\"='98.9%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: What rank is the airport in Fortaleza?" }, { "role": "assistant", "content": "SELECT \"rank\" FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"location\"='fortaleza';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"recent_winners\" (\n \"year_theme\" text,\n \"award_name\" text,\n \"team_name\" text,\n \"team_number\" real,\n \"city_state_country\" text\n);\n\nQuestion: What is the Award name with a Team name that is cougar robotics team?" }, { "role": "assistant", "content": "SELECT \"award_name\" FROM \"recent_winners\" WHERE \"team_name\"='cougar robotics team';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rookie_cup\" (\n \"driver\" text,\n \"nor_1\" text,\n \"nor_2\" text,\n \"zan_1\" text,\n \"zan_2\" text,\n \"n_r_1\" text,\n \"n_r_2\" text\n);\n\nQuestion: What is the zan 1 that has 11 as the nor 1?" }, { "role": "assistant", "content": "SELECT \"zan_1\" FROM \"rookie_cup\" WHERE \"nor_1\"='11';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rookie_cup\" (\n \"driver\" text,\n \"nor_1\" text,\n \"nor_2\" text,\n \"zan_1\" text,\n \"zan_2\" text,\n \"n_r_1\" text,\n \"n_r_2\" text\n);\n\nQuestion: What driver has 19 as the zan 1?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"rookie_cup\" WHERE \"zan_1\"='19';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rookie_cup\" (\n \"driver\" text,\n \"nor_1\" text,\n \"nor_2\" text,\n \"zan_1\" text,\n \"zan_2\" text,\n \"n_r_1\" text,\n \"n_r_2\" text\n);\n\nQuestion: What driver has 5 as the zan 2?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"rookie_cup\" WHERE \"zan_2\"='5';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rookie_cup\" (\n \"driver\" text,\n \"nor_1\" text,\n \"nor_2\" text,\n \"zan_1\" text,\n \"zan_2\" text,\n \"n_r_1\" text,\n \"n_r_2\" text\n);\n\nQuestion: What is the nor 2 that has nor 1 as nor 1?" }, { "role": "assistant", "content": "SELECT \"nor_2\" FROM \"rookie_cup\" WHERE \"nor_1\"='nor 1';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rookie_cup\" (\n \"driver\" text,\n \"nor_1\" text,\n \"nor_2\" text,\n \"zan_1\" text,\n \"zan_2\" text,\n \"n_r_1\" text,\n \"n_r_2\" text\n);\n\nQuestion: What driver has 22 as nor 1?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"rookie_cup\" WHERE \"nor_1\"='22';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"australia_in_england_1905\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: What Date had a Result of draw, and a Venue of lord's?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"australia_in_england_1905\" WHERE \"result\"='draw' AND \"venue\"='lord''s';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"australia_in_england_1905\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: What Date that had a Result of draw, with Oval as a venue?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"australia_in_england_1905\" WHERE \"result\"='draw' AND \"venue\"='oval';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"australia_in_england_1905\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: What is the Away captain when the Result was draw, and a Venue of lord's?" }, { "role": "assistant", "content": "SELECT \"away_captain\" FROM \"australia_in_england_1905\" WHERE \"result\"='draw' AND \"venue\"='lord''s';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"australia_in_england_1905\" (\n \"date\" text,\n \"home_captain\" text,\n \"away_captain\" text,\n \"venue\" text,\n \"result\" text\n);\n\nQuestion: What is the Date when the match Resulted in a draw?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"australia_in_england_1905\" WHERE \"result\"='draw';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_11\" (\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 margin of victory when the winning score was \u201310 (70-72-68-68=278)?" }, { "role": "assistant", "content": "SELECT \"margin_of_victory\" FROM \"pga_tour_wins_11\" WHERE \"winning_score\"='\u201310 (70-72-68-68=278)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_11\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: When Gary Player was the runner-up, what was the margin of victory?" }, { "role": "assistant", "content": "SELECT \"margin_of_victory\" FROM \"pga_tour_wins_11\" WHERE \"runner_s_up\"='gary player';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_11\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: In what tournament was the winning score \u201310 (68-71-69-70=278)?" }, { "role": "assistant", "content": "SELECT \"tournament\" FROM \"pga_tour_wins_11\" WHERE \"winning_score\"='\u201310 (68-71-69-70=278)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"european_tour_professional_career_summar\" (\n \"year\" text,\n \"starts\" real,\n \"cuts_made\" real,\n \"wins\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"earnings\" real,\n \"money_list_rank\" text\n);\n\nQuestion: What is the highest number of wins when earnings are larger than 150,643, more than 1 cut was made, there are more than 22 starts, and the money list rank is 32?" }, { "role": "assistant", "content": "SELECT MAX(\"wins\") FROM \"european_tour_professional_career_summar\" WHERE \"earnings\">'150,643' AND \"cuts_made\">1 AND \"starts\">22 AND \"money_list_rank\"='32';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"european_tour_professional_career_summar\" (\n \"year\" text,\n \"starts\" real,\n \"cuts_made\" real,\n \"wins\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"earnings\" real,\n \"money_list_rank\" text\n);\n\nQuestion: What is the highest number of wins when more than 17 cuts and more than 25 starts were made, and the top 10 ranking is less than 8?" }, { "role": "assistant", "content": "SELECT MAX(\"wins\") FROM \"european_tour_professional_career_summar\" WHERE \"cuts_made\">17 AND \"starts\">25 AND \"top_10\"<8;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"european_tour_professional_career_summar\" (\n \"year\" text,\n \"starts\" real,\n \"cuts_made\" real,\n \"wins\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"earnings\" real,\n \"money_list_rank\" text\n);\n\nQuestion: What is the average number of starts when the money list rank is 108 and the rank in the top 25 is greater than 4?" }, { "role": "assistant", "content": "SELECT AVG(\"starts\") FROM \"european_tour_professional_career_summar\" WHERE \"money_list_rank\"='108' AND \"top_25\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"european_tour_professional_career_summar\" (\n \"year\" text,\n \"starts\" real,\n \"cuts_made\" real,\n \"wins\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"earnings\" real,\n \"money_list_rank\" text\n);\n\nQuestion: What is the money list rank when the starts are less than 30, earnings are larger than 8,689, and the ranking is 2 in the top 25?" }, { "role": "assistant", "content": "SELECT \"money_list_rank\" FROM \"european_tour_professional_career_summar\" WHERE \"starts\"<30 AND \"earnings\">'8,689' AND \"top_25\"=2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"european_tour_professional_career_summar\" (\n \"year\" text,\n \"starts\" real,\n \"cuts_made\" real,\n \"wins\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"earnings\" real,\n \"money_list_rank\" text\n);\n\nQuestion: What is the average number of starts when 11 cuts were made and the top 10 ranking is larger than 4?" }, { "role": "assistant", "content": "SELECT AVG(\"starts\") FROM \"european_tour_professional_career_summar\" WHERE \"cuts_made\"=11 AND \"top_10\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"roster\" (\n \"name\" text,\n \"height\" text,\n \"weight_lbs\" real,\n \"position\" text,\n \"class\" text,\n \"hometown\" text\n);\n\nQuestion: What is the Name when the position is g, and weight is 190 pounds?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"roster\" WHERE \"position\"='g' AND \"weight_lbs\"=190;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"roster\" (\n \"name\" text,\n \"height\" text,\n \"weight_lbs\" real,\n \"position\" text,\n \"class\" text,\n \"hometown\" text\n);\n\nQuestion: What is the Position with a weight of more than 195 pounds, height of 6'5\", and named David Hoskins 3?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"roster\" WHERE \"weight_lbs\">195 AND \"height\"='6''5\\\"' AND \"name\"='david hoskins 3';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"roster\" (\n \"name\" text,\n \"height\" text,\n \"weight_lbs\" real,\n \"position\" text,\n \"class\" text,\n \"hometown\" text\n);\n\nQuestion: What is the sum of Weight for the person with a height of 6'6\"?" }, { "role": "assistant", "content": "SELECT SUM(\"weight_lbs\") FROM \"roster\" WHERE \"height\"='6''6\\\"';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"february\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"record\" text\n);\n\nQuestion: Who was the home team of the game on 2 February 2006?" }, { "role": "assistant", "content": "SELECT \"home\" FROM \"february\" WHERE \"date\"='2 february 2006';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"february\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"record\" text\n);\n\nQuestion: What is the home team of the game with Warriors as the visitor team?" }, { "role": "assistant", "content": "SELECT \"home\" FROM \"february\" WHERE \"visitor\"='warriors';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_10_7_3\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What date was the match on a hard surface with a score of 6\u20134, 2\u20136, 3\u20136?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"singles_10_7_3\" WHERE \"surface\"='hard' AND \"score\"='6\u20134, 2\u20136, 3\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_10_7_3\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is the Score of the match on a clay surface with an outcome of winner, at the tournament ciudad ju\u00e1rez, and an Opponent in the final of estefania craci\u00fan?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"singles_10_7_3\" WHERE \"surface\"='clay' AND \"outcome\"='winner' AND \"tournament\"='ciudad ju\u00e1rez' AND \"opponent_in_the_final\"='estefania craci\u00fan';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_10_7_3\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is the Outcome of the match with a Score of 6\u20133, 6\u20134?" }, { "role": "assistant", "content": "SELECT \"outcome\" FROM \"singles_10_7_3\" WHERE \"score\"='6\u20133, 6\u20134';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_10_7_3\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is the Outcome of the match with a Score of 6\u20133, 6\u20134?" }, { "role": "assistant", "content": "SELECT \"outcome\" FROM \"singles_10_7_3\" WHERE \"score\"='6\u20133, 6\u20134';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_10_7_3\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What is the Outcome of the match on 12 september 2004?" }, { "role": "assistant", "content": "SELECT \"outcome\" FROM \"singles_10_7_3\" WHERE \"date\"='12 september 2004';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_10_7_3\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What was the Surface when the Score was 6\u20134, 2\u20136, 3\u20136?" }, { "role": "assistant", "content": "SELECT \"surface\" FROM \"singles_10_7_3\" WHERE \"score\"='6\u20134, 2\u20136, 3\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cost_per_kilowatt_hour_us_cents_k_wh\" (\n \"20_years\" text,\n \"2400_k_wh_k_w_p_y\" real,\n \"2200_k_wh_k_w_p_y\" real,\n \"2000_k_wh_k_w_p_y\" real,\n \"1800_k_wh_k_w_p_y\" real,\n \"1600_k_wh_k_w_p_y\" real,\n \"1400_k_wh_k_w_p_y\" real,\n \"1200_k_wh_k_w_p_y\" real,\n \"1000_k_wh_k_w_p_y\" real,\n \"800_k_wh_k_w_p_y\" real\n);\n\nQuestion: What is the 2000 kwh p y with a 2400 kwh/kw p y less than 12.5, a 3.8 1600 kwh/kw p y, and a 1800 kwh/kw p y less than 3.3?" }, { "role": "assistant", "content": "SELECT MAX(\"2000_k_wh_k_w_p_y\") FROM \"cost_per_kilowatt_hour_us_cents_k_wh\" WHERE \"2400_k_wh_k_w_p_y\"<12.5 AND \"1600_k_wh_k_w_p_y\"=3.8 AND \"1800_k_wh_k_w_p_y\"<3.3;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cost_per_kilowatt_hour_us_cents_k_wh\" (\n \"20_years\" text,\n \"2400_k_wh_k_w_p_y\" real,\n \"2200_k_wh_k_w_p_y\" real,\n \"2000_k_wh_k_w_p_y\" real,\n \"1800_k_wh_k_w_p_y\" real,\n \"1600_k_wh_k_w_p_y\" real,\n \"1400_k_wh_k_w_p_y\" real,\n \"1200_k_wh_k_w_p_y\" real,\n \"1000_k_wh_k_w_p_y\" real,\n \"800_k_wh_k_w_p_y\" real\n);\n\nQuestion: What is the total number of 1800 kwk/kw p y with an 8.8 1600 kwh/kw p y, and a 1200 kwh/kw p y greater than 11.7?" }, { "role": "assistant", "content": "SELECT COUNT(\"1800_k_wh_k_w_p_y\") FROM \"cost_per_kilowatt_hour_us_cents_k_wh\" WHERE \"1600_k_wh_k_w_p_y\"=8.8 AND \"1200_k_wh_k_w_p_y\">11.7;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cost_per_kilowatt_hour_us_cents_k_wh\" (\n \"20_years\" text,\n \"2400_k_wh_k_w_p_y\" real,\n \"2200_k_wh_k_w_p_y\" real,\n \"2000_k_wh_k_w_p_y\" real,\n \"1800_k_wh_k_w_p_y\" real,\n \"1600_k_wh_k_w_p_y\" real,\n \"1400_k_wh_k_w_p_y\" real,\n \"1200_k_wh_k_w_p_y\" real,\n \"1000_k_wh_k_w_p_y\" real,\n \"800_k_wh_k_w_p_y\" real\n);\n\nQuestion: What is the average 800 kwh/kw p y with a 1600 kwh/kw p y less than 6.3 and a 2000 kwh/kw p y less than 1?" }, { "role": "assistant", "content": "SELECT AVG(\"800_k_wh_k_w_p_y\") FROM \"cost_per_kilowatt_hour_us_cents_k_wh\" WHERE \"1600_k_wh_k_w_p_y\"<6.3 AND \"2000_k_wh_k_w_p_y\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cost_per_kilowatt_hour_us_cents_k_wh\" (\n \"20_years\" text,\n \"2400_k_wh_k_w_p_y\" real,\n \"2200_k_wh_k_w_p_y\" real,\n \"2000_k_wh_k_w_p_y\" real,\n \"1800_k_wh_k_w_p_y\" real,\n \"1600_k_wh_k_w_p_y\" real,\n \"1400_k_wh_k_w_p_y\" real,\n \"1200_k_wh_k_w_p_y\" real,\n \"1000_k_wh_k_w_p_y\" real,\n \"800_k_wh_k_w_p_y\" real\n);\n\nQuestion: What is the average 2400 kwh/kw p y with a 1400 kwh/kw p y greater than 12.9, a 1200 kwh/kw p y greater than 21.7, and a 1600 kwh/kw p y greater than 18.8?" }, { "role": "assistant", "content": "SELECT AVG(\"2400_k_wh_k_w_p_y\") FROM \"cost_per_kilowatt_hour_us_cents_k_wh\" WHERE \"1400_k_wh_k_w_p_y\">12.9 AND \"1200_k_wh_k_w_p_y\">21.7 AND \"1600_k_wh_k_w_p_y\">18.8;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What was the total attendance at a game against the Pittsburgh Steelers before week 4?" }, { "role": "assistant", "content": "SELECT COUNT(\"attendance\") FROM \"schedule\" WHERE \"opponent\"='pittsburgh steelers' AND \"week\"<4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"premier_division\" (\n \"date\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What was the date of the game held at the A venue with a result of 0-1 against the Rangers?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"premier_division\" WHERE \"venue\"='a' AND \"result\"='0-1' AND \"opponent\"='rangers';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: Who was the opponent on November 11, 2001?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"date\"='november 11, 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 \"attendance\" text\n);\n\nQuestion: Who was the opponent before week 5 that played on September 23, 2001?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"week\"<5 AND \"date\"='september 23, 2001';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"tyler\" (\n \"model_number\" text,\n \"frequency\" text,\n \"l2_cache\" text,\n \"multiplier_1\" text,\n \"voltage\" text,\n \"socket\" text,\n \"release_date\" text,\n \"order_part_number\" text\n);\n\nQuestion: What is the frequency of the Turion 64 X2 TL-62?" }, { "role": "assistant", "content": "SELECT \"frequency\" FROM \"tyler\" WHERE \"model_number\"='turion 64 x2 tl-62';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"tyler\" (\n \"model_number\" text,\n \"frequency\" text,\n \"l2_cache\" text,\n \"multiplier_1\" text,\n \"voltage\" text,\n \"socket\" text,\n \"release_date\" text,\n \"order_part_number\" text\n);\n\nQuestion: What is the socket for Order Part Number TMDTL68HAX5DM?" }, { "role": "assistant", "content": "SELECT \"socket\" FROM \"tyler\" WHERE \"order_part_number\"='tmdtl68hax5dm';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"tyler\" (\n \"model_number\" text,\n \"frequency\" text,\n \"l2_cache\" text,\n \"multiplier_1\" text,\n \"voltage\" text,\n \"socket\" text,\n \"release_date\" text,\n \"order_part_number\" text\n);\n\nQuestion: What is the multiplier 1 for chips with a frequency of 1800MHz?" }, { "role": "assistant", "content": "SELECT \"multiplier_1\" FROM \"tyler\" WHERE \"frequency\"='1800mhz';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"tyler\" (\n \"model_number\" text,\n \"frequency\" text,\n \"l2_cache\" text,\n \"multiplier_1\" text,\n \"voltage\" text,\n \"socket\" text,\n \"release_date\" text,\n \"order_part_number\" text\n);\n\nQuestion: What is the socket type for the processor with a multiplier 1 of 11.5x?" }, { "role": "assistant", "content": "SELECT \"socket\" FROM \"tyler\" WHERE \"multiplier_1\"='11.5x';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"polling\" (\n \"poll_source\" text,\n \"date_s_administered\" text,\n \"sample_size\" real,\n \"margin_of_error\" text,\n \"mel_martinez_r\" text,\n \"betty_castor_d\" text\n);\n\nQuestion: What is the highest sample size administered on October 18?" }, { "role": "assistant", "content": "SELECT MAX(\"sample_size\") FROM \"polling\" WHERE \"date_s_administered\"='october 18';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"polling\" (\n \"poll_source\" text,\n \"date_s_administered\" text,\n \"sample_size\" real,\n \"margin_of_error\" text,\n \"mel_martinez_r\" text,\n \"betty_castor_d\" text\n);\n\nQuestion: What is the percentage for Mel Martinez when the sample size is 800?" }, { "role": "assistant", "content": "SELECT \"mel_martinez_r\" FROM \"polling\" WHERE \"sample_size\"=800;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"apea_s_campeonato_paulista\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: How many games were played by the Scottish Wanderers where less than 5 Points were scored?" }, { "role": "assistant", "content": "SELECT SUM(\"played\") FROM \"apea_s_campeonato_paulista\" WHERE \"team\"='scottish wanderers' AND \"points\"<5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"apea_s_campeonato_paulista\" (\n \"position\" real,\n \"team\" text,\n \"points\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"against\" real,\n \"difference\" text\n);\n\nQuestion: How many games were played where exactly 15 points were scored?" }, { "role": "assistant", "content": "SELECT SUM(\"played\") FROM \"apea_s_campeonato_paulista\" WHERE \"points\"=15;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1867_74\" (\n \"1st_built\" real,\n \"1913_class\" text,\n \"w_a\" text,\n \"no_built\" real,\n \"builder\" text,\n \"date\" text,\n \"lner_class\" text\n);\n\nQuestion: What LINER class has a W.A. of 0-6-0st with a 2 No. Built?" }, { "role": "assistant", "content": "SELECT \"lner_class\" FROM \"1867_74\" WHERE \"w_a\"='0-6-0st' AND \"no_built\"=2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_four\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the pick number for Peter Moore of the Montreal Alouettes?" }, { "role": "assistant", "content": "SELECT \"pick_num\" FROM \"round_four\" WHERE \"cfl_team\"='montreal alouettes' AND \"player\"='peter moore';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_four\" (\n \"pick_num\" real,\n \"cfl_team\" text,\n \"player\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What CFL team did Kelly Bates play for?" }, { "role": "assistant", "content": "SELECT \"cfl_team\" FROM \"round_four\" WHERE \"player\"='kelly bates';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"most_derby_appearances\" (\n \"competition\" text,\n \"total_matches\" real,\n \"cardiff_win\" real,\n \"draw\" real,\n \"swansea_win\" real\n);\n\nQuestion: How many average total matches have a swansea win less than 3, fa cup as the competition, with a draw less than 0?" }, { "role": "assistant", "content": "SELECT AVG(\"total_matches\") FROM \"most_derby_appearances\" WHERE \"swansea_win\"<3 AND \"competition\"='fa cup' AND \"draw\"<0;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"most_derby_appearances\" (\n \"competition\" text,\n \"total_matches\" real,\n \"cardiff_win\" real,\n \"draw\" real,\n \"swansea_win\" real\n);\n\nQuestion: How many cardiff wins have a draw greater than 27?" }, { "role": "assistant", "content": "SELECT COUNT(\"cardiff_win\") FROM \"most_derby_appearances\" WHERE \"draw\">27;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"most_derby_appearances\" (\n \"competition\" text,\n \"total_matches\" real,\n \"cardiff_win\" real,\n \"draw\" real,\n \"swansea_win\" real\n);\n\nQuestion: How many average total matches have league cup as the competition, with a draw greater than 0?" }, { "role": "assistant", "content": "SELECT AVG(\"total_matches\") FROM \"most_derby_appearances\" WHERE \"competition\"='league cup' AND \"draw\">0;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: What is the number of tries for when the try bonus is 0?" }, { "role": "assistant", "content": "SELECT \"tries_for\" FROM \"league_table\" WHERE \"try_bonus\"='0';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many points is there when the lost is 6 and the try bonus is 9?" }, { "role": "assistant", "content": "SELECT \"points_for\" FROM \"league_table\" WHERE \"lost\"='6' AND \"try_bonus\"='9';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many pints does the Cambrian Welfare RFC have?" }, { "role": "assistant", "content": "SELECT \"points_for\" FROM \"league_table\" WHERE \"club\"='cambrian welfare rfc';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: When the try bonus is 9 and the lost 4, what is the drawn?" }, { "role": "assistant", "content": "SELECT \"drawn\" FROM \"league_table\" WHERE \"try_bonus\"='9' AND \"lost\"='4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: Club Clwb Rygbi Cymru Caerdydd RFC has how many points?" }, { "role": "assistant", "content": "SELECT \"points\" FROM \"league_table\" WHERE \"club\"='clwb rygbi cymru caerdydd rfc';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_population_density\" (\n \"rank\" real,\n \"province\" text,\n \"population\" real,\n \"area\" real,\n \"density\" real\n);\n\nQuestion: What is the highest Rank with a density less than 376.37, the province was valverde, and an Area larger than 823?" }, { "role": "assistant", "content": "SELECT MAX(\"rank\") FROM \"by_population_density\" WHERE \"density\"<376.37 AND \"province\"='valverde' AND \"area\">823;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_population_density\" (\n \"rank\" real,\n \"province\" text,\n \"population\" real,\n \"area\" real,\n \"density\" real\n);\n\nQuestion: What is the average Density when the area is more than 1,185.8 with a population of 63,029?" }, { "role": "assistant", "content": "SELECT AVG(\"density\") FROM \"by_population_density\" WHERE \"area\">'1,185.8' AND \"population\"='63,029';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_population_density\" (\n \"rank\" real,\n \"province\" text,\n \"population\" real,\n \"area\" real,\n \"density\" real\n);\n\nQuestion: What is the highest Density for the independencia province, with an area smaller than 2,007.4?" }, { "role": "assistant", "content": "SELECT MAX(\"density\") FROM \"by_population_density\" WHERE \"province\"='independencia' AND \"area\"<'2,007.4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eighthfinals\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: Which 2nd leg has pamesa valencia for team #2?" }, { "role": "assistant", "content": "SELECT \"2nd_leg\" FROM \"eighthfinals\" WHERE \"team_num2\"='pamesa valencia';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eighthfinals\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What is the team #1 that has unics kazan for team #2?" }, { "role": "assistant", "content": "SELECT \"team_num1\" FROM \"eighthfinals\" WHERE \"team_num2\"='unics kazan';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eighthfinals\" (\n \"team_num1\" text,\n \"agg\" text,\n \"team_num2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What is the 1st leg that has akasvayu girona as team #2?" }, { "role": "assistant", "content": "SELECT \"1st_leg\" FROM \"eighthfinals\" WHERE \"team_num2\"='akasvayu girona';" } ]
[ { "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: Which Wins has a Tournament of totals, and a Cuts made larger than 42?" }, { "role": "assistant", "content": "SELECT AVG(\"wins\") FROM \"summary\" WHERE \"tournament\"='totals' AND \"cuts_made\">42;" } ]
[ { "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: Which Top-10 has a Cuts made larger than 42?" }, { "role": "assistant", "content": "SELECT MIN(\"top_10\") FROM \"summary\" WHERE \"cuts_made\">42;" } ]
[ { "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: Which Wins has a Top-5 of 6?" }, { "role": "assistant", "content": "SELECT AVG(\"wins\") FROM \"summary\" WHERE \"top_5\"=6;" } ]
[ { "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: Which Cuts made has a Top-25 smaller than 3?" }, { "role": "assistant", "content": "SELECT MAX(\"cuts_made\") FROM \"summary\" WHERE \"top_25\"<3;" } ]
[ { "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: Which Top-10 has a Cuts made of 10, and a Top-5 larger than 1?" }, { "role": "assistant", "content": "SELECT MIN(\"top_10\") FROM \"summary\" WHERE \"cuts_made\"=10 AND \"top_5\">1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rankings\" (\n \"name\" text,\n \"rank\" real,\n \"out_of\" text,\n \"source\" text,\n \"year\" real\n);\n\nQuestion: Concerning protestantism by country, the ranking is out of how many total?" }, { "role": "assistant", "content": "SELECT \"out_of\" FROM \"rankings\" WHERE \"source\"='protestantism by country';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rankings\" (\n \"name\" text,\n \"rank\" real,\n \"out_of\" text,\n \"source\" text,\n \"year\" real\n);\n\nQuestion: What is the lowest rank that the protestants population holds?" }, { "role": "assistant", "content": "SELECT MIN(\"rank\") FROM \"rankings\" WHERE \"name\"='protestants population';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"albums\" (\n \"album_title\" text,\n \"format\" text,\n \"year\" real,\n \"original_label\" text,\n \"chart_positions\" text\n);\n\nQuestion: The album titled I had what chart positions?" }, { "role": "assistant", "content": "SELECT \"chart_positions\" FROM \"albums\" WHERE \"album_title\"='i';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"albums\" (\n \"album_title\" text,\n \"format\" text,\n \"year\" real,\n \"original_label\" text,\n \"chart_positions\" text\n);\n\nQuestion: What is the title of the album that has Popup has the original label?" }, { "role": "assistant", "content": "SELECT \"album_title\" FROM \"albums\" WHERE \"original_label\"='popup';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"albums\" (\n \"album_title\" text,\n \"format\" text,\n \"year\" real,\n \"original_label\" text,\n \"chart_positions\" text\n);\n\nQuestion: What is the format of the album with a year less than 1992?" }, { "role": "assistant", "content": "SELECT \"format\" FROM \"albums\" WHERE \"year\"<1992;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"albums\" (\n \"album_title\" text,\n \"format\" text,\n \"year\" real,\n \"original_label\" text,\n \"chart_positions\" text\n);\n\nQuestion: What chart positions did the album reach when ep was the format?" }, { "role": "assistant", "content": "SELECT \"chart_positions\" FROM \"albums\" WHERE \"format\"='ep';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"team_players_drafted_in_the_nba\" (\n \"year\" real,\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"nba_team\" text\n);\n\nQuestion: What was the average pick with Ed O'Bannon and a round smaller than 1?" }, { "role": "assistant", "content": "SELECT AVG(\"pick\") FROM \"team_players_drafted_in_the_nba\" WHERE \"player\"='ed o''bannon' AND \"round\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"team_players_drafted_in_the_nba\" (\n \"year\" real,\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"nba_team\" text\n);\n\nQuestion: What player was drafted for the Detroit Pistons?" }, { "role": "assistant", "content": "SELECT \"player\" FROM \"team_players_drafted_in_the_nba\" WHERE \"nba_team\"='detroit pistons';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"preliminary_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: Which Team 2 had a Team 1 of montreal impact?" }, { "role": "assistant", "content": "SELECT \"team_2\" FROM \"preliminary_round\" WHERE \"team_1\"='montreal impact';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"preliminary_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: Which Team 2 had a Team 1of joe public?" }, { "role": "assistant", "content": "SELECT \"team_2\" FROM \"preliminary_round\" WHERE \"team_1\"='joe public';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"preliminary_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: Which team 1 had a Team 2 of hankook verdes?" }, { "role": "assistant", "content": "SELECT \"team_1\" FROM \"preliminary_round\" WHERE \"team_2\"='hankook verdes';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"preliminary_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What is the first leg score when team 2 is Wagad Mogadishu?" }, { "role": "assistant", "content": "SELECT \"1st_leg\" FROM \"preliminary_round\" WHERE \"team_2\"='wagad mogadishu';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"preliminary_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What is the first leg score when the second leg score is 0-4?" }, { "role": "assistant", "content": "SELECT \"1st_leg\" FROM \"preliminary_round\" WHERE \"2nd_leg\"='0-4';" } ]