Chinastark/bird_dataset huggingface dataset:
Database: soccer_2016
Question: List down the DOB of players who received the "man of the match" award.
SQL: SELECT player.dob FROM MATCH INNER JOIN player ON player.player_id = MATCH.man_of_the_match
Database: soccer_2016
Note: name of teams refers to team_name; won the toss refers to toss_winner; matches with ID from 336010 to 336020  refers to match_id BETWEEN 336010 AND 336020;
Question: List down the name of teams that won the toss of the coin from matches with ID from 336010 to 336020.
SQL: SELECT team.team_name FROM MATCH INNER JOIN team ON team.team_id = MATCH.toss_winner WHERE MATCH.match_id BETWEEN 336010 AND 336020
Database: soccer_2016
Note: Mumbai Indians refers to team_name = 'Mumbai Indians'; won refers to match_winner;
Question: How many matches have Mumbai Indians won?
SQL: SELECT sum(CASE WHEN team.team_name = 'Mumbai Indians' THEN 1 ELSE 0 END) FROM MATCH INNER JOIN team ON team.team_id = MATCH.match_winner
Database: soccer_2016
Note: names of teams refers to team_name; second team refers to team_2; Pune Warriors refers to team_name = 'Pune Warriors';
Question: List down names of teams that have played as second team against Pune Warriors.
SQL: SELECT team.team_name FROM MATCH INNER JOIN team ON team.team_id = MATCH.team_2 WHERE MATCH.team_1 = ( SELECT team_id FROM team WHERE team_name = 'Pune Warriors' ) GROUP BY team.team_name
Database: soccer_2016
Note: name of the team refers to team_name; won refers to match_winner;
Question: What is the name of the team that won match ID 336000?
SQL: SELECT team.team_name FROM MATCH INNER JOIN team ON team.team_id = MATCH.match_winner WHERE MATCH.match_id = 336000
Database: soccer_2016
Note: at Brabourne Stadium refers to venue_name = 'Brabourne Stadium';
Question: What are the match IDs that were played at Brabourne Stadium?
SQL: SELECT MATCH.match_id FROM MATCH INNER JOIN venue ON venue.venue_id = MATCH.venue_id WHERE venue.venue_name = 'Brabourne Stadium'
Database: soccer_2016
Note: name of venues refers to venue_name; season 2 refers to season_id = 2;
Question: List down the name of venues in season 2.
SQL: SELECT venue.venue_name FROM MATCH INNER JOIN venue ON venue.venue_id = MATCH.venue_id WHERE MATCH.season_id = 2 GROUP BY venue.venue_name
Database: soccer_2016
Note: city refers to city_name; M Chinnaswamy Stadium refers to venue_name = 'M Chinnaswamy Stadium';
Question: What is the city of M Chinnaswamy Stadium?
SQL: SELECT city.city_name FROM city INNER JOIN venue ON venue.city_id = city.city_id WHERE venue.venue_name = 'M Chinnaswamy Stadium'
Database: soccer_2016
Note: venues refers to venue_name; Mumbai refers to city_name = 'Mumbai';
Question: List down all of the venues in Mumbai.
SQL: SELECT venue.venue_name FROM city INNER JOIN venue ON venue.city_id = city.city_id WHERE city.city_name = 'Mumbai'
Database: soccer_2016
Note: winning teams' refers to match_winner; played in St George's Park refers to venue_name like 'St George%';
Question: List down all of the winning teams' IDs that played in St George's Park.
SQL: SELECT MATCH.match_winner FROM venue INNER JOIN MATCH ON venue.venue_id = MATCH.venue_id WHERE venue.venue_name LIKE 'St George%'
Database: soccer_2016
Note: SuperSport Park refers to venue_name = 'SuperSport Park'; Centurion refers to city_name = 'Centurion';
Question: Is SuperSport Park located at Centurion?
SQL: SELECT city.city_name FROM venue INNER JOIN city ON venue.city_id = city.city_id WHERE venue.venue_name LIKE 'St George%'
Database: soccer_2016
Note: winning refers to match_winner; Deccan Chargers refers to team_name = 'Deccan Chargers';
Question: Calculate the total winning match for Deccan Chargers.
SQL: SELECT sum(MATCH.match_winner) FROM team INNER JOIN MATCH ON team.team_id = MATCH.match_winner WHERE team.team_name = 'Deccan Chargers'
Database: soccer_2016
Note: Pune city refers to city_name = 'Pune';
Question: Count the total venues located in Pune City.
SQL: SELECT sum(venue.venue_name) FROM venue INNER JOIN city ON venue.city_id = city.city_id WHERE city.city_name = 'Pune'
Database: soccer_2016
Note: most number of balls refers to max(ball_id); match 501219 refers to match_id = 501219; player id also refers to non_striker or ball_id;
Question: Give the player id of the player who was at the non-striker end for the most number of balls in the match 501219.
SQL: SELECT ball_id FROM ball_by_ball WHERE non_striker = ball_id ORDER BY ball_id DESC LIMIT 1
Database: soccer_2016
Note: first half refers to 1 < over_id and over_id < 25; average = divide(sum(over_id) when 1 < over_id and over_id < 25, sum(runs_scored)) as percentage; first innings refers to innings_no = 1;
Question: Calculate the average runs scored during the first half of all first innings.
SQL: SELECT cast(sum(CASE WHEN 1 < over_id AND over_id < 25 THEN 1 ELSE 0 END) AS REAL) * 100 / sum(runs_scored) FROM batsman_scored WHERE innings_no = 1
Database: soccer_2016
Note: second innings refers to innings_no = 2; average extra runs = divide(sum(extra_runs), count(innings_no)) when innings_no = 2;
Question: What are the average extra runs given in the second innings of every match?
SQL: SELECT avg(innings_no) FROM extra_runs WHERE innings_no = 2
Database: soccer_2016
Note: winning margin above 100 refers to win_margin > 100; percentage = divide(count(match_id) when win_margin > 100, count(match_id)) as percentage;
Question: Among the matches, what percentage have a winning margin above 100?
SQL: SELECT cast(count(CASE WHEN win_margin > 100 THEN 1 ELSE 0 END) AS REAL) * 100 / total(match_id) FROM `match`
Database: soccer_2016
Note: name of the players refers to player_name; born between 1970 and 1990 refers to dob between '1970-01-01' and '1990-12-31';
Question: List the name of the players born between 1970 and 1990 in descending order of age.
SQL: SELECT player_name FROM player WHERE dob BETWEEN '1970-01-01' AND '1990-12-31' ORDER BY dob DESC
Database: soccer_2016
Note: third overs refers to over_id = 3; without the involvement of fielders refers to fielders = '';
Question: Of the wickets taken in the third overs, how many are without the involvement of fielders?
SQL: SELECT sum(CASE WHEN fielders = '' THEN 1 ELSE 0 END) FROM wicket_taken WHERE over_id = 3
Database: soccer_2016
Note: which country refers to country_id; most umpires refers to max(count(umpire_id));
Question: From which country does the most umpires are from? How many of them are from the mentioned country? 
SQL: SELECT country.country_id, count(umpire.umpire_id) FROM umpire INNER JOIN country ON country.country_id = umpire.umpire_country GROUP BY country.country_id ORDER BY count(umpire.umpire_id) DESC LIMIT 1
Database: soccer_2016
Note: captain and keeper refers to role_desc = 'CaptainKeeper'; percentage = divide(count(player_id) when role_desc = 'CaptainKeeper', count(player_id)) as percentage;
Question: Among the players, what percentage are both captain and keeper?
SQL: SELECT cast(sum(CASE WHEN rolee.role_desc = 'CaptainKeeper' THEN 1 ELSE 0 END) AS REAL) * 100 / total(player_match.player_id) FROM player_match INNER JOIN rolee ON player_match.role_id = rolee.role_id
Database: soccer_2016
Note: out by hit wicket refers to out_name = 'hit wicket';
Question: In the players, how many were out by hit wicket?
SQL: SELECT player_out FROM wicket_taken INNER JOIN out_type ON wicket_taken.kind_out = out_type.out_id WHERE out_name = 'hit wicket'
Database: soccer_2016
Note: bat with their right hand refers to batting_hand = 'Right-hand bat'; average = divide(count(player_id) when batting_hand = 'Right-hand bat', count(country_name));
Question: On average, how many players from each country bat with their right hand?
SQL: SELECT cast(sum(CASE WHEN batting_style.batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / count(player.country_name) FROM batting_style INNER JOIN player ON batting_style.batting_id = player.batting_hand
Database: soccer_2016
Note: Legbreak skill refers to bowling_skill = 'Legbreak' ; percentage = divide(sum(player_id) when bowling_skill = 'Legbreak', count(player_id)) as percentage;
Question: What percentage of players have Legbreak skill?
SQL: SELECT cast(sum(CASE WHEN bowling_style.bowling_skill = ' Legbreak' THEN 1 ELSE 0 END) AS REAL) * 100 / total(player.player_id) FROM player INNER JOIN bowling_style ON player.bowling_skill = bowling_style.bowling_id
Database: soccer_2016
Note: winning margin is less than fifty refers to win_margin < 50; won by wicket refers to win_type = 'wickets';
Question: In the matches where the winning margin is less than fifty, how many teams won by wicket?
SQL: SELECT count(win_by.win_id) FROM `match` INNER JOIN win_by ON match.win_type = win_by.win_id WHERE win_by.win_type = 'wickets' AND match.win_margin < 50
Database: soccer_2016
Note: team 2 win the toss refers to toss_winner = team_2 ; lose the match refers to match_winner = team_1;
Question: In how many venues did team 2 win the toss and lose the match?
SQL: SELECT sum(CASE WHEN match.team_2 = match.match_winner THEN 1 ELSE 0 END) FROM `match` INNER JOIN venue ON match.venue_id = venue.venue_id WHERE match.team_1 = match.toss_winner
Database: soccer_2016
Note: year 2012 refers to season_year = 2012; name of player refers to player_name.; country of this player refers to country_name;
Question: Which player became the man of the series in the year 2012? Give the name and country of this player.
SQL: SELECT player.player_name, country.country_name FROM season INNER JOIN player ON season.man_of_the_series = player.player_id INNER JOIN country ON player.country_name = country.country_id WHERE season.season_year = 2012
Database: soccer_2016
Note: name of the venue refers to venue_name; most number of matches refers to max(count(venue_id));
Question: Give the name of the venue where the most number of matches are held.
SQL: SELECT venue.venue_name FROM `match` INNER JOIN venue ON match.venue_id = venue.venue_id GROUP BY venue.venue_name ORDER BY count(venue.venue_id) DESC LIMIT 1
Database: soccer_2016
Note: city refers to city_name; no-result matches refers to win_type = 'NoResult'; least number refers to min(count(win_type = 'NoResult'));
Question: Which city hosted the least number of no-result matches?
SQL: SELECT city.city_name FROM `match` INNER JOIN win_by ON match.win_type = win_by.win_id INNER JOIN venue ON match.venue_id = venue.venue_id INNER JOIN city ON venue.city_id = city.city_id WHERE win_by.win_type = 'NO Result' GROUP BY city.city_id ORDER BY count(win_by.win_type) ASC LIMIT 1
Database: soccer_2016
Note: name of the player refers to player_name; man of the series more than one time refers to count(man_of_the_series) > 1;
Question: Write the name of the player who was the man of the series more than one time.
SQL: SELECT player.player_name FROM season INNER JOIN player ON season.man_of_the_series = player.player_id WHERE season.man_of_the_series > 1
Database: soccer_2016
Note: name and country of the players refers to player_name and country_name; catches refers to out_name = 'caught'; average catches refers to divide(count(player_id) when out_name = 'caught', sum(player_id));
Question: List the name and country of the players who got more than average catches in ascending order of the number of catches.
SQL: SELECT player.player_name, country.country_name FROM player INNER JOIN wicket_taken ON player.player_id = wicket_taken.fielders INNER JOIN out_type ON wicket_taken.kind_out = out_type.out_id INNER JOIN country ON player.country_name = country.country_id GROUP BY player.player_name ORDER BY count(out_type.out_name) ASC
Database: soccer_2016
Note: won by runs refers to win_type = 'runs'; won the toss and decided to field refers to toss_winner and toss_name = 'field'; percentage = divide(count(team_1) when match_winner = team_1 and toss_winner = team_1, count(team_1)) as percentage;
Question: Of the matches that were won by runs by team 1, what percentage have team 1 won the toss and decided to field?
SQL: SELECT cast(count(CASE WHEN match.team_1 = match.match_winner = match.toss_winner THEN 1 ELSE 0 END) AS REAL) * 100 / total(match.team_1) FROM `match` INNER JOIN win_by ON match.win_type = win_by.win_id INNER JOIN toss_decision ON match.toss_decide = toss_decision.toss_id WHERE toss_decision.toss_name = 'field' AND win_by.win_type = 'runs'
Database: soccer_2016
Note: out by lbw refers to out_id = 4; runout refers to out_id = 3; average out by lbw refers to  avg(player_out when out_id = 4); average out by runout refers to  avg(player_out when out_id = 3);
Question: What is the difference in the average number of players out by lbw and runout in the matches?
SQL: SELECT avg(wicket_taken.player_out) FROM wicket_taken INNER JOIN out_type ON wicket_taken.kind_out = out_type.out_id WHERE out_type.out_name = 'lbw'
Database: soccer_2016
Note: Identify by their ID all the overs refers to over_id; player with ID 7 was on strike refers to striker = 7;
Question: Identify by their ID all the overs in which the player with ID 7 was on strike.
SQL: SELECT DISTINCT over_id FROM ball_by_ball WHERE striker = 7
Database: soccer_2016
Note: first teams refers to team_1; chose to bat after winning the toss refers to toss_winner and toss_decide = 2;
Question: How many first teams chose to bat after winning the toss?
SQL: SELECT count(team_1) FROM `match` WHERE team_1 = toss_winner AND toss_decide = 2
Database: soccer_2016
Note: were played in March 2010 refers to match_date = '2010-03%';
Question: How many games were played in March 2010?
SQL: SELECT sum(CASE WHEN match_date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `match`
Database: soccer_2016
Note: older than Gurkeerat Singh player refers to dob ! = 'Gurkeerat Singh' and dob < '1990-06-29';
Question: How many players are older than Gurkeerat Singh player?
SQL: SELECT sum(CASE WHEN dob < '1990-06-29' THEN 1 ELSE 0 END) FROM player WHERE player_name != 'Gurkeerat Singh'
Database: soccer_2016
Question: How many times has SR Watson been named 'Man of the Match'?
SQL: SELECT sum(CASE WHEN player.player_name = 'SR Watson' THEN 1 ELSE 0 END) FROM `match` INNER JOIN player ON match.man_of_the_match = player.player_id
Database: soccer_2016
Note: if a player has multiple roles in a match, it means this player is versatile; name refers to player_name; most versatile player refers to MAX(COUNT(role_id)); Delhi Daredevils refers to team_name = 'Delhi Daredevils';
Question: Indicate the name of the most versatile players of the Delhi Daredevils.
SQL: SELECT player.player_name FROM player_match INNER JOIN team ON player_match.team_id = team.team_id INNER JOIN player ON player_match.player_id = player.player_id WHERE team.team_name = 'Delhi Daredevils' GROUP BY player.player_name ORDER BY count(player_match.role_id) DESC LIMIT 1
Database: soccer_2016
Note: name of the player refers to player_name; most times for 'Man of the Series' refers to max(count(man_of_the_match));
Question: What is the name of the player who has been chosen the most times for 'Man of the Series'?
SQL: SELECT player.player_name FROM season INNER JOIN MATCH ON season.man_of_the_series = MATCH.man_of_the_match INNER JOIN player ON MATCH.man_of_the_match = player.player_id GROUP BY player.player_name ORDER BY count(season.man_of_the_series) DESC LIMIT 1
Database: soccer_2016
Note: year refers to season_year;
Question: In what year did SP Narine win the Orange Cap?
SQL: SELECT season.season_year, season.orange_cap 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 season ON MATCH.season_id = season.season_id WHERE player.player_name = 'SP Narine' GROUP BY season.season_year, season.orange_cap
Database: soccer_2016
Question: Which teams have had a player awarded the Purple Cap and another with the Orange Cap in the same season?
SQL: SELECT team.team_name, season.orange_cap, season.purple_cap FROM season INNER JOIN MATCH ON season.season_id = MATCH.season_id INNER JOIN player_match ON MATCH.match_id = player_match.match_id INNER JOIN player ON player_match.player_id = player.player_id INNER JOIN team ON player_match.team_id = team.team_id GROUP BY team.team_name, season.orange_cap, season.purple_cap
Database: soccer_2016
Note: Zimbabwean refers to country_name = 'Zimbabwea'; players refers to player_name;
Question: List all Zimbabwean players.
SQL: SELECT player.player_name FROM player INNER JOIN country ON player.country_name = country.country_id WHERE country.country_name = 'Zimbabwea'
Database: soccer_2016
Note: bat with their left hands refers to batting_hand = 'Left-hand bat';
Question: How many players bat with their left hands?
SQL: SELECT sum(CASE WHEN batting_style.batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM player INNER JOIN batting_style ON player.batting_hand = batting_style.batting_id
Database: soccer_2016
Note: not won by runs refers to win_type ! = 'runs';
Question: How many games were not won by runs?
SQL: SELECT sum(CASE WHEN win_by.win_type != 'runs' THEN 1 ELSE 0 END) FROM `match` INNER JOIN win_by ON match.win_type = win_by.win_id
Database: soccer_2016
Note: New Zealand umpires refers to country_name = 'New Zealand'; name of umpires refers to umpire_name;
Question: List the name of all New Zealand umpires.
SQL: SELECT umpire.umpire_name FROM umpire INNER JOIN country ON umpire.umpire_country = country.country_id WHERE country.country_name = 'New Zealand'
Database: soccer_2016
Note: 'slow left-arm chinaman' bowling style refers to bowling_skill = 'Slow left-arm chinaman'; most players  refers to max(count(country_id));
Question: In which country do most players have the 'slow left-arm chinaman' bowling style?
SQL: SELECT country.country_name FROM bowling_style INNER JOIN player ON bowling_style.bowling_id = player.bowling_skill INNER JOIN country ON player.country_name = country.country_id WHERE bowling_style.bowling_skill = 'Slow left-arm chinaman'
Database: soccer_2016
Note: Kochi Tuskers Kerala refers to team_name = 'Kochi Tuskers Kerala'; most of their matches refers to max(venue_id);
Question: In which venue did Kochi Tuskers Kerala play most of their matches?
SQL: SELECT venue.venue_name FROM venue INNER JOIN MATCH ON venue.venue_id = MATCH.venue_id INNER JOIN team ON MATCH.team_1 = team.team_id WHERE team.team_name = 'Kochi Tuskers Kerala' GROUP BY venue.venue_name
Database: soccer_2016
Note: batting team was the Delhi Daredevils refers to team_name = 'Delhi Daredevils' and team_1 = team_id where team_batting = 1 or team_2 = team_id where team_batting = 2; no runs scored refers to runs_scored = 0;
Question: In how many games in which the batting team was the Delhi Daredevils were no runs scored?
SQL: SELECT count(batsman_scored.runs_scored) FROM batsman_scored INNER JOIN ball_by_ball ON batsman_scored.match_id = ball_by_ball.match_id INNER JOIN MATCH ON ball_by_ball.match_id = MATCH.match_id INNER JOIN team ON MATCH.team_1 = team.team_id WHERE ball_by_ball.team_batting = 1 OR ball_by_ball.team_batting = 2 AND team.team_name = 'Delhi Daredevils'
Database: soccer_2016
Note: Dr DY Patil Sports Academy venue refers to venue_name = 'Dr DY Patil Sports Academy'; win by a margin of less than 10 refers to win_margin < 10; percentage = divide(count(venue_id) when win_margin < 10, sum(venue_id)) as percentage;
Question: In what percentage of games played at the Dr DY Patil Sports Academy venue did the winning team win by a margin of less than 10?
SQL: SELECT cast(count(CASE WHEN MATCH.win_margin < 10 THEN 1 ELSE 0 END) AS REAL) * 100 / total(venue.venue_id) FROM venue INNER JOIN MATCH ON venue.venue_id = MATCH.venue_id WHERE venue.venue_name = 'Dr DY Patil Sports Academy'
Database: soccer_2016
Note: noballs refers to extra_name = 'noballs' ; average number = divide(sum(extra_runs), count(extra_runs));
Question: What is the average number of extra runs made as noballs?
SQL: SELECT avg(extra_runs.extra_runs) FROM extra_runs INNER JOIN extra_type ON extra_runs.extra_type_id = extra_type.extra_id WHERE extra_type.extra_name = 'noballs'
Database: soccer_2016
Note: player's ID refers to player_id;
Question: List the player's ID of the top five players, by descending order, in terms of bowling skill.
SQL: SELECT player_id FROM player ORDER BY bowling_skill DESC LIMIT 5
Database: soccer_2016
Note: born before 10/16/1975 refers to dob < 1975-10-16; bowling skill of less than 3 refers to bowling_skill < 3;
Question: How many players were born before 10/16/1975, and have a bowling skill of less than 3?
SQL: SELECT count(*) FROM player WHERE dob < '1975-10-16' AND bowling_skill < 3
Database: soccer_2016
Note: name refers to player_name; youngest player refers to max(dob);
Question: What is the name of the youngest player?
SQL: SELECT player_name FROM player ORDER BY dob DESC LIMIT 1
Database: soccer_2016
Note: seasons from 2011 to 2015 refers to 2011 < season_year < 2015;
Question: Tally the player IDs of "Man of the Series" awardees for the seasons from 2011 to 2015.
SQL: SELECT man_of_the_series FROM season WHERE 2011 < season_year < 2015
Database: soccer_2016
Note: number of runs refers to runs_scored; 2nd inning refers to innings_no = 2;
Question: What is the total number of runs scored by the batsmen during the 2nd inning of the match ID 335988?
SQL: SELECT sum(runs_scored) FROM batsman_scored WHERE match_id = 335988 AND innings_no = 2
Database: soccer_2016
Note: Between match no. 335989 and 337000 refers to 335989 < match_id < 337000; batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches refers to runs_scored > 3 and  over_id = 1 and ball_id = 1 and innings_no = 1;
Question: Between match nos. 335989 and 337000, how many times did a batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches?
SQL: SELECT sum(CASE WHEN runs_scored > 3 THEN 1 ELSE 0 END) FROM batsman_scored WHERE 335989 < match_id < 337000 AND innings_no = 1 AND over_id = 1 AND ball_id = 1
Database: soccer_2016
Note: date of the matches refers to match_date; held in Kingsmead refers to venue_name = 'Kingsmead';
Question: Give me the match ID and date of the matches that were held in Kingsmead for three consecutive days.
SQL: SELECT match.match_id, match.match_date FROM `match` INNER JOIN venue ON match.venue_id = venue.venue_id WHERE venue.venue_name = 'Kingsmead'
Database: soccer_2016
Note: MA Chidambaram Stadium refers to venue_name = 'MA Chidambaram Stadium' ; from 5/9/2009 to 8/8/2011 refers to match_date between '2009-05-09' and '2011-08-08';
Question: How many times did the matches were held in MA Chidambaram Stadium from 5/9/2009 to 8/8/2011?
SQL: SELECT sum(CASE WHEN venue_name = 'MA Chidambaram Stadium' THEN 1 ELSE 0 END) FROM `match` INNER JOIN venue ON match.venue_id = venue.venue_id WHERE match_date BETWEEN '2009-05-09' AND '2011-08-08'
Database: soccer_2016
Note: ID 336005 match refers to match_id = '336005'; venue refers to venue_name; city refers to city_name;
Question: Where was the ID 336005 match held? Please give me the venue and the city.
SQL: SELECT venue.venue_name, city.city_name FROM `match` INNER JOIN venue ON match.venue_id = venue.venue_id INNER JOIN city ON venue.city_id = city.city_id WHERE match.match_id = '336005'
Database: soccer_2016
Note: wins the toss refers to toss_winner; whether they decided to bat or field refers to toss_name;
Question: Which team wins the toss during the match ID 336011, and can you tell me whether they decided to bat or field?
SQL: SELECT toss_decision.toss_name, match.toss_decide, match.toss_winner FROM `match` INNER JOIN toss_decision ON match.toss_decide = toss_decision.toss_id WHERE match.match_id = '336011'
Database: soccer_2016
Note: South African players refers to country_name = 'South Africa'; born before 4/11/1980 refers to dob < '1980-4-11';
Question: Among the South African players, how many were born before 4/11/1980?
SQL: SELECT sum(CASE WHEN player.dob < '1980-4-11' THEN 1 ELSE 0 END) FROM player INNER JOIN country ON player.country_name = country.country_id WHERE country.country_name = 'South Africa'
Database: soccer_2016
Note: name of players refers to player_name;
Question: Write down the name of players whose bowling skill is Legbreak.
SQL: SELECT player.player_name FROM bowling_style INNER JOIN player ON bowling_style.bowling_id = player.bowling_skill WHERE bowling_style.bowling_skill = 'Legbreak'