Chinastark/bird_dataset huggingface dataset:
Database: european_football_1
Note: LaLiga is a name of the division; Valencia's home team refers to hometeam = 'Valencia'; win refers to ftr = 'H';
Question: How many times did Valencia's home team win in the LaLiga division?
SQL: SELECT count(matchs.hometeam) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'LaLiga' AND matchs.hometeam = 'Valencia' AND matchs.ftr = 'H'
Database: european_football_1
Note: Seria A is a name of division; equal goals refers to ftr = 'D', where D stands for draft;
Question: In how many matches in the Seria A division did both teams have equal goals?
SQL: SELECT count(matchs.ftr) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Seria A' AND matchs.ftr = 'D'
Database: european_football_1
Note: England is the name of country;
Question: How many football divisions does England have?
SQL: SELECT count(division) FROM divisions WHERE country = 'England'
Database: european_football_1
Note: Netherlands is the name of country;
Question: What's the name of the football division in the Netherlands?
SQL: SELECT name FROM divisions WHERE country = 'Netherlands'
Database: european_football_1
Note: 2009/10/10 is a date; the winner refers to ftr = 'A'; East Fife and Dumbarton are name of teams where hometeam = 'East Fife'; awayteam = 'Dumbarton';
Question: Who is the winner of the game happened on 2009/10/10, between "East Fife" and "Dumbarton"?
SQL: SELECT CASE WHEN ftr = 'H' THEN 'East Fife' ELSE 'Dumbarton' END winner FROM matchs WHERE Date = '2009-10-10' AND hometeam = 'East Fife' AND awayteam = 'Dumbarton'
Database: european_football_1
Note: Bursaspor vs Denizlispor are names of teams where hometeam = 'Bursaspor' and awayteam = 'Denizlispor'; date = '2009-04-26'; final score refers to fthg, ftag;
Question: What was the final score for the game Bursaspor vs Denizlispor on 2009/4/26?
SQL: SELECT fthg, ftag FROM matchs WHERE Date = '2009-04-26' AND hometeam = 'Bursaspor' AND awayteam = 'Denizlispor'
Database: european_football_1
Note: score more than 10 goals refers to SUM(fthg, ftag)>10, which are short names for Final-time Home-team Goals and Final-time Away-team Goals; the first means the earliest and refers to MIN(date);
Question: When did the first match that score more than 10 goals happen?
SQL: SELECT min(Date) FROM matchs WHERE fthg + ftag > 10
Database: european_football_1
Note: Ligue 2 is the name of division; the most goals refer to MAX(SUM(fthg, ftag)) which are short names for Final-time Home-team Goals and Final-time Away-team Goals; winner refers to ftr = 'A';
Question: For the Ligue 2 game that made the most goals, who is the winner of that game?
SQL: SELECT CASE WHEN matchs.ftr = 'H' THEN matchs.hometeam ELSE matchs.awayteam END winner FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Ligue 2' ORDER BY matchs.ftag + matchs.fthg DESC LIMIT 1
Database: european_football_1
Note: Away victories refer to ftr = 'A'; LaLiga 2 is the name of division; date = '2016-03-27';
Question: How many Away Victories happened on 2016/3/27 in the LaLiga 2 division?
SQL: SELECT count(matchs.ftr) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'LaLiga 2' AND matchs.date = '2016-03-27' AND matchs.ftr = 'A'
Database: european_football_1
Note: National League is the name of division; date = '2018-08-07'; draw refers to ftr = 'D'; games refer to div;
Question: How many draw games happened on 2018/8/7 for National League?
SQL: SELECT count(matchs.ftr) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'National League' AND matchs.date = '2018-08-07' AND matchs.ftr = 'D'
Database: european_football_1
Note: the most goals refer to MAX(ftag), which is a short name for Final-time Away-team Goals;
Question: Which country had the game that Away team made the most goals?
SQL: SELECT divisions.country FROM matchs INNER JOIN divisions ON matchs.div = divisions.division GROUP BY divisions.country ORDER BY sum(matchs.ftag) DESC LIMIT 1
Database: european_football_1
Note: 2011 refers to season; a score of 1-8 refers to fthg = '1' and ftag = '8';
Question: For a game had a score of 1-8 in the year of 2011, what division was that game in? Give the full name of the division.
SQL: SELECT divisions.division, divisions.name FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2011 AND matchs.fthg = 1 AND matchs.ftag = 8
Database: european_football_1
Note: more than 5 total field goals refers to SUM(fthg, ftag)>5, which are short names for Final-time Home-team Goals and Final-time Away-team Goals; 2020/2/22 is a date;
Question: Which division had the most games with more than 5 total field goals on 2020/2/22? Give the full name of the division?
SQL: SELECT divisions.division, divisions.name FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.date = '2020-02-22' AND matchs.ftag + matchs.fthg > 5 ORDER BY matchs.ftag + matchs.fthg DESC LIMIT 1
Database: european_football_1
Note: the most 0-0 games means a no-score draw and refers to MAX(COUNT(div where fthg = '0' and ftag = '0'));
Question: Give the full name of the divison that had the most 0-0 games.
SQL: SELECT divisions.name FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.ftag = 0 AND matchs.fthg = 0 GROUP BY divisions.division ORDER BY count(matchs.ftag) DESC LIMIT 1
Database: european_football_1
Note: Pro Vercelli and Pescara are names of teams; hometeam = 'Pro Vercelli'; awayteam = 'Pescara'; 5-2 is a score where fthg = '5' and ftag = '2'; Scottish League One is a name of division; games refer to div;
Question: How many Scottish League One games took place on the day that "Pro Vercelli" and "Pescara"had a 5-2 game?
SQL: SELECT count(matchs.date) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Scottish League One' AND matchs.date = ( SELECT Date FROM matchs WHERE fthg = 5 AND ftag = 2 AND hometeam = 'Pro Vercelli' AND awayteam = 'Pescara' )
Database: european_football_1
Note: 5-0 is a score where fthg = '5' and ftag = '0'; Greece is a name of country; games refer to div;
Question: List the number of games that ended up with 5-0 in Greece.
SQL: SELECT count(matchs.div) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.country = 'Greece' AND matchs.fthg = 5 AND matchs.ftag = 0
Database: european_football_1
Note: Bradford team refers to hometeam = 'Bradford' or awayteam = 'Bradford';
Question: Which country did Bradford Team belongs to?
SQL: SELECT DISTINCT divisions.country FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.hometeam = 'Bradford' OR matchs.awayteam = 'Bradford'
Database: european_football_1
Note: Eredivisie is the name of division; 2008 refers to season; teams refer to hometeam;
Question: How many Eredivisie teams have played in 2008?
SQL: SELECT count(DISTINCT matchs.hometeam) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Eredivisie' AND matchs.season = 2008
Database: european_football_1
Note: home win refers to ftr = 'H', where H stands for home victory; season = '2021'; Bundesliga is a name of division; divIDE(COUNT(div where ftr = 'H, season = '2021' and name = 'Bundesliga'), COUNT(div where season = '2021' and name = 'Bundesliga')) as percentage;
Question: What's the home win ratio of the Bundesliga division in 2021?
SQL: SELECT cast(count(CASE WHEN matchs.ftr = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / count(matchs.ftr) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2021 AND divisions.name = 'Bundesliga'
Database: european_football_1
Note: 1-1 is a score where fthg = '1' and ftag = '1'; Liga NOS is the name of division; divIDE(COUNT(div where fthg = '1', ftag = '1', name = 'Liga NOS'), COUNT(div where fthg = '1' and ftag = '1')) as percentage;
Question: For all the games ended up with 1-1, what percentage of them are from Liga NOS division?
SQL: SELECT cast(count(CASE WHEN divisions.name = 'Liga NOS' THEN matchs.div ELSE NULL END) AS REAL) * 100 / count(matchs.div) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.fthg = 1 AND ftag = 1
Database: european_football_1
Note: Premier League is the name of division;
Question: How many matches were held during the 2021 season's Premier League?
SQL: SELECT count(matchs.div) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2021 AND divisions.name = 'Premier League'
Database: european_football_1
Note: Bundesliga is the name of division; date = '2020/10/2';
Question: Which team was the home team in the match of the Bundesliga division on 2020/10/2?
SQL: SELECT matchs.hometeam FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.date = '2020-10-02' AND divisions.name = 'Bundesliga'
Database: european_football_1
Note: Bundesliga is the name of division; date = '2020/10/2'; won the match refers to ftr = 'H';
Question: Which team won the match of the Bundesliga division on 2020/10/2?
SQL: SELECT CASE WHEN matchs.ftr = 'H' THEN matchs.hometeam WHEN matchs.ftr = 'A' THEN matchs.awayteam END winner FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.date = '2020-10-02' AND divisions.name = 'Bundesliga'
Database: european_football_1
Note: Bundesliga is the name of division; the most victories as the home team refers to MAX(COUNT(ftr = 'H'));
Question: Which team has the most victories as the home team in matches of the Bundesliga division?
SQL: SELECT matchs.hometeam FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Bundesliga' AND matchs.ftr = 'H' GROUP BY matchs.hometeam ORDER BY count(matchs.ftr) DESC LIMIT 1
Database: european_football_1
Note: Bundesliga is the name of division; win as the away team refers to ftr = 'A', where 'A' stands for away victory;
Question: How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division?
SQL: SELECT count(matchs.div) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Bundesliga' AND matchs.awayteam = 'Werder Bremen' AND matchs.ftr = 'A'
Database: european_football_1
Note: Bundesliga is the name of division; away victory refers to ftr = 'A', where 'A' stands for away victory;
Question: How many matches of the Bundesliga division ended with an away victory in the 2021 season?
SQL: SELECT count(matchs.div) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Bundesliga' AND matchs.ftr = 'A' AND matchs.season = 2021
Database: european_football_1
Note: Bundesliga is the name of division; tie refers to ftr = 'D', where D stands for draft;
Question: Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie?
SQL: SELECT count(matchs.div) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Bundesliga' AND matchs.ftr = 'D'
Database: european_football_1
Note: Bundesliga and the Premier League are names of division; home victories refer to ftr = 'H', where H stands for home victory; SUBTRACT(COUNT(ftr = 'H' where season = 2021, name = 'Bundesliga'), COUNT(ftr = 'H' where season = 2021, name = 'Premier League'));
Question: How many home victories does the Bundesliga division have in more or less than the Premier League division in the 2021 season?
SQL: SELECT count(CASE WHEN divisions.name = 'Bundesliga' THEN 1 ELSE NULL END) - count(CASE WHEN divisions.name = 'Premier League' THEN 1 ELSE NULL END) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2021 AND matchs.ftr = 'H'
Database: european_football_1
Note: Bundesliga is the name of division; home victory refers to refer to ftr = 'H', where H stands for home victory;
Question: Please list the home teams in the matches of the Bundesliga division that ended with a home victory in the 2021 season.
SQL: SELECT DISTINCT matchs.hometeam FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2021 AND matchs.ftr = 'H' AND divisions.name = 'Bundesliga'
Database: european_football_1
Note: Bundesliga is the name of division; more home victories refer to MAX(ftr = 'H)'; Augsburg and Mainz are names of teams and refer to hometeam;
Question: Which team had more home victories in the 2021 season's matches of the Bundesliga division, Augsburg or Mainz?
SQL: SELECT CASE WHEN count(CASE WHEN matchs.hometeam = 'Augsburg' THEN 1 ELSE NULL END) - count(CASE WHEN matchs.hometeam = ' Mainz' THEN 1 ELSE NULL END) > 0 THEN 'Augsburg' ELSE 'Mainz' END FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2021 AND matchs.ftr = 'H'
Database: european_football_1
Note: Bundesliga is the name of division; the most final-time home-team goals refers to MAX(fthg);
Question: Which team had the most final-time home-team goals in the 2021 season's matches of the Bundesliga division?
SQL: SELECT matchs.hometeam FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Bundesliga' AND matchs.season = 2021 ORDER BY matchs.fthg DESC LIMIT 1
Database: european_football_1
Note: Bundesliga is the name of division; final-time home-team goals refers to fthg;
Question: How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season?
SQL: SELECT sum(matchs.fthg) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE divisions.name = 'Bundesliga' AND matchs.season = 2021
Database: european_football_1
Note: Premier League is name of division; season = 2021; Club Brugge is name of team; Club Brugge wins implies hometeam = 'Club Brugge' and ftr = 'H' and awayteam = 'Club Brugge' and ftr = 'A'; divIDE(SUM(COUNT(ftr = 'H' where hometeam = 'Club Brugge', name = 'Premier League', season = 2021), COUNT(ftr = 'A'where awayteam = 'Club Brugge', name = 'Premier League', season = 2021)), COUNT(div where name = 'Premier League', season = 2021));
Question: What's the winning rate of Club Brugge in the 2021 Premier League?
SQL: SELECT cast(count(CASE WHEN matchs.ftr = 'H' THEN 1 ELSE NULL END) + count(CASE WHEN matchs.ftr = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / count(matchs.ftr) FROM matchs INNER JOIN divisions ON matchs.div = divisions.division WHERE matchs.season = 2021 AND matchs.awayteam = 'Club Brugge' OR matchs.hometeam = 'Club Brugge'
Database: professional_basketball
Note: percentage of winning at the home = divide(homewon, won) * 100;
Question: Among the winning game from the team, what is the percentage of the winning was home game.
SQL: SELECT cast(homewon AS REAL) * 100 / won  FROM teams
Database: professional_basketball
Note: greater than 75% lost refers to divide(lost, games) > 0.75; team refers to tmid;
Question: Which team(s) has greater than 75% lost among all the games played.
SQL: SELECT name FROM teams WHERE cast(lost AS REAL) * 100 / games > 75
Database: professional_basketball
Note: 2005 refers to year = 2005 ; previous year refers to year = 2004; team with greater winning than previous year refers to won where year = 2005 > won where year = 2004; team name refers to tmid;
Question: List the team name and the total wins of the team in year 2005 which has greater winning from the previous year.
SQL: SELECT teams.name, teams.won FROM teams INNER JOIN ( SELECT * FROM teams WHERE YEAR = 2004 ) AS t2 ON teams.tmid = t2.tmid WHERE teams.year = 2005 AND teams.won > t2.won
Database: professional_basketball
Note: home won than home lost more than 80% refers to divide(Subtract(homewon, homelost), games) > 0.8; offense point refers to o_fgm;
Question: For team who has more home won than home lost more than 80%, list the team name and the offense points.
SQL: SELECT name, o_pts FROM teams WHERE cast((homewon - homelost) AS REAL) * 100 / games > 80
Database: professional_basketball
Note: had post season (play off) refers to playoff is not null; percentage = divide (Count(Team where rank = 1, Count(Team))) * 100;
Question: What is the percentage of the teams who had post season (playoff) were ranked number 1?
SQL: SELECT cast(sum(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / count(name) FROM teams
Database: professional_basketball
Note: 'BOS' is the tmid; 1950 refers to year = 1950; number of game won refers to won; number of game lost refers to lost;
Question: Who is the coach for 'BOS' team in year 1950. List the coach ID together with the number of game won and lost.
SQL: SELECT coachid, won, lost FROM coaches WHERE YEAR = 1950 AND tmid = 'BOS'
Database: professional_basketball
Note: 1970 to 1980 refers to year between 1970 and 1980; longest serving coach Max(Count(coachid)); team(s) he served refers to tmid;
Question: Who is the longest serving coach from year 1970 to 1980. List the coach ID and the team(s) he served.
SQL: SELECT coachid, tmid FROM coaches WHERE YEAR BETWEEN 1970 AND 1980 ORDER BY stint DESC LIMIT 1
Database: professional_basketball
Note: more than 50 games won refers to won > 50;
Question: In year 2000, who are the coaches with more than 50 games won. List the coachID, team name and number of game won at home game.
SQL: SELECT coaches.coachid, teams.name, teams.won FROM coaches INNER JOIN teams ON coaches.tmid = teams.tmid AND coaches.year = teams.year WHERE coaches.year = 2000 AND teams.won > 50
Database: professional_basketball
Note: from year 2000 to 2010 refers to year between 2000 and 2010; more game lost then won refers to lost > won;
Question: List all the coaches with more game lost than won from year 2000-2010. List the coach ID, team name and year.
SQL: SELECT DISTINCT coaches.coachid, teams.tmid, coaches.year FROM coaches INNER JOIN teams ON coaches.tmid = teams.tmid AND coaches.year = teams.year WHERE coaches.year BETWEEN 2000 AND 2010 AND teams.lost > teams.won
Database: professional_basketball
Note: year 1990-1995 refers to year between 1990 and 1995; 'adelmri01' is the coachid; offense point refers to o_fgm;
Question: Which are the teams coached by 'adelmri01' from year 1990-1995. List the team name, year and offense point.
SQL: SELECT teams.name, coaches.year, teams.o_pts FROM coaches INNER JOIN teams ON coaches.tmid = teams.tmid AND coaches.year = teams.year WHERE coaches.year BETWEEN 1990 AND 1995 AND coaches.coachid = 'adelmri01'
Database: professional_basketball
Note: team with 90% games won refers to divide (won, games) > 0.9;
Question: Which team(s) had 90% games won. List the coach ID for the team and year played.
SQL: SELECT DISTINCT teams.name, coaches.year, coaches.coachid FROM coaches INNER JOIN teams ON coaches.tmid = teams.tmid WHERE cast(teams.won AS REAL) * 100 / teams.games > 90
Database: professional_basketball
Note: "All-Defensive First Team" is the award; ' NY' is the birthstate; 1980 to 2000 refers to year between 1980 and 2000; percentage = divide (Count(playerid where birthstate = 'NY'), Count(playerid)) * 100;
Question: What is the percentage of player who won "All-Defensive First Team" from 1980 - 2000 is from 'NY'.
SQL: SELECT count(DISTINCT players.playerid) FROM players INNER JOIN awards_players ON players.playerid = awards_players.playerid WHERE players.birthstate = 'NY' AND awards_players.award = 'All-Defensive First Team' AND awards_players.year BETWEEN 1980 AND 2000
Database: professional_basketball
Note: "NBA Coach of the year" is the award; in 1977 refers to year = 1977; in 1976 refers to year = 1976; division refers to divisionid;
Question: What division did the team coached by the winner of the 1977 NBA Coach of the Year award play in in 1976?
SQL: SELECT DISTINCT teams.divid FROM awards_coaches INNER JOIN coaches ON awards_coaches.coachid = coaches.coachid INNER JOIN teams ON coaches.tmid = teams.tmid WHERE awards_coaches.year = 1977 AND awards_coaches.award = 'NBA Coach of the Year' AND teams.year = 1976
Database: professional_basketball
Note: "Chicago Bull" is the name of team; during the year 1981 refers to year = 1981; 'NBA Coach of the year' is the award; in the 1970s refers to year between 1970 to 1979;
Question: Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s?
SQL: SELECT DISTINCT awards_coaches.coachid FROM coaches INNER JOIN awards_coaches ON coaches.coachid = awards_coaches.coachid INNER JOIN teams ON teams.tmid = coaches.tmid WHERE awards_coaches.award = 'NBA Coach of the Year' AND awards_coaches.year BETWEEN 1970 AND 1979 AND coaches.year = 1981 AND teams.name = 'Chicago Bulls'
Database: professional_basketball
Note: completed in the western conference refers to conference = 'west'; in season 2006 refers to season_id = 2006; total of two blocks refers to blocks = 2; nickname refers to namenick;
Question: What is the nickname of the NBA player whose team competed in the Western Conference in the season 2006 and who had a total of two blocks?
SQL: SELECT players.namenick FROM player_allstar INNER JOIN players ON player_allstar.playerid = players.playerid WHERE player_allstar.blocks = 2 AND player_allstar.conference = 'West' AND player_allstar.season_id = 2006
Database: professional_basketball
Note: beat the Huston refers to tmidloser = 'HSM';  in final round of post season refers to round = 'DSF';
Question: In what year did the only team to beat the Houston in the final round of postseason series games earn its lowest ranking?
SQL: SELECT teams.year FROM series_post INNER JOIN teams ON series_post.tmidwinner = teams.tmid WHERE series_post.round = 'DSF' AND series_post.tmidloser = 'HSM' ORDER BY teams.rank ASC LIMIT 1
Database: professional_basketball
Note: most assist refers to Max(assists); in 1985 All Star season refers to season_id = 1985;
Question: What is the birth date of the player with the most assists during the 1985 All-Star season?
SQL: SELECT players.birthdate FROM players INNER JOIN player_allstar ON players.playerid = player_allstar.playerid WHERE player_allstar.season_id = 1985 ORDER BY player_allstar.assists DESC LIMIT 1
Database: professional_basketball
Note: born in winter Haven refers to birthcity = 'winter Haven'; during the 1980s in All-Stars refers to season_id = 1980; played in 12 minutes  per season refers to minutes = 12;
Question: Which player, born in Winter Haven, played 12 minutes per season during the 1980s in the All-Stars?
SQL: SELECT DISTINCT players.firstname, players.middlename, players.lastname FROM players INNER JOIN player_allstar ON players.playerid = player_allstar.playerid WHERE players.birthcity = 'Winter Haven' AND player_allstar.season_id BETWEEN 1980 AND 1989 AND player_allstar.minutes = 12
Database: professional_basketball
Note: Eastern conference refers to conference = 'East'; no more than 5 minutes refers to minutes < 5;
Question: Of all the All-star players who played in the Eastern Conference for no more than 5 minutes, how many went to Illinois College?
SQL: SELECT count(DISTINCT players.playerid) FROM players INNER JOIN player_allstar ON players.playerid = player_allstar.playerid WHERE player_allstar.conference = 'East' AND player_allstar.minutes <= 5 AND players.college = 'Illinois'
Database: professional_basketball
Note: the year 1990 and 2007 refers to year BETwEEN 1990 AND 2007; exceed 75% of defensive rebounds refers to divide (drebounds, rebounds) * 100 > 75;
Question: Between the years 1990 and 2007, of the total rebounds achieved by each player, how many managed to exceed 75% of defensive rebounds?
SQL: SELECT count(DISTINCT playerid) FROM player_allstar WHERE cast(d_rebounds AS REAL) * 100 / rebounds > 75 AND season_id BETWEEN 1990 AND 2007
Database: professional_basketball
Note: "costela01" is the coachid; best balance of game won refers to Max(divide(won, Sum(won, lost)));
Question: in which year costela01 obtained the best balance of games won as a coach?
SQL: SELECT YEAR FROM coaches WHERE coachid = 'costela01' ORDER BY cast(won AS REAL) / (won + lost) DESC LIMIT 1