Chinastark/bird_dataset huggingface dataset:
Database: soccer_2016
Note: play by the left hand refers to batting_hand =   'Left-hand bat';
Question: List the names of players who play by the left hand.
SQL: SELECT player.player_name FROM player INNER JOIN batting_style ON player.batting_hand = batting_style.batting_id WHERE batting_style.batting_hand = 'Left-hand bat'
Database: soccer_2016
Note: are Indians refers to country_name = 'India';
Question: How many players are Indians?
SQL: SELECT count(player.player_id) FROM player INNER JOIN country ON player.country_name = country.country_id WHERE country.country_name = 'India'
Database: soccer_2016
Note: England players refers to country_name = 'England';
Question: List the name of England players.
SQL: SELECT player.player_name FROM player INNER JOIN country ON player.country_name = country.country_id WHERE country.country_name = 'England'
Database: soccer_2016
Note: Bandladore refers to city_name = 'Bangalore';
Question: What is the venue name of Bandladore?
SQL: SELECT venue.venue_name FROM venue INNER JOIN city ON venue.city_id = city.city_id WHERE city.city_name = 'Bangalore'
Database: soccer_2016
Note: season year 2008 refers to season_year = 2008;
Question: What are the names of players who participated in season year 2008?
SQL: SELECT player.player_name FROM player INNER JOIN MATCH ON player.player_id = MATCH.man_of_the_match INNER JOIN player_match ON player_match.player_id = player.player_id INNER JOIN season ON MATCH.season_id = season.season_id WHERE season.season_year = 2008 GROUP BY player.player_name
Database: soccer_2016
Note: scored less than 3 refers to runs_scored < 3; name of player refers to player_name;
Question: What are the names of players that have run scored less than 3?
SQL: SELECT player.player_name FROM player INNER JOIN player_match ON player.player_id = player_match.player_id INNER JOIN batsman_scored ON player_match.match_id = batsman_scored.match_id WHERE batsman_scored.runs_scored < 3 GROUP BY player.player_name
Database: soccer_2016
Note: SC Ganguly refers to player_name = 'SC Ganguly'; role refers to role_desc;
Question: What is the role of SC Ganguly?
SQL: SELECT rolee.role_desc FROM player INNER JOIN player_match ON player.player_id = player_match.player_id INNER JOIN rolee ON player_match.role_id = rolee.role_id WHERE player.player_name = 'SC Ganguly' GROUP BY rolee.role_desc
Database: soccer_2016
Note: played as a keeper refers to role_desc = 'Keeper'; name of player refers to player_name;
Question: List the names of players who played as a keeper.
SQL: SELECT player.player_name FROM player INNER JOIN player_match ON player.player_id = player_match.player_id INNER JOIN rolee ON player_match.role_id = rolee.role_id WHERE rolee.role_desc = 'Keeper' GROUP BY player.player_name
Database: soccer_2016
Note: in team 1 refers to team_id = 1; name of player refers to player_name;
Question: What are the names of players in team 1?
SQL: SELECT player.player_name FROM player INNER JOIN player_match ON player.player_id = player_match.player_id INNER JOIN team ON player_match.team_id = team.team_id WHERE team.team_id = 1 GROUP BY player.player_name
Database: soccer_2016
Note: played as a captain refers to role_desc = 'Captain'; in season year 2008 refers match_date like '2008%';
Question: How many players played as a captain in season year 2008?
SQL: SELECT count(player_match.player_id) FROM player_match INNER JOIN MATCH ON player_match.match_id = MATCH.match_id INNER JOIN rolee ON player_match.role_id = rolee.role_id WHERE rolee.role_desc = 'Captain' AND MATCH.match_date LIKE '2008%'
Database: soccer_2016
Note: SC Ganguly refers to player_name = 'SC Ganguly'; in season year 2008 refers to season_year = 2008;
Question: Which teams did SC Ganguly join in season year 2008?
SQL: SELECT team.team_name FROM player INNER JOIN MATCH ON player.player_id = MATCH.man_of_the_match INNER JOIN player_match ON player_match.player_id = player.player_id INNER JOIN season ON MATCH.season_id = season.season_id INNER JOIN team ON player_match.team_id = team.team_id WHERE season.season_year = 2008 AND player.player_name = 'SC Ganguly' GROUP BY team.team_name
Database: soccer_2016
Note: type of match won refers to win_type;
Question: What type did match ID 336000 win?
SQL: SELECT win_by.win_type FROM MATCH INNER JOIN win_by ON MATCH.win_type = win_by.win_id WHERE MATCH.match_id = 336000
Database: soccer_2016
Note: SB Joshi refers to player_name = 'SB Joshi'; where the player come from refers to country_name;
Question: Where did SB Joshi come from?
SQL: SELECT country.country_name FROM player INNER JOIN country ON player.country_name = country.country_id WHERE player.player_name = 'SB Joshi'
Database: soccer_2016
Note: have left arm fast in bowling skill refers to bowling_skill = 'Left-arm fast';
Question: How many players have left arm fast in bowling skill?
SQL: SELECT count(player.player_id) FROM player INNER JOIN bowling_style ON player.bowling_skill = bowling_style.bowling_id WHERE bowling_style.bowling_skill = 'Left-arm fast'
Database: soccer_2016
Question: What is the outcome type of match ID 392195?
SQL: SELECT outcome.outcome_type FROM MATCH INNER JOIN outcome ON MATCH.outcome_type = outcome.outcome_id WHERE MATCH.match_id = '392195'
Database: soccer_2016
Note: youngest player refers to MIN(dob); city refers to city_name;
Question: Who is the youngest player and which city did he/she come from?
SQL: SELECT city.city_name FROM player INNER JOIN country ON player.country_name = country.country_id INNER JOIN city ON country.country_id = city.country_id ORDER BY player.dob LIMIT 1
Database: soccer_2016
Note: in season year 2008 refers to season_year = 2008; team Kings XI Punjab refers to team_name = 'Kings XI Punjab';
Question: How many matches did team Kings XI Punjab win in season year 2008?
SQL: SELECT count(DISTINCT MATCH.match_id) FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner INNER JOIN player_match ON team.team_id = player_match.team_id INNER JOIN season ON MATCH.season_id = season.season_id WHERE team.team_name = 'Kings XI Punjab' AND season.season_year = 2008
Database: soccer_2016
Note: Pune Warriors refers to team_name = 'Pune Warriors';
Question: How many seasons did Pune Warriors participate in?
SQL: SELECT count(t.season_year) FROM ( SELECT season.season_year FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner INNER JOIN player_match ON team.team_id = player_match.team_id INNER JOIN season ON MATCH.season_id = season.season_id WHERE team.team_name = 'Pune Warriors' GROUP BY season.season_year ) t
Database: soccer_2016
Note: R Dravid refers to player_name = 'R Dravid'; year born refers to dob; role refers to role_desc;
Question: What year was R Dravid born and the role he played?
SQL: SELECT player.dob, rolee.role_desc FROM player INNER JOIN player_match ON player.player_id = player_match.player_id INNER JOIN rolee ON player_match.role_id = rolee.role_id WHERE player.player_name = 'R Dravid' GROUP BY player.dob, rolee.role_desc
Database: soccer_2016
Note: SC Ganguly refers to player_name = 'SC Ganguly';
Question: How many times did SC Ganguly be the man of the match?
SQL: SELECT count(MATCH.man_of_the_match) FROM player INNER JOIN MATCH ON player.player_id = MATCH.man_of_the_match INNER JOIN player_match ON player_match.player_id = player.player_id WHERE player.player_name = 'SC Ganguly'
Database: soccer_2016
Note: team Mumbai Indians refers to team_name = 'Mumbai Indians'; in 2008 refers to match_date like '2008%';
Question: How many matches did team Mumbai Indians win in 2008?
SQL: SELECT count(t.match_id) FROM ( SELECT MATCH.match_id FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner INNER JOIN player_match ON team.team_id = player_match.team_id WHERE team.team_name = 'Mumbai Indians' AND MATCH.match_date LIKE '2008%' GROUP BY MATCH.match_id ) t
Database: soccer_2016
Note: team refers to team_name;
Question: Which team won by wickets in match ID 335993?
SQL: SELECT team.team_name FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner INNER JOIN player_match ON team.team_id = player_match.team_id INNER JOIN win_by ON MATCH.win_type = win_by.win_id WHERE MATCH.match_id = '335993' GROUP BY team.team_name
Database: soccer_2016
Note: won by wickets refers to win_type = 'wickets';
Question: Count the matches that were won by wickets in all season.
SQL: SELECT count(MATCH.match_id) FROM MATCH INNER JOIN win_by ON MATCH.win_type = win_by.win_id WHERE win_by.win_type = 'wickets'
Database: soccer_2016
Note: W Jaffer refers to player_name = 'W Jaffer'; in season year 2012 refers to season_year = 2012; role refers to role_desc;
Question: What is the role of W Jaffer in season year 2012?
SQL: SELECT rolee.role_desc FROM player INNER JOIN player_match ON player.player_id = player_match.player_id INNER JOIN MATCH ON player_match.match_id = MATCH.match_id INNER JOIN rolee ON player_match.role_id = rolee.role_id INNER JOIN season ON MATCH.season_id = season.season_id WHERE player.player_name = 'W Jaffer' AND season.season_year = 2012
Database: soccer_2016
Note: man of the match more than 5 times refers to COUNT(man_of_the_match) > 5; in season year 2008 refers to season_year = 2008; name of player refers to player_name;
Question: What are the names of players who had been man of the match more than 5 times in season year 2008?
SQL: SELECT CASE WHEN count(MATCH.man_of_the_match) > 5 THEN player.player_name ELSE 0 END FROM player INNER JOIN MATCH ON player.player_id = MATCH.man_of_the_match INNER JOIN player_match ON player_match.player_id = player.player_id INNER JOIN season ON MATCH.season_id = season.season_id WHERE season.season_year = 2008
Database: soccer_2016
Note: Indian players refers to country_name = 'India'; born between 1975 and 1985 refers to strftime('%Y',T1.dob) between '1975' and '1985'; average refers to DIVIDE(COUNT(country_name = 'India'), COUNT(player_id));
Question: What is the average of Indian players that were born between 1975 and 1985 among all players?
SQL: SELECT cast(sum(CASE WHEN country.country_name = 'India' THEN 1 ELSE 0 END) AS REAL) / count(player.player_id) FROM player INNER JOIN country ON player.country_name = country.country_id WHERE strftime('%Y', player.dob) BETWEEN '1975' AND '1985'
Database: soccer_2016
Note: left hand batting style players refers to batting_hand = 'Left-hand bat'; percentage refers to DIVIDE(COUNT(batting_hand = 'Left-hand bat'), COUNT(player_id)) * 100.0;
Question: Calculate the percentage of left hand batting style players among all players.
SQL: SELECT cast(sum(CASE WHEN batting_style.batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / count(player.player_id) FROM player INNER JOIN batting_style ON player.batting_hand = batting_style.batting_id
Database: soccer_2016
Note: won by runs refers to win_type = 1; percentage refers to DIVIDE(COUNT(win_type = 1), COUNT(win_type)) * 100;
Question: What is the percentage of matches that are won by runs?
SQL: SELECT cast(sum(CASE WHEN MATCH.win_type = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / count(MATCH.win_type) FROM MATCH INNER JOIN win_by ON MATCH.win_type = win_by.win_id
Database: soccer_2016
Note: have 7 points of winning margin refers to win_margin = 7;
Question: How many matches have 7 points of winning margin?
SQL: SELECT count(match_id) FROM MATCH WHERE win_margin = 7
Database: soccer_2016
Note: born between 1970 to 1975 refers to strftime('%Y',dob) between '1970' and '1975';
Question: What is the total number of players born between 1970 to 1975?
SQL: SELECT count(player_id) FROM player WHERE strftime('%Y', dob) BETWEEN '1970' AND '1975'
Database: soccer_2016
Note: winning margin of 6 points refers to win_margin = 6; held on April 26, 2009 refers to match_date = '2009-04-26';
Question: Who is the winning team in a match held on April 26, 2009 with a winning margin of 6 points?
SQL: SELECT team.team_name FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner WHERE MATCH.win_margin = 6 AND MATCH.match_date = '2009-04-26'
Database: soccer_2016
Note: who refers to team_name;
Question: In the match ID 419135, who won by runs?
SQL: SELECT team.team_name FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner INNER JOIN win_by ON MATCH.win_type = win_by.win_id WHERE MATCH.match_id = 419135
Database: soccer_2016
Note: held in St. George's Park refers to venue_name = 'St George''s Park'; highest winning margin points refers to MAX(win_margin);
Question: Among the matches held in St. George's Park, give the match ID of the match with the highest winning margin points.
SQL: SELECT MATCH.match_id FROM venue INNER JOIN MATCH ON venue.venue_id = MATCH.venue_id WHERE venue.venue_name = 'St George''s Park' ORDER BY MATCH.win_margin DESC LIMIT 1
Database: soccer_2016
Note: from Sri Lanka refers to country_name = 'Sri Lanka';
Question: How many of the players are from Sri Lanka?
SQL: SELECT count(*) FROM player INNER JOIN country ON player.country_name = country.country_id WHERE country.country_name = 'Sri Lanka'
Database: soccer_2016
Note: played as a captain refers to role_desc = 'captain'; player refers to player_name;
Question: List the player's name who played as a captain.
SQL: SELECT player.player_name FROM player_match INNER JOIN player ON player_match.player_id = player.player_id INNER JOIN rolee ON player_match.role_id = rolee.role_id WHERE rolee.role_desc = 'Captain' GROUP BY player.player_name
Database: soccer_2016
Note: venue refers to venue_name; winning team refers to match_winner;
Question: Give the match's venue and winning team for the match ID 392194.
SQL: SELECT venue.venue_name, team.team_name FROM venue INNER JOIN MATCH ON venue.venue_id = MATCH.venue_id INNER JOIN team ON MATCH.match_winner = team.team_id WHERE MATCH.match_id = 392194
Database: soccer_2016
Note: Delhi Daredevils refers to team_name = 'Delhi Daredevils'; in 2009 refers to match_date = '2009%'; won by wickets refers to win_type = 'wickets'; percentage refers to DIVIDE(COUNT(win_type = 'wickets'), COUNT(win_type));
Question: Among the matches of Delhi Daredevils in 2009, what is the percentage of their matches won by wickets?
SQL: SELECT cast(sum(CASE WHEN win_by.win_type = 'wickets' THEN 1 ELSE 0 END) AS REAL) * 100 / count(win_by.win_type) FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner INNER JOIN win_by ON MATCH.win_type = win_by.win_id WHERE team.team_name = 'Delhi Daredevils'
Database: music_tracker
Note: release title refers to groupname; Ron Hunt is an artist; groupyear = 1979; releasetype = 'single'; downloaded 239 times refer to totalsnatched = 239;
Question: What is the release title of the single that was released by Ron Hunt in 1979 that was downloaded 239 times?
SQL: SELECT groupname FROM torrents WHERE artist LIKE 'ron hunt & ronnie g & the sm crew' AND groupyear = 1979 AND releasetype LIKE 'single' AND totalsnatched = 239
Database: music_tracker
Note: blowfly is an artist; groupyear = 1980; album refers to releasetype; downloaded refers to totalsnatched;
Question: How many times was the album released by blowfly in 1980 downloaded?
SQL: SELECT totalsnatched FROM torrents WHERE artist LIKE 'blowfly' AND groupyear = 1980
Database: music_tracker
Note: album refers to releasetype; the highest amount of downloads refers to MAX(totalsnatched);
Question: What is the tag of the album with the highest amount of downloads?
SQL: SELECT tags.tag FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.releasetype = 'album' ORDER BY torrents.totalsnatched DESC LIMIT 1
Database: music_tracker
Note: the highest amount of downloads refers to MAX(totalsnatched);
Question: What are the top 5 tags with the highest amount of downloads?
SQL: SELECT tags.tag FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.releasetype = 'album' ORDER BY torrents.totalsnatched DESC LIMIT 5
Database: music_tracker
Note: release title of single refers to groupname where releasetype = 'single'; the oldest means coming before all others in time and refers to MIN(groupyear);
Question: What is the release title of the single under the "funk" tag that was released the oldest?
SQL: SELECT torrents.groupname FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag LIKE 'funk' AND torrents.releasetype = 'single' ORDER BY torrents.groupyear LIMIT 1
Database: music_tracker
Note: release titles of the "ep's" refer to groupname where releasetype = 'ep';
Question: Name all the release titles of the "ep's" under the alternative tag.
SQL: SELECT torrents.groupname FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag LIKE 'alternative' AND torrents.releasetype = 'ep'
Database: music_tracker
Note: least downloaded album refers to MIN(totalsnatched where releasetype = 'album');
Question: What are the tags of the top 5 least downloaded live albums?
SQL: SELECT tags.tag FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.releasetype = 'album' ORDER BY torrents.totalsnatched LIMIT 5
Database: music_tracker
Note: the most downloaded single refers to MAX(totalsnatched where releasetype = 'single');
Question: What is the tag and the artist of the most downloaded single?
SQL: SELECT tags.tag, torrents.artist FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.releasetype = 'single' ORDER BY torrents.totalsnatched DESC LIMIT 1
Database: music_tracker
Note: tag = '1980s';
Question: How many releases are tagged "1980s"?
SQL: SELECT count(id) FROM tags WHERE tag LIKE '1980s'
Database: music_tracker
Note: groupname = 'city funk'; downloaded refers to totalsnatched;
Question: How many times has the release "city funk" been downloaded?
SQL: SELECT totalsnatched FROM torrents WHERE groupname LIKE 'city funk'
Database: music_tracker
Note: releases refer to groupname; downloaded for more than 20000 times refers to totalsnatched > 20000;
Question: Please list the releases that have been downloaded for more than 20000 times.
SQL: SELECT groupname FROM torrents WHERE totalsnatched > 20000
Database: music_tracker
Note: release "sugarhill gang" refers to groupname = 'sugarhill gang';
Question: What are the tags of the release "sugarhill gang"?
SQL: SELECT tags.tag FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.groupname = 'sugarhill gang'
Database: music_tracker
Note: release "city funk" refers to groupname = 'city funk';
Question: How many tags does the release "city funk" have？
SQL: SELECT count(tags.tag) FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.groupname = 'city funk'
Database: music_tracker
Note: titles refer to groupname;
Question: Please list the titles of all the releases with the tag "1980s".
SQL: SELECT torrents.groupname FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag = '1980s'
Database: music_tracker
Note: title refers to groupname; the most downloaded refers to MAX(totalsnatched);
Question: Among the releases with the tag "1980s", which one of them is the most downloaded? Please give its title.
SQL: SELECT torrents.groupname FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag = '1980s' ORDER BY torrents.totalsnatched DESC LIMIT 1
Database: music_tracker
Note: tag = 'pop';
Question: How many releases by the artist michael jackson are tagged "pop"?
SQL: SELECT count(torrents.groupname) FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag = 'pop' AND torrents.artist = 'michael jackson'
Database: music_tracker
Note: groupyear = 2000; album refers to releasetype;
Question: Among the releases that were released in 2000, how many of them were released as an album and tagged "pop"?
SQL: SELECT count(torrents.groupname) FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag = 'pop' AND torrents.releasetype = 'album' AND torrents.groupyear = 2000
Database: music_tracker
Note: AVG(totalsnatched where tag = '1980s');
Question: What are the average download times for the a release tagged "1980s"?
SQL: SELECT cast(sum(torrents.totalsnatched) AS REAL) / count(tags.tag) FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag = '1980s'
Database: music_tracker
Note: title refers to groupname; the highest number of downloads refers to MAX(totalsnatched);
Question: Name the title of the top three releases with the highest number of downloads.
SQL: SELECT groupname FROM torrents ORDER BY totalsnatched DESC LIMIT 3
Database: music_tracker
Note: title refers to groupname; the highest number of downloads refers to MAX(totalsnatched where groupyear = 2012 and releasetype = 'single');
Question: Provide the name of the artist who released his or her Single-Table in 2012 with the highest number of downloads. Name the Single-Table title as well.
SQL: SELECT artist, groupname FROM torrents WHERE groupyear = 2012 AND releasetype LIKE 'Single' ORDER BY totalsnatched DESC LIMIT 1
Database: music_tracker
Note: albums refer to releasetype = 'album'; releasetype = 'single'; between 2010 and 2015 refers to groupyear between 2010 and 2015;
Question: How many albums and Single-Tables were released by the artist named '50 cent' between 2010 and 2015?
SQL: SELECT count(id), ( SELECT count(id) FROM torrents WHERE groupyear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releasetype LIKE 'album' ) FROM torrents WHERE groupyear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releasetype LIKE 'Single'
Database: music_tracker
Note: 2Pac is an artist; album refers to releasetype; groupyear = 1991; SUBTRACT(groupyear = 1991, groupyear where releasetype = 'album' LIMIT 1 OFFSET 1);
Question: An American rapper '2Pac' released his first solo album in 1991, how many years have passed until his next album was released?
SQL: SELECT ( SELECT groupyear FROM torrents WHERE artist LIKE '2Pac' AND releasetype LIKE 'album' ORDER BY groupyear LIMIT 1, 1 ) - groupyear FROM torrents WHERE artist LIKE '2Pac' AND releasetype LIKE 'album' AND groupyear = 1991
Database: music_tracker
Note: 2Pac is an artist; releasetype = 'single'; between 2001 and 2013 refers to groupyear between 2001 and 2013; average number of downloads = AVG(totalsnatched);
Question: Find the average number of downloads for Single-Tables released by '2Pac' between 2001 and 2013.
SQL: SELECT avg(totalsnatched) FROM torrents WHERE artist LIKE '2Pac' AND releasetype LIKE 'Single' AND groupyear BETWEEN 2001 AND 2013
Database: music_tracker
Note: release year refers to groupyear; title of live album refers to groupname where releasetype = 'live album'; the highest number of downloads refers to MAX(totalsnatched);
Question: Provide the title, release year and the tag associated with the live album that has the highest number of downloads?
SQL: SELECT torrents.groupname, torrents.groupyear, tags.tag FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE torrents.releasetype = 'live album' ORDER BY torrents.totalsnatched DESC LIMIT 1
Database: music_tracker
Note: at least two bootlegs refer to COUNT(releasetype = 'bootleg')≥ 2; groupyear = 2016;
Question: Provide the name of artists who released at least two bootlegs in 2016.
SQL: SELECT artist FROM torrents WHERE groupyear = 2016 AND releasetype LIKE 'bootleg' GROUP BY artist HAVING count(releasetype) > 2
Database: music_tracker
Note: releasetype = 'single'; between 1980 to 1982 refers to groupyear between 1980 and 1982;
Question: Which artist released singles between 1980 to 1982?
SQL: SELECT artist FROM torrents WHERE groupyear BETWEEN 1980 AND 1982 AND releasetype LIKE 'single'
Database: music_tracker
Note: releasetype = 'single'; downloaded at least 20 refers to totalsnatched ≥ 20; id from 10 to 20 refer to id between 10 and 20; groups refer to groupname;
Question: Indicates groups with id from 10 to 20 with singles downloaded at least 20.
SQL: SELECT groupname FROM torrents WHERE totalsnatched >= 20 AND releasetype LIKE 'single' AND id BETWEEN 10 AND 20
Database: music_tracker
Note: from 1980 to 1982 refers to groupyear between 1980 and 1982; tag = 'disco';
Question: Among the artists from 1980 to 1982. Which artist was tagged as "disco"?
SQL: SELECT torrents.artist FROM torrents INNER JOIN tags ON torrents.id = tags.id WHERE tags.tag = 'disco' AND torrents.groupyear BETWEEN 1980 AND 1982