problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: What is the name of the home team in division P1 with the highest final time goal in all seasons?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT HomeTeam FROM matchs WHERE Div = 'P1' AND season = 2021 ORDER BY FTHG DESC LIMIT 1 |
Write SQL query to solve given problem: What was the difference in home team and away team win percentages across all divisions in 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) - CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) DIFFERENCE FROM matchs WHERE season = 2010 |
Write SQL query to solve given problem: Which division had the most draft matches in the 2008 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT Div FROM matchs WHERE season = 2008 AND FTR = 'D' GROUP BY Div ORDER BY COUNT(FTR) DESC LIMIT 1 |
Write SQL query to solve given problem: Which team won the match in the EC division on January 20, 2008 at home?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT HomeTeam FROM matchs WHERE Div = 'EC' AND Date = '2008-01-20' AND FTR = 'H' |
Write SQL query to solve given problem: What is the name of the division in which Club Brugge and Genk competed on September 13, 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk' |
Write SQL query to solve given problem: How many matches were played in the Scottish Premiership division from 2006 to 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish Premiership' AND (T1.season BETWEEN 2006 AND 2008) |
Write SQL query to solve given problem: In which division was the match between Hibernian, the away team, and Hearts, the home team, played? To which country does this division belong?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT DISTINCT T2.division,T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Hearts' AND T1.AwayTeam = 'Hibernian' |
Write SQL query to solve given problem: Which away team in the division of Bundesliga has the highest final time goals?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'Bundesliga' ORDER BY T1.FTAG DESC LIMIT 1 |
Write SQL query to solve given problem: Please provide the names of any three away teams that competed in the Italian divisions.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.country = 'Italy' LIMIT 3 |
Write SQL query to solve given problem: What is the name of the division that has had the lowest number of draft matches in the 2019 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T1.FTR = 'D' GROUP BY T2.division ORDER BY COUNT(FTR) LIMIT 1 |
Write SQL query to solve given problem: How many times did Valencia's home team win in the LaLiga division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT COUNT(T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T1.HomeTeam = 'Valencia' AND T1.FTR = 'H' |
Write SQL query to solve given problem: In how many matches in the Seria A division did both teams have equal goals?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D' |
Write SQL query to solve given problem: How many football divisions does England have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT COUNT(division) FROM divisions WHERE country = 'England' |
Write SQL query to solve given problem: What's the name of the football division in the Netherlands?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT name FROM divisions WHERE country = 'Netherlands' |
Write SQL query to solve given problem: Who is the winner of the game happened on 2009/10/10, between "East Fife" and "Dumbarton"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: What was the final score for the game Bursaspor vs Denizlispor on 2009/4/26?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT FTHG, FTAG FROM matchs WHERE Date = '2009-04-26' AND HomeTeam = 'Bursaspor' AND AwayTeam = 'Denizlispor' |
Write SQL query to solve given problem: When did the first match that score more than 10 goals happen?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | SELECT MIN(Date) FROM matchs WHERE FTHG + FTAG > 10 |
Write SQL query to solve given problem: For the Ligue 2 game that made the most goals, who is the winner of that game?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: How many Away Victories happened on 2016/3/27 in the LaLiga 2 division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: How many draw games happened on 2018/8/7 for National League?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Which country had the game that Away team made the most goals?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: Which division had the most games with more than 5 total field goals on 2020/2/22? Give the full name of the division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: Give the full name of the divison that had the most 0-0 games.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: How many Scottish League One games took place on the day that "Pro Vercelli" and "Pescara"had a 5-2 game?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' ) |
Write SQL query to solve given problem: List the number of games that ended up with 5-0 in Greece.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: Which country did Bradford Team belongs to?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: How many Eredivisie teams have played in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: What's the home win ratio of the Bundesliga division in 2021?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: For all the games ended up with 1-1, what percentage of them are from Liga NOS division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: How many matches were held during the 2021 season's Premier League?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Which team was the home team in the match of the Bundesliga division on 2020/10/2?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Which team won the match of the Bundesliga division on 2020/10/2?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Which team has the most victories as the home team in matches of the Bundesliga division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: How many matches of the Bundesliga division ended with an away victory in the 2021 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: How many home victories does the Bundesliga division have in more or less than the Premier League division in the 2021 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Please list the home teams in the matches of the Bundesliga division that ended with a home victory in the 2021 season.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Which team had more home victories in the 2021 season's matches of the Bundesliga division, Augsburg or Mainz?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Which team had the most final-time home-team goals in the 2021 season's matches of the Bundesliga division?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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 |
Write SQL query to solve given problem: What's the winning rate of Club Brugge in the 2021 Premier League?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | european_football_1 | 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' |
Write SQL query to solve given problem: Among the winning game from the team, what is the percentage of the winning was home game.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT CAST(homeWon AS REAL) * 100 / won FROM teams |
Write SQL query to solve given problem: Which team(s) has greater than 75% lost among all the games played.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT name FROM teams WHERE CAST(lost AS REAL) * 100 / games > 75 |
Write SQL query to solve given problem: List the team name and the total wins of the team in year 2005 which has greater winning from the previous year.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: For team who has more home won than home lost more than 80%, list the team name and the offense points.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT name, o_pts FROM teams WHERE CAST((homeWon - homeLost) AS REAL) * 100 / games > 80 |
Write SQL query to solve given problem: What is the percentage of the teams who had post season (playoff) were ranked number 1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT CAST(SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(name) FROM teams |
Write SQL query to solve given problem: Who is the coach for 'BOS' team in year 1950. List the coach ID together with the number of game won and lost.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID, won, lost FROM coaches WHERE year = 1950 AND tmID = 'BOS' |
Write SQL query to solve given problem: Who is the longest serving coach from year 1970 to 1980. List the coach ID and the team(s) he served.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID, tmID FROM coaches WHERE year BETWEEN 1970 AND 1980 ORDER BY stint DESC LIMIT 1 |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: List all the coaches with more game lost than won from year 2000-2010. List the coach ID, team name and year.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: Which are the teams coached by 'adelmri01' from year 1990-1995. List the team name, year and offense point.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: Which team(s) had 90% games won. List the coach ID for the team and year played.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT DISTINCT T2.name, T1.year, T1.coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE CAST(T2.won AS REAL) * 100 / T2.games > 90 |
Write SQL query to solve given problem: What is the percentage of player who won "All-Defensive First Team" from 1980 - 2000 is from 'NY'.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: What division did the team coached by the winner of the 1977 NBA Coach of the Year award play in in 1976?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T2.nameNick FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.blocks = 2 AND T1.conference = 'West' AND T1.season_id = 2006 |
Write SQL query to solve given problem: In what year did the only team to beat the Houston in the final round of postseason series games earn its lowest ranking?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: What is the birth date of the player with the most assists during the 1985 All-Star season?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T1.birthDate FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1985 ORDER BY T2.assists DESC LIMIT 1 |
Write SQL query to solve given problem: Which player, born in Winter Haven, played 12 minutes per season during the 1980s in the All-Stars?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT DISTINCT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Winter Haven' AND T2.season_id BETWEEN 1980 AND 1989 AND T2.minutes = 12 |
Write SQL query to solve given problem: Of all the All-star players who played in the Eastern Conference for no more than 5 minutes, how many went to Illinois College?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: Between the years 1990 and 2007, of the total rebounds achieved by each player, how many managed to exceed 75% of defensive rebounds?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT COUNT(DISTINCT playerID) FROM player_allstar WHERE CAST(d_rebounds AS REAL) * 100 / rebounds > 75 AND season_id BETWEEN 1990 AND 2007 |
Write SQL query to solve given problem: in which year costela01 obtained the best balance of games won as a coach?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT year FROM coaches WHERE coachID = 'costela01' ORDER BY CAST(won AS REAL) / (won + lost) DESC LIMIT 1 |
Write SQL query to solve given problem: How many total minutes has the Brooklyn-born player, known by the name of Superman, played during all of his NBA All-Star seasons?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT SUM(T2.minutes) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Brooklyn' AND T1.nameNick LIKE '%Superman%' |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: In which league did the player who weighs 40% less than the heaviest player and whose height is 80 inches play?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T2.lgID FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID GROUP BY T2.lgID, T1.weight HAVING T1.weight = MAX(T1.weight) - MAX(T1.weight) * 0.4 |
Write SQL query to solve given problem: Please list the name of the coach who has served more than 2 NBA teams.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID FROM coaches GROUP BY coachID HAVING COUNT(DISTINCT tmID) > 2 |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID FROM coaches ORDER BY post_wins DESC LIMIT 1 |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: Among the players from the ABA league, how many of them have the center position?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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') |
Write SQL query to solve given problem: Please list the first name of the players from the NBA league with the forward position.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT DISTINCT T1.firstName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE (T1.pos = 'F' OR T1.pos = 'F-C') AND T2.lgID = 'NBA' |
Write SQL query to solve given problem: Among the players who went to high school in Chicago, how many of them belongs to the west conference?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: For the players who belongs to the east conference, please list the name of the college they went to.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT DISTINCT T1.college FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.conference = 'East' |
Write SQL query to solve given problem: Among the players from the NBL league, how many of them were born in Spencer?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: Please list the birth date of the player who has won the most MVPs.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T1.birthDate FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' GROUP BY T1.playerID, T1.birthDate ORDER BY COUNT(award) DESC LIMIT 1 |
Write SQL query to solve given problem: Among the players born in Whitestone, how many of them have won the MVP?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' |
Write SQL query to solve given problem: Among the players who have won the award of Rookie of the year, what is the height of the tallest player?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T1.height FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' ORDER BY T1.height DESC LIMIT 1 |
Write SQL query to solve given problem: What is the average weight of the players who have won the award of Rookie of the year?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT AVG(T1.weight) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' |
Write SQL query to solve given problem: Among the players that went to high school in New York and have won the MVP, what is their average height?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT AVG(T1.height) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'New York' |
Write SQL query to solve given problem: Please list the top ten teams with the highest scores in 2000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT tmID FROM players_teams WHERE year = 2000 GROUP BY tmID ORDER BY SUM(PostPoints) DESC LIMIT 10 |
Write SQL query to solve given problem: Which teams have winning rate less than 50%?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT name FROM teams WHERE CAST(won AS REAL) * 100 / (won + lost) < 50 |
Write SQL query to solve given problem: Who are the coaches for team with winning rate of 80% and above?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID FROM coaches GROUP BY tmID, coachID, won, lost HAVING CAST(won AS REAL) * 100 / (won + lost) > 80 |
Write SQL query to solve given problem: Which coach has serviced in NBA for more than 10 years.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING MAX(year) - MIN(year) > 10 |
Write SQL query to solve given problem: How many teams have played more than 3800 points and have player with "Most Valuable Player" award?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: Which player from "AFS" team has the tallest height?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'AFS' ORDER BY T1.height DESC LIMIT 1 |
Write SQL query to solve given problem: Please list down the last name of players from "BLB" team.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'BLB' |
Write SQL query to solve given problem: From 1962 to 1975, how many coaches received the award?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 1975 |
Write SQL query to solve given problem: Please list the coach IDs who received the award twice from 1970 to 1990.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT coachID FROM awards_coaches WHERE year BETWEEN 1970 AND 1990 GROUP BY coachID, award HAVING COUNT(award) = 2 |
Write SQL query to solve given problem: From 1962 to 2011, how many coaches received both NBA and ABA awards?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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' ) |
Write SQL query to solve given problem: In 1975, what was the average point of all-star players coming from the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT AVG(T2.points) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1975 |
Write SQL query to solve given problem: Please list the last names and first names of all-star players who are higher than 75 inch.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT DISTINCT T1.lastName, T1.firstName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.height > 75 |
Write SQL query to solve given problem: What is the minimum weight of all-star players coming from UCLA college?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT MIN(T1.weight) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'UCLA' |
Write SQL query to solve given problem: What is the maximum weight of USA all-star players?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT MAX(T1.weight) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'USA' |
Write SQL query to solve given problem: From 1960 to 1970, what is the total point of all-star players who are still alive?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT SUM(T2.points) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id BETWEEN 1960 AND 1970 AND T1.deathDate = '0000-00-00' |
Write SQL query to solve given problem: Among players who were born after 1950, who had offence rebounds rates more than 30%? Please list their last names and first names.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT DISTINCT T1.lastName, T1.firstName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthDate > 1950 AND CAST(T2.o_rebounds AS REAL) * 100 / T2.rebounds > 30 |
Write SQL query to solve given problem: How many players received Rookie of the Year award from 1969 to 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | SELECT COUNT(playerID) FROM awards_players WHERE year BETWEEN 1969 AND 2010 AND award = 'Rookie of the Year' |
Write SQL query to solve given problem: Please list the team names which have at least 3 all-star players.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Write SQL query to solve given problem: From 1950 to 1970, what is the maximum point of players whose teams were ranked 1?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | professional_basketball | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.