db_id stringclasses 68 values | question stringlengths 24 325 | evidence stringlengths 0 580 | SQL stringlengths 23 728 |
|---|---|---|---|
european_football_1 | What was the final score for the game Bursaspor vs Denizlispor on 2009/4/26? | Bursaspor vs Denizlispor are names of teams where HomeTeam = 'Bursaspor' and AwayTeam = 'Denizlispor'; Date = '2009-04-26'; final score refers to FTHG, FTAG; | SELECT FTHG, FTAG FROM matchs WHERE Date = '2009-04-26' AND HomeTeam = 'Bursaspor' AND AwayTeam = 'Denizlispor' |
european_football_1 | When did the first match that score more than 10 goals happen? | 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); | SELECT MIN(Date) FROM matchs WHERE FTHG + FTAG > 10 |
european_football_1 | For the Ligue 2 game that made the most goals, who is the winner of that game? | 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'; | SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam ELSE T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Ligue 2' ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1 |
european_football_1 | How many Away Victories happened on 2016/3/27 in the LaLiga 2 division? | Away victories refer to FTR = 'A'; LaLiga 2 is the name of division; Date = '2016-03-27'; | SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga 2' AND T1.Date = '2016-03-27' AND T1.FTR = 'A' |
european_football_1 | How many draw games happened on 2018/8/7 for National League? | National League is the name of division; Date = '2018-08-07'; draw refers to FTR = 'D'; games refer to Div; | SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'National League' AND T1.Date = '2018-08-07' AND T1.FTR = 'D' |
european_football_1 | Which country had the game that Away team made the most goals? | the most goals refer to MAX(FTAG), which is a short name for Final-time Away-team Goals; | SELECT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division GROUP BY T2.country ORDER BY SUM(T1.FTAG) DESC LIMIT 1 |
european_football_1 | 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. | 2011 refers to season; a score of 1-8 refers to FTHG = '1' and FTAG = '8'; | SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2011 AND T1.FTHG = 1 AND T1.FTAG = 8 |
european_football_1 | Which division had the most games with more than 5 total field goals on 2020/2/22? Give the full name of the division? | 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; | SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-02-22' AND T1.FTAG + T1.FTHG > 5 ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1 |
european_football_1 | Give the full name of the divison that had the most 0-0 games. | the most 0-0 games means a no-score draw and refers to MAX(COUNT(Div where FTHG = '0' and FTAG = '0')); | SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTAG = 0 AND T1.FTHG = 0 GROUP BY T2.division ORDER BY COUNT(T1.FTAG) DESC LIMIT 1 |
european_football_1 | How many Scottish League One games took place on the day that "Pro Vercelli" and "Pescara"had a 5-2 game? | 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; | SELECT COUNT(T1.Date) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish League One' AND T1.Date = ( SELECT Date FROM matchs WHERE FTHG = 5 AND FTAG = 2 AND HomeTeam = 'Pro Vercelli' AND AwayTeam = 'Pescara' ) |
european_football_1 | List the number of games that ended up with 5-0 in Greece. | 5-0 is a score where FTHG = '5' and FTAG = '0'; Greece is a name of country; games refer to Div; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0 |
european_football_1 | Which country did Bradford Team belongs to? | Bradford team refers to HomeTeam = 'Bradford' or AwayTeam = 'Bradford'; | SELECT DISTINCT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Bradford' OR T1.AwayTeam = 'Bradford' |
european_football_1 | How many Eredivisie teams have played in 2008? | Eredivisie is the name of division; 2008 refers to season; teams refer to HomeTeam; | SELECT COUNT(DISTINCT T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Eredivisie' AND T1.season = 2008 |
european_football_1 | What's the home win ratio of the Bundesliga division in 2021? | 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; | SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Bundesliga' |
european_football_1 | For all the games ended up with 1-1, what percentage of them are from Liga NOS division? | 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; | SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1 |
european_football_1 | How many matches were held during the 2021 season's Premier League? | Premier League is the name of division; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Premier League' |
european_football_1 | Which team was the home team in the match of the Bundesliga division on 2020/10/2? | Bundesliga is the name of division; Date = '2020/10/2'; | SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga' |
european_football_1 | Which team won the match of the Bundesliga division on 2020/10/2? | Bundesliga is the name of division; Date = '2020/10/2'; won the match refers to FTR = 'H'; | SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga' |
european_football_1 | Which team has the most victories as the home team in matches of the Bundesliga division? | Bundesliga is the name of division; the most victories as the home team refers to MAX(COUNT(FTR = 'H')); | SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1 |
european_football_1 | How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division? | Bundesliga is the name of division; win as the away team refers to FTR = 'A', where 'A' stands for away victory; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.AwayTeam = 'Werder Bremen' AND T1.FTR = 'A' |
european_football_1 | How many matches of the Bundesliga division ended with an away victory in the 2021 season? | Bundesliga is the name of division; away victory refers to FTR = 'A', where 'A' stands for away victory; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'A' AND T1.season = 2021 |
european_football_1 | Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie? | Bundesliga is the name of division; tie refers to FTR = 'D', where D stands for draft; | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'D' |
european_football_1 | How many home victories does the Bundesliga division have in more or less than the Premier League division in the 2021 season? | 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')); | SELECT COUNT(CASE WHEN T2.name = 'Bundesliga' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.name = 'Premier League' THEN 1 ELSE NULL END) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' |
european_football_1 | Please list the home teams in the matches of the Bundesliga division that ended with a home victory in the 2021 season. | Bundesliga is the name of division; home victory refers to refer to FTR = 'H', where H stands for home victory; | SELECT DISTINCT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' AND T2.name = 'Bundesliga' |
european_football_1 | Which team had more home victories in the 2021 season's matches of the Bundesliga division, Augsburg or Mainz? | 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; | SELECT CASE WHEN COUNT(CASE WHEN T1.HomeTeam = 'Augsburg' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.HomeTeam = ' Mainz' THEN 1 ELSE NULL END) > 0 THEN 'Augsburg' ELSE 'Mainz' END FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' |
european_football_1 | Which team had the most final-time home-team goals in the 2021 season's matches of the Bundesliga division? | Bundesliga is the name of division; the most final-time home-team goals refers to MAX(FTHG); | SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021 ORDER BY T1.FTHG DESC LIMIT 1 |
european_football_1 | How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season? | Bundesliga is the name of division; final-time home-team goals refers to FTHG; | SELECT SUM(T1.FTHG) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021 |
european_football_1 | What's the winning rate of Club Brugge in the 2021 Premier League? | 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)); | SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) + COUNT(CASE WHEN T1.FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(t1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.AwayTeam = 'Club Brugge' OR T1.HomeTeam = 'Club Brugge' |
professional_basketball | List the team name and the total wins of the team in year 2005 which has greater winning from the previous year. | 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 | SELECT T1.name, T1.won FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE year = 2004 ) AS T2 on T1.tmID = T2.tmID WHERE T1.year = 2005 and T1.won > T2.won |
professional_basketball | What is the percentage of the teams who had post season (playoff) were ranked number 1? | had post season (play off) refers to playoff is not null; percentage = Divide (Count(Team where rank = 1, Count(Team))) * 100 | SELECT CAST(SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(name) FROM teams |
professional_basketball | Who is the coach for 'BOS' team in year 1950. List the coach ID together with the number of game won and lost. | 'BOS' is the tmID; 1950 refers to year = 1950; number of game won refers to won; number of game lost refers to lost | SELECT coachID, won, lost FROM coaches WHERE year = 1950 AND tmID = 'BOS' |
professional_basketball | Who is the longest serving coach from year 1970 to 1980. List the coach ID and the team(s) he served. | 1970 to 1980 refers to year between 1970 and 1980; longest serving coach Max(Count(coachID)); team(s) he served refers to tmID | SELECT coachID, tmID FROM coaches WHERE year BETWEEN 1970 AND 1980 ORDER BY stint DESC LIMIT 1 |
professional_basketball | 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. | more than 50 games won refers to won > 50 | SELECT T1.coachID, T2.name, T2.won FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2000 AND T2.won > 50 |
professional_basketball | List all the coaches with more game lost than won from year 2000-2010. List the coach ID, team name and year. | from year 2000 to 2010 refers to year between 2000 and 2010; more game lost then won refers to lost > won | SELECT DISTINCT T1.coachID, T2.tmID, T1.year FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 2000 AND 2010 AND T2.lost > T2.won |
professional_basketball | Which are the teams coached by 'adelmri01' from year 1990-1995. List the team name, year and offense point. | year 1990-1995 refers to year between 1990 and 1995; 'adelmri01' is the coachID; offense point refers to o_fgm | SELECT T2.name, T1.year, T2.o_pts FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 1990 AND 1995 AND T1.coachID = 'adelmri01' |
professional_basketball | What is the percentage of player who won "All-Defensive First Team" from 1980 - 2000 is from 'NY'. | "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 | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T1.birthState = 'NY' AND T2.award = 'All-Defensive First Team' AND T2.year BETWEEN 1980 AND 2000 |
professional_basketball | What division did the team coached by the winner of the 1977 NBA Coach of the Year award play in in 1976? | "NBA Coach of the Year" is the award; in 1977 refers to year = 1977; in 1976 refers to year = 1976; division refers to divisionID | SELECT DISTINCT T3.divID FROM awards_coaches AS T1 INNER JOIN coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T2.tmID = T3.tmID WHERE T1.year = 1977 AND T1.award = 'NBA Coach of the Year' AND T3.year = 1976 |
professional_basketball | Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s? | "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 | SELECT DISTINCT T2.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T1.tmID WHERE T2.award = 'NBA Coach of the Year' AND T2.year BETWEEN 1970 AND 1979 AND T1.year = 1981 AND T3.name = 'Chicago Bulls' |
professional_basketball | In what year did the only team to beat the Houston in the final round of postseason series games earn its lowest ranking? | beat the Huston refers to tmIDLoser = 'HSM'; in final round of post season refers to round = 'DSF' | SELECT T2.year FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.round = 'DSF' AND T1.tmIDLoser = 'HSM' ORDER BY T2.rank ASC LIMIT 1 |
professional_basketball | Of all the All-star players who played in the Eastern Conference for no more than 5 minutes, how many went to Illinois College? | Eastern conference refers to conference = 'East'; no more than 5 minutes refers to minutes < 5 | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.conference = 'East' AND T2.minutes <= 5 AND T1.college = 'Illinois' |
professional_basketball | in which year costela01 obtained the best balance of games won as a coach? | "costela01" is the coachID; best balance of game won refers to Max(Divide(won, Sum(won, lost))) | SELECT year FROM coaches WHERE coachID = 'costela01' ORDER BY CAST(won AS REAL) / (won + lost) DESC LIMIT 1 |
professional_basketball | Of all the teams coached by the winner of the 1994 NBA Coach of the Year award, which team has lost the most times playing at home? | of 1994 refers to year = 1994; 'NBA Coach of the Year' is the award; lost the most time at home refers to Max(homeLost) | SELECT T3.tmID FROM awards_coaches AS T1 INNER JOIN coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T1.year = 1994 AND T1.award = 'NBA Coach of the Year' GROUP BY T3.tmID ORDER BY SUM(T3.homeLost) DESC LIMIT 1 |
professional_basketball | Which winning team in the final round of the postseason series games against the LAL won more than 60 games in the NBA league during the year 1996? | final round of post season refers to round = 'CSF'; won against LAL refers to tmIDLoser = 'LAL'; in the NBA league refers to lgID = 'NBA'; won more than 60 games refers to won > 60 | SELECT DISTINCT T2.tmID FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T2.won > 60 AND T1.year = 1996 AND T1.round = 'CSF' AND T1.tmIDLoser = 'LAL' |
professional_basketball | Please list the name of the coach who has served more than 2 NBA teams. | "NBA" is the lgID; server more than 2 teams refers to Count(tmID) = 2 | SELECT coachID FROM coaches GROUP BY coachID HAVING COUNT(DISTINCT tmID) > 2 |
professional_basketball | What is the name of the coach during whose period of coaching, a team has the most numbers of games won in the post-season games? | the most number of game won in post season refers to Max(post_wins); coach refers to coachID | SELECT coachID FROM coaches ORDER BY post_wins DESC LIMIT 1 |
professional_basketball | Among the coaches who have served more than 2 NBA teams, during which coach's period of coaching, a team has the least numbers of games lost in the post-season games? | served more than 2 NBA teams refers to count (tmID) > = 2; least number of game lost in post season refers to Min(post_losses) | SELECT coachID FROM coaches WHERE lgID = 'NBA' AND post_wins != 0 AND post_losses != 0 AND coachID IN ( SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING COUNT(tmID) > 2 ) ORDER BY post_losses ASC LIMIT 1 |
professional_basketball | Among the players from the ABA league, how many of them have the center position? | "ABA" is the lgID; center position refers to pos = 'C' or pos = 'F-C'; players refers to playerID | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'ABA' AND (T1.pos = 'C' OR T1.pos = 'F-C') |
professional_basketball | Among the players who went to high school in Chicago, how many of them belongs to the west conference? | high school in Chicago refers to hsCity = 'Chicago'; belong to the west conference refers to divID = 'WE' | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.hsCity = 'Chicago' AND T2.conference = 'West' |
professional_basketball | Among the players from the NBL league, how many of them were born in Spencer? | "NBL" is the lgID; 'Spencer' is the birthCity | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Spencer' AND T2.lgID = 'NBL' |
professional_basketball | Among the players born in Whitestone, how many of them have won the MVP? | "Whitestone" is the birthCity of the player; won the MVP refers to award = 'Most Valuable Player' | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'Houston' |
professional_basketball | Please list the top ten teams with the highest scores in 2000. | in 2000 refers to year = 2000; team with highest score refers to Max(o_fgm) | SELECT tmID FROM players_teams WHERE year = 2000 GROUP BY tmID ORDER BY SUM(PostPoints) DESC LIMIT 10 |
professional_basketball | Which teams have winning rate less than 50%? | team with winning rate less than 50% refers to Divide (won, Sum(won, lost)) < 0.5 | SELECT name FROM teams WHERE CAST(won AS REAL) * 100 / (won + lost) < 50 |
professional_basketball | Who are the coaches for team with winning rate of 80% and above? | winning rate of 80% and above refers to Divide (won, Sum(won, lost)) > 0.8; coaches refers to coachID | SELECT coachID FROM coaches GROUP BY tmID, coachID, won, lost HAVING CAST(won AS REAL) * 100 / (won + lost) > 80 |
professional_basketball | Which coach has serviced in NBA for more than 10 years. | "NBA" is the lgID; coach who serviced for more than 10 years refers to coachID where Subtract (Max(year), Min(year)) > 10 | SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING MAX(year) - MIN(year) > 10 |
professional_basketball | How many teams have played more than 3800 points and have player with "Most Valuable Player" award? | played more than 3800 points refers to Sum(points) > = 3800 | SELECT COUNT(DISTINCT T4.name) FROM ( SELECT T1.name, SUM(T2.points) FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN awards_players AS T3 ON T2.playerID = T3.playerID WHERE T3.award = 'Most Valuable Player' GROUP BY T1.name HAVING SUM(T2.points) >= 3800 ) AS T4 |
professional_basketball | From 1962 to 1975, how many coaches received the award? | from 1960 to 1975 refers to year between 1960 and 1975 | SELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 1975 |
professional_basketball | Please list the coach IDs who received the award twice from 1970 to 1990. | from 1970 to 1990 refers to year between 1970 and 1990; received award twice refers to coachID where Count(coachID) = 2 | SELECT coachID FROM awards_coaches WHERE year BETWEEN 1970 AND 1990 GROUP BY coachID, award HAVING COUNT(award) = 2 |
professional_basketball | From 1962 to 2011, how many coaches received both NBA and ABA awards? | from 1962 to 2011 refers to year between 1960 and 2011; received both NBA and ABA award refers to coachID where award LIKE 'NBA%' and 'ABA%' | SELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'ABA Coach of the Year' AND coachID IN ( SELECT coachID FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'NBA Coach of the Year' ) |
professional_basketball | How many players received Rookie of the Year award from 1969 to 2010? | from 1969 to 2010 refers to year BETWEEN 1969 and 2010; 'Rookie of the Year' is the award | SELECT COUNT(playerID) FROM awards_players WHERE year BETWEEN 1969 AND 2010 AND award = 'Rookie of the Year' |
professional_basketball | Please list the team names which have at least 3 all-star players. | team with at least 3 all star player refers to tmID where Count(player_allstar.playerID) > = 3 | SELECT T1.tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) >= 3 |
professional_basketball | From 1950 to 1970, what is the maximum point of players whose teams were ranked 1? | from 1950 to 1970 refers to year between 1950 and 1970; team with rank 1 refers to rank = 1; maximum point refers to Max(points) | SELECT MAX(T2.points) FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 1950 AND 1970 AND T1.rank = 1 |
professional_basketball | In 1937, how many teams whose players got at least 500 points? | in 1937 refers to year = 1937; player got at least 500 points refers to Sum(points) > = 500 | SELECT COUNT(*) FROM ( SELECT T2.name, SUM(T1.points) FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1937 GROUP BY T2.name HAVING SUM(points) >= 500 ) AS T3 |
professional_basketball | In 1990, how many players whose teams had the winning rate of more than 75%? | in 1990 refers to year = 1990; winning rate of more than 75% refers to Divide(won, games) > 0.75 | SELECT COUNT(DISTINCT T1.playerID) FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE CAST(T2.won AS REAL) * 100 / CAST(T2.games AS REAL) > 75 AND T1.year = 1990 |
professional_basketball | How many players with the first name Joe were drafted in 1970? | drafted in 1970 refers to draftYear = 1970 | SELECT COUNT(DISTINCT playerID) FROM draft WHERE firstName = 'Joe' AND draftYear = 1970 |
professional_basketball | How many field goals did George Mikan make overall between 1951 and 1953? | between 1951 and 1953 refers to season_id; field goal refers to fg_made | SELECT COUNT(fg_made) FROM player_allstar WHERE first_name = 'George' AND last_name = 'Mikan' AND season_id BETWEEN 1951 AND 1953 |
professional_basketball | What are the basketball players' BMI ranges? | BMI = Multiply(Divide(weight, Multiply(height, height)), 703) | SELECT MIN(CAST(weight AS REAL) / (height * height)) , MAX(CAST(weight AS REAL) / (height * height)) FROM players |
professional_basketball | What is the full name of the team with the fastest growth in winning rate in the 'ABA' league from 1972 to 1973? | "ABA" is the lgID; from 1972 to 1973 refers to year = 1972 and year = 1973; team with the fastest growth in winning rate = Max(Subtract(Divide(won where year = 1973, Sum(won, lost)),Divide(won where year = 1972, Sum(won, lost)))) | SELECT T1.name FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE lgID = 'ABA' AND year = 1972 ) AS T2 ON T1.tmID = T2.tmID WHERE T1.lgID = 'ABA' AND T1.year = 1973 ORDER BY (CAST(T1.won AS REAL) / (T1.won + T1.lost) - (CAST(T2.won AS REAL) / (T2.won + T2.lost))) DESC LIMIT 1 |
professional_basketball | Among the coaches who won the 'ABA Coach of the Year' award, which is the coach with the highest number of won games? | "ABA Coach of the Year" is the award; highest number of won games refers to Max(Count(won)) | SELECT T1.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.award = 'ABA Coach of the Year' GROUP BY T1.coachID, T1.won ORDER BY T1.won DESC LIMIT 1 |
professional_basketball | What is the full name of the team that the 'NBA Coach of the Year' 1992 winner coached? | "NBA Coach of the Year" is the award; in 1992 refers to year = 1992; | SELECT name FROM teams AS T1 INNER JOIN coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN awards_coaches AS T3 ON T2.coachID = T3.coachID AND T2.year = T3.year WHERE T3.year = 1992 AND award = 'NBA Coach of the Year' |
professional_basketball | What is the full name of the team that selected Mike Lynn? | full name refers to teams.name | SELECT T1.name FROM teams AS T1 INNER JOIN draft AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.draftYear WHERE T2.firstName = 'Mike' AND T2.lastName = 'Lynn' |
professional_basketball | Among the Most improved Players awarded from 1985-1990, how many player whose country is USA? | the Most improved Player refers to award = 'Most Improved Player'; from 1985-1990 refers to year between 1985 and 1990; country is USA refers to birthCountry = 'USA' | SELECT COUNT(DISTINCT T2.playerID) FROM awards_players AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.award = 'Most Improved Player' AND T2.birthCountry = 'USA' AND T1.year BETWEEN 1985 AND 1990 |
professional_basketball | From 1950 to 1970, how many coaches who received more than 1 award? | from 1950 to 1970 refers to year between 1950 and 1970; more than 3 awards refers to count(award) > 3 | SELECT COUNT(coachID) FROM awards_coaches WHERE year BETWEEN 1950 AND 1970 GROUP BY coachID HAVING COUNT(coachID) > 1 |
professional_basketball | How many players received Most Valuable Player award from 1969 to 1975? | Most Valuable Player award refers to award = 'Most Valuable Player'; from 1969 to 1975 refers to year between 1969 and 1975 | SELECT COUNT(DISTINCT playerID) FROM awards_players WHERE year BETWEEN 1969 AND 1975 AND award = 'Most Valuable Player' |
professional_basketball | How many teams in the NBA which has at least 3 all-star players? | NBA refers to lgID = 'NBA'; have at least 3 all-star players refers to count(player_allstar.playerID) > 3 | SELECT COUNT(*) FROM ( SELECT tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NBA' GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) > 3 ) AS T3 |
professional_basketball | How many players whose teams were ranked 6 in 1937? | ranked 6 refers to rank = 6; in 1937 refers to year = 1937 | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T3.year = 1937 AND T3.rank = 6 |
professional_basketball | In 1950, how many players whose teams have the losing rate less than 20%? | in 1950 refers to year = 1950; losing rate less than 20% refers to divide(lost, add(won, lost)) < 0.2 | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE CAST(T3.lost AS REAL) * 100 / (T3.lost + T3.won) < 20 |
professional_basketball | List out all the coach ID who have served more than 2 different teams. | more than 2 different teams refers to count(tmID) > 2 | SELECT coachID FROM coaches GROUP BY coachID HAVING COUNT(DISTINCT tmID) > 2 |
professional_basketball | Which coach has the most 'won' than 'lost' in year '1988'? | in year '1988' refers to year = 1988; the most 'won' than 'lost' refers to max(subtract(won, lost)) | SELECT coachID FROM coaches WHERE year = 1988 ORDER BY won - lost DESC LIMIT 1 |
professional_basketball | Name the team in which the coach won the title 'NBA Coach of the Year' in 2010. | team name refers to teams.name; won the title 'NBA Coach of the Year' refers to award = 'NBA Coach of the Year'; in 2010 refers to year = 2010 | SELECT DISTINCT T1.tmID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 2010 AND T2.award = 'NBA Coach of the Year' |
professional_basketball | List the champion (team name) and year from year 1950 to 1960. | champion refers to round = 'F'; team name refers to teams.name; from year 1950 to 1960 refers to year between 1950 and 1960 | SELECT DISTINCT T1.name, T2.year FROM teams AS T1 JOIN series_post AS T2 ON T1.tmID = T2.tmIDWinner WHERE T2.round = 'F' AND T2.year BETWEEN 1950 AND 1960 |
professional_basketball | Name the teams along with the coaches that went to 'Quarter Final' round in 1946. | team name refers to teams.name; coach refers to coachID; 'Quarter Final' round refers to round = 'QF'; in 1946 refers to year = 1946 | SELECT DISTINCT T1.coachID, T3.name FROM coaches AS T1 JOIN series_post AS T2 ON T1.tmID = T2.tmIDWinner JOIN teams AS T3 ON T3.tmID = T1.tmID WHERE T2.round = 'QF' AND T2.year = 1946 |
professional_basketball | What is the percentage of offense rebounds from the total rebounds of the players in year 2000. | in year 2000 refers to year = 2000; percentage = divide(sum(o_rebounds), sum(rebounds)) * 100% | SELECT CAST(SUM(T2.o_rebounds) AS REAL) * 100 / SUM(T2.rebounds) FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2000 |
professional_basketball | List the year, team and coach that with winning rate of above 75%. | team refers to teams.name; coach refers to coachID; winning rate of above 75% refers to divide(won, add(won, lost)) > 0.75 | SELECT DISTINCT T1.year, T2.name, T1.coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE CAST(T1.won AS REAL) / CAST((T1.won + T1.lost) AS REAL) > 0.75 |
professional_basketball | List all the coatches of the Oklahoma City Thunder | coach refers to coachID; Oklahoma City Thunder refers to name = 'Oklahoma City Thunder' | SELECT DISTINCT coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE name = 'Oklahoma City Thunder' |
professional_basketball | How many players did not get more than 10 steals between the years 2000 and 2005? | did not get more than 10 steals refers to count(steals) < = 10; between the years 2000 and 2005 refers to season_id between 2000 and 2005 | SELECT COUNT(DISTINCT playerID) FROM player_allstar WHERE season_id BETWEEN 2000 AND 2005 AND steals <= 10 |
professional_basketball | Which player selected by Portland in 2nd draftRound won Rookie of the Year in 1971? | 2nd draftRound refers to draftRound = 2; won Rookie of the Year refers to award = 'Rookie of the Year'; in 1971 refers to draftYear = 1971 | SELECT T1.playerID FROM draft AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' AND T1.draftYear = 1971 AND T1.draftRound = 2 |
professional_basketball | How many All Star players who played in the 1973 season were black? | 1973 season refers to season_id = 1973; black refers to race = 'B' | SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1973 AND T1.race = 'B' |
professional_basketball | Which winning team in the 1947 playoff quarterfinals managed to score 3,513 defensive points that same year? | team refers to tmID; quarterfinal refers to round = 'QF'; score 3,513 defensive points refers to d_pts > = 3513 | SELECT T2.tmID FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.year = 1947 AND T1.round = 'QF' AND T2.d_pts = 3513 |
professional_basketball | Percentage of games lost out of total games played by the Houston Mavericks | Houston Mavericks refers to name = 'Houston Mavericks'; percentage = divide(sum(lost), sum(games)) * 100% | SELECT CAST(SUM(lost) AS REAL) * 100 / SUM(games) FROM teams WHERE name = 'Houston Mavericks' |
professional_basketball | Please list the players who received the "Most Valuable Player" award in the NBA league after the year of 1990, along with their IDs. | player refers to playerID; "Most Valuable Player" award refers to award = 'Most Valuable Player'; after the year of 1990 refers to year > 1990; ID refers to playerID | SELECT playerID FROM awards_players WHERE year > 1990 AND award = 'Most Valuable Player' AND lgID = 'NBA' |
professional_basketball | How many times between 1975 and 1980 did the player abdulka01 play for LAL? | between 1975 and 1980 refers to year between 1975 and 1980; player abdulka01 refers to playerID = 'abdulka01'; play for LAL refers to tmID = 'LAL' | SELECT COUNT(DISTINCT T2.year) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'LAL' AND T2.year BETWEEN 1975 AND 1980 AND T1.playerID = 'abdulka01' |
professional_basketball | What is the percentage of coaches in 1969 who were awarded "NBA Coach of the Year"? | in 1969 refers to year = 1969; awarded "NBA Coach of the Year" refers to award = 'NBA Coach of the Year'; percentage = divide(count(coachID where year = 1969 and award = 'NBA Coach of the Year'), count(coachID)) * 100% | SELECT CAST(SUM(CASE WHEN award = 'NBA Coach of the Year' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM awards_coaches WHERE year = 1969 |
professional_basketball | What were the difference of the CHS team's winning rate between 1946 and 1947 in the post-season series games? Please provide your answer in percentages. | CHS team refers to tmIDWinner = 'CHS'; difference = subtract(divide(count(series_post where year = 1947 and tmIDWinner = 'CHS'), count(series_post where year = 1947)), divide(count(series_post where year = 1946 and tmIDWinner = 'CHS'), count(series_post where year = 1946))) | SELECT CAST(SUM(CASE WHEN year = 1947 AND tmIDWinner = 'CHS' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN year = 1947 THEN 1 ELSE 0 END) - CAST(SUM(CASE WHEN year = 1946 AND tmIDWinner = 'CHS' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN year = 1946 THEN 1 ELSE 0 END) FROM series_post |
professional_basketball | How many awards were given out in 2010 to players who attended high school in Chicago? | in 2010 refers to year = 2010; attended high school in Chicago refers to college = 'Chicago' | SELECT COUNT(T1.award) FROM awards_players AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 AND T2.hsCity = 'Chicago' |
professional_basketball | Among the NBA winning coaches, which are from STL team? Please list their coach id. | NBA refers to lgID = 'NBA'; STL team refers to tmID = 'STL' | SELECT DISTINCT T2.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.tmID = 'STL' AND T1.lgID = 'NBA' |
professional_basketball | How many times have coaches who were from CHI been awarded as NBA Coach of the Year? | CHI refers to tmID = 'CHI'; awarded Coach of the Year refers to award = 'Coach of the Year'; NBA refers to lgID = 'NBA' | SELECT COUNT(DISTINCT T2.coachID) FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.tmID = 'CHI' AND T2.award = 'NBA Coach of the Year' |
professional_basketball | Of the players drafted in NBA between 1990 and 2000, who has the most points in all-star? List the player's first name and last name. | NBA refers to lgID = 'NBA'; between 1990 and 2000 refers to year between 1990 and 2000; the most points refers to max(points) | SELECT T3.firstname, T3.lastname FROM player_allstar AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID INNER JOIN draft AS T3 ON T1.playerID = T3.playerID WHERE T2.year BETWEEN 1990 AND 2000 ORDER BY T1.points DESC LIMIT 1 |
professional_basketball | Which player had the most game presentatons in 2011 NBA season. | player refers to playerID; the most game presentations refers to max(GP); in 2020 refers to year = 2020; NBA season refers to lgID = 'NBA' | SELECT playerID FROM players_teams WHERE year = 2011 ORDER BY GP DESC LIMIT 1 |
professional_basketball | How many first round draft player in 1996 NBA draft became an All-Star? | first round refers to round = 1; in 1996 refers to year = 1996; NBA refers to lgID = 'NBA' | SELECT COUNT(T2.playerID) FROM draft AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.draftYear = 1996 AND T1.draftRound = 1 |
professional_basketball | Which team did the MVP of 1997 NBA season play in? | team refers to tmID; MVP refers to award like '%MVP'; 1997 refers to year = 1997; NBA refers to lgID = 'NBA' | SELECT DISTINCT T3.tmID FROM players_teams AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T1.tmID = T3.tmID AND T1.year = T3.year WHERE T2.year = 1997 AND T2.award = 'Finals MVP' LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.