SQL-Generation / train-data /test_set.tsv
DeanGumas's picture
Adding test set generation python notebook, and correspond train and test dataset tsv files
99a8882
raw
history blame
36.9 kB
natural_query sql_query result
What is the average number of fg_pct in home games by the Chicago Bulls? SELECT AVG(fg_pct_home) FROM game WHERE team_name_home = 'Chicago Bulls'; 0.4636694306246544
How many lead changes occurred in games where the Denver Nuggets played away? SELECT SUM(lead_changes) as total_lead_changes FROM other_stats WHERE team_abbreviation_away = 'DEN'; 5828.0
Which team had the most away games where they had more offensive than defensive rebounds? SELECT team_abbreviation_away FROM game WHERE oreb_away > dreb_away GROUP BY team_abbreviation_away ORDER BY COUNT(*) DESC LIMIT 1; ATL
What is the maximum number of team rebounds recorded by the Dallas Mavericks in away games where they committed more than 20 fouls? SELECT MAX(o.team_rebounds_away) FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_abbreviation_away = 'DAL' AND g.pf_away > 20 AND g.season_id = '22021'; 16
What was the average margin of victory for the Miami Heat during the 2013 NBA season? SELECT AVG(victory_margin) AS avg_victory_margin FROM ( SELECT plus_minus_home AS victory_margin FROM game WHERE team_name_home = 'Miami Heat' AND wl_home = 'W' AND season_id = '22013' UNION ALL SELECT plus_minus_away AS victory_margin FROM game WHERE team_name_away = 'Miami Heat' AND wl_away = 'W' AND season_id = '22013' ) AS victories 11.48148148
What is the average fast break points scored by the Philadelphia 76ers at home during the 2018 season? SELECT AVG(os.pts_fb_home) AS avg_fast_break FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_abbreviation_home = 'PHI' AND g.season_id = '22018'; 16.32352941
Which team has the nickname 'Celtics'? SELECT full_name FROM team WHERE nickname = 'Celtics'; Boston Celtics
How many games did the Milwaukee Bucks play at home during the 2020 season? SELECT COUNT(*) FROM game WHERE team_name_home = 'Milwaukee Bucks' AND season_id = '22020'; 36
What is the average second-chance points for Toronto Raptors home games between 2015-2020? SELECT AVG(os.pts_2nd_chance_home) AS avg_second_chance FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_abbreviation_home = 'TOR' AND g.season_id BETWEEN '22015' AND '22020'; 13.07653061
Which team had the most fast break points in a single home game during the 2020 season? SELECT team_name_home, MAX(pts_fb_home) FROM other_stats JOIN game ON other_stats.game_id = game.game_id WHERE game.season_id = '22020'; Houston Rockets|35
What's the average points in the paint for the Boston Celtics in home games where they won by at least 10 points? SELECT AVG(os.pts_paint_home) FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_name_home = 'Boston Celtics' AND g.plus_minus_home >= 10; 41.85
What is the highest combined total score (home + away) in a single game in the dataset? SELECT game_date, (pts_home + pts_away) AS total_points FROM game ORDER BY total_points DESC LIMIT 1; 2017-02-19 00:00:00|374.0
Which team had the best three-point shooting percentage in home games during the 2020 season? SELECT team_name_home, AVG(fg3_pct_home) AS avg_3pt_pct FROM game WHERE season_id = '22020' GROUP BY team_name_home ORDER BY avg_3pt_pct DESC LIMIT 1; LA Clippers | 0.423777777777778
Which team is located in the state of Indiana? SELECT full_name FROM team WHERE state = 'Indiana'; Indiana Pacers
What was the most blocks recorded by the Orlando Magic in a single home game in the 1999 season? SELECT MAX(blk_home) AS max_blocks FROM game WHERE team_abbreviation_home = 'ORL' AND season_id = '21999'; 10.0
What was the average number of fastbreak points scored by the Houston Rockets in games they won by more than 15 points at home? SELECT AVG(o.pts_fb_home) AS avg_fastbreak_points FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_name_home = 'Houston Rockets' AND g.wl_home = 'W' AND (g.pts_home - g.pts_away) > 15; 13.39790576
How many times did the Los Angeles Clippers lose at home in the 2002 season despite recording more steals and blocks than their opponent? SELECT COUNT(*) FROM game g WHERE g.team_abbreviation_home = 'LAC' AND g.wl_home = 'L' AND g.stl_home > g.stl_away AND g.blk_home > g.blk_away AND g.season_id = '22002'; 4
What is the full name of the team based in Dallas? SELECT full_name FROM team WHERE city = 'Dallas'; Dallas Mavericks
Which team played the most total games (home + away) between 1995 and 2005? SELECT team FROM (SELECT team_abbreviation_home AS team FROM game WHERE season_id BETWEEN '21995' AND '22005' UNION ALL SELECT team_abbreviation_away FROM game WHERE season_id BETWEEN '21995' AND '22005') GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1; WAS
How many games did the Miami Heat lose away in the 1996 season? SELECT COUNT(*) as losses FROM game WHERE team_name_away = 'Miami Heat' AND wl_away = 'L' AND season_id = '21996'; 9.0
What is the average number of tov in away games by the Miami Heat? SELECT AVG(tov_away) FROM game WHERE team_name_away = 'Miami Heat'; 15.235255570117957
"What is the total second chance points by the Miami Heat at home?""" SELECT SUM(pts_2nd_chance_home) as total_2nd_chance FROM other_stats WHERE team_abbreviation_home = 'MIA'; 11670.0
How many home games did the Orlando Magic play in the 2013 season? SELECT COUNT(*) FROM game WHERE team_name_home = 'Orlando Magic' AND season_id = '22013'; 41.0
In which season did the Boston Celtics have the highest average tov at home? SELECT season_id, AVG(tov_home) as avg_stat FROM game WHERE team_name_home = 'Boston Celtics' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 2005.0
In which season did the Chicago Bulls have the highest average ft_pct at home? SELECT season_id, AVG(ft_pct_home) as avg_stat FROM game WHERE team_name_home = 'Chicago Bulls' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 2016.0
How many games did the Cleveland Cavaliers play at home with more than 8 times tied in 1996? SELECT COUNT(*) as games FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_name_home = 'Cleveland Cavaliers' AND os.times_tied > 8 AND g.season_id = '21996'; 5.0
What was the average number of offensive rebounds per game for the Chicago Bulls in the 2019 season? SELECT AVG(oreb) AS avg_offensive_rebounds FROM ( SELECT game_id, oreb_home AS oreb FROM game WHERE team_name_home = 'Chicago Bulls' AND season_id = '22019' UNION ALL SELECT game_id, oreb_away AS oreb FROM game WHERE team_name_away = 'Chicago Bulls' AND season_id = '22019' ); 10.46153846
What was the highest combined steals and blocks total for the Toronto Raptors in any home game during their championship season? SELECT MAX(stl_home + blk_home) AS combined_steals_blocks FROM game WHERE team_name_home = 'Toronto Raptors' AND season_id = '22019'; 24
How many times have the Boston Celtics won an away game by at least 20 points? SELECT COUNT(*) FROM game WHERE team_abbreviation_away = 'BOS' AND wl_away = 'W' AND (pts_away - pts_home) >= 20; 179
How many total turnovers did the Sacramento Kings commit in the 2001 season? SELECT SUM(tov) AS total_turnovers FROM ( SELECT tov_home AS tov FROM game WHERE team_abbreviation_home = 'SAC' AND season_id = '22001' UNION ALL SELECT tov_away AS tov FROM game WHERE team_abbreviation_away = 'SAC' AND season_id = '22001' ); 1128.0
What is the largest margin of victory the Miami Heat have ever had in an away game? SELECT MAX(ABS(pts_away - pts_home)) AS largest_margin FROM game WHERE team_abbreviation_away = 'MIA' AND pts_away > pts_home; 34.0
What was the average margin of victory for the Boston Celtics in home games during the 2000 season? SELECT AVG(pts_home - pts_away) AS avg_victory_margin FROM game WHERE team_name_home = 'Boston Celtics' AND wl_home = 'W' AND season_id = '22000'; 9.75
What are the nicknames of teams based in Florida? SELECT nickname FROM team WHERE state = 'Florida'; Heat, Magic
What was the highest total rebound count by an away team in a game? SELECT team_abbreviation_away, reb_away, game_date FROM game ORDER BY reb_away DESC LIMIT 1; BOS|90.0|1957-10-22 00:00:00
What is the total number of rebounds by the San Antonio Spurs in home games during the 2015 season? SELECT SUM(reb_home) FROM game WHERE team_abbreviation_home = 'SAS' AND season_id = '22015'; 1845.0
Which away team scored the most points off turnovers in a single game? SELECT team_abbreviation_away FROM other_stats ORDER BY pts_off_to_away DESC LIMIT 1; ATL
What is the highest fast break points by the Houston Rockets at home? SELECT MAX(pts_fb_home) as max_fb_points FROM other_stats WHERE team_abbreviation_home = 'HOU'; 37.0
What is the average number of tov in home games by the Miami Heat? SELECT AVG(tov_home) FROM game WHERE team_name_home = 'Miami Heat'; 14.627184466019418
What is the total number of points scored by the Los Angeles Clippers in the 2014 season in games where they had more team turnovers but fewer total turnovers than their opponent? SELECT SUM(g.pts_home) FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_abbreviation_home = 'LAC' AND o.team_turnovers_home > o.team_turnovers_away AND o.total_turnovers_home < o.total_turnovers_away AND g.season_id = '22014'; 295.0
Which home team had the most games with a positive plus-minus but still lost? SELECT team_name_home FROM game WHERE wl_home = 'L' AND plus_minus_home > 0 GROUP BY team_name_home ORDER BY COUNT(*) DESC LIMIT 1; West NBA All Stars West
In which season did the Miami Heat have the highest average ast at home? SELECT season_id, AVG(ast_home) as avg_stat FROM game WHERE team_name_home = 'Miami Heat' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 2019.0
How many games did the Chicago Bulls win at home in the 2010 season? SELECT COUNT(*) FROM game WHERE team_abbreviation_home = 'CHI' AND wl_home = 'W' AND season_id = '22010'; 36
What was the average points scored by the Denver Nuggets in home games during the 2019 season? SELECT AVG(pts_home) AS avg_home_points FROM game WHERE team_name_home = 'Denver Nuggets' AND season_id = '22019'; 111.8378378
When was the Los Angeles Clippers team founded according to the team database? SELECT year_founded FROM team WHERE full_name = 'Los Angeles Clippers'; 1970
What is the average number of ast in home games by the Boston Celtics? SELECT AVG(ast_home) FROM game WHERE team_name_home = 'Boston Celtics'; 24.886892177589857
What is the average number of ast in away games by the Los Angeles Lakers? SELECT AVG(ast_away) FROM game WHERE team_name_away = 'Los Angeles Lakers'; 22.594638949671772
What team had the most turnovers in a single game during the 2019 season? SELECT CASE WHEN tov_home > tov_away THEN team_name_home ELSE team_name_away END AS team_with_most_turnovers FROM game WHERE season_id = '22019' ORDER BY CASE WHEN tov_home > tov_away THEN tov_home ELSE tov_away END DESC LIMIT 1 Sacramento Kings
What is the highest points scored by the Miami Heat at home when they had more than 10 second chance points? SELECT MAX(g.pts_home) as max_points FROM game g JOIN other_stats os ON g.game_id = os.game_id WHERE g.team_name_home = 'Miami Heat' AND os.pts_2nd_chance_home > 10; 149.0
What is the total points in the paint by the Chicago Bulls at home in games they lost in 1996? SELECT SUM(os.pts_paint_home) as total_pts_paint FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_name_home = 'Chicago Bulls' AND g.wl_home = 'L' AND g.season_id = '21996'; 56.0
How many games did the Oklahoma City Thunder score more than 30 points in the first quarter during the 2017 season? SELECT COUNT(*) AS high_scoring_first_quarters FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE (g.team_name_home = 'Oklahoma City Thunder' AND g.pts_home / 4 > 30) OR (g.team_name_away = 'Oklahoma City Thunder' AND g.pts_away / 4 > 30) AND g.season_id = '22017'; 83
What is the total number of points scored by the Milwaukee Bucks away when they had more than 5 lead changes? SELECT SUM(g.pts_away) as total_points FROM game g JOIN other_stats os ON g.game_id = os.game_id WHERE g.team_name_away = 'Milwaukee Bucks' AND os.lead_changes > 5; 44835.0
List all games where the Houston Rockets and Dallas Mavericks played each other in the 2015 season. SELECT * FROM game WHERE season_id = '22015' AND ((team_abbreviation_home = 'HOU' AND team_abbreviation_away = 'DAL') OR (team_abbreviation_home = 'DAL' AND team_abbreviation_away = 'HOU')); 22015|1610612745|HOU|Houston Rockets|0021500140|2015-11-14 00:00:00|HOU vs. DAL|L|240|32.0|84.0|0.381|9.0|34.0|0.265|25.0|32.0|0.781|12.0|31.0|43.0|22.0|9.0|5.0|14.0|23.0|98.0|-12|1|1610612742|DAL|Dallas Mavericks|DAL @ HOU|W|43.0|89.0|0.483|8.0|28.0|0.286|16.0|21.0|0.762|8.0|37.0|45.0|24.0|6.0|7.0|11.0|21.0|110.0|12|1|Regular Season 22015|1610612742|DAL|Dallas Mavericks|0021500287|2015-12-04 00:00:00|DAL vs. HOU|L|240|37.0|81.0|0.457|8.0|29.0|0.276|14.0|20.0|0.7|11.0|31.0|42.0|23.0|8.0|5.0|18.0|17.0|96.0|-4|1|1610612745|HOU|Houston Rockets|HOU @ DAL|W|39.0|84.0|0.464|12.0|26.0|0.462|10.0|18.0|0.556|15.0|30.0|45.0|20.0|12.0|5.0|18.0|22.0|100.0|4|1|Regular Season 22015|1610612745|HOU|Houston Rockets|0021500665|2016-01-24 00:00:00|HOU vs. DAL|W|240|43.0|89.0|0.483|15.0|44.0|0.341|14.0|21.0|0.667|9.0|31.0|40.0|27.0|9.0|7.0|9.0|21.0|115.0|11|1|1610612742|DAL|Dallas Mavericks|DAL @ HOU|L|36.0|79.0|0.456|15.0|30.0|0.5|17.0|22.0|0.773|8.0|28.0|36.0|17.0|4.0|4.0|16.0|20.0|104.0|-11|1|Regular Season 22015|1610612742|DAL|Dallas Mavericks|0021501170|2016-04-06 00:00:00|DAL vs. HOU|W|240|33.0|80.0|0.413|10.0|33.0|0.303|12.0|14.0|0.857|13.0|27.0|40.0|19.0|9.0|4.0|14.0|20.0|88.0|2|1|1610612745|HOU|Houston Rockets|HOU @ DAL|L|34.0|78.0|0.436|6.0|20.0|0.3|12.0|18.0|0.667|12.0|29.0|41.0|19.0|6.0|4.0|16.0|17.0|86.0|-2|1|Regular Season
What is the highest combined reb in any game involving the San Antonio Spurs? SELECT MAX(reb_home + reb_away) FROM game WHERE team_name_home = 'San Antonio Spurs' OR team_name_away = 'San Antonio Spurs'; 134.0
In which season did the Chicago Bulls have the highest average ast at home? SELECT season_id, AVG(ast_home) as avg_stat FROM game WHERE team_name_home = 'Chicago Bulls' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 2021.0
What is the lowest plus-minus score for the New York Knicks away? SELECT MIN(plus_minus_away) as min_plus_minus FROM game WHERE team_name_away = 'New York Knicks'; -47.0
How many total points did the Chicago Bulls score across all games in the 1988 season? SELECT SUM(pts) AS total_points FROM ( SELECT pts_home AS pts FROM game WHERE team_abbreviation_home = 'CHI' AND season_id = '21988' UNION ALL SELECT pts_away AS pts FROM game WHERE team_abbreviation_away = 'CHI' AND season_id = '21988' ); 8726.0
What is the total number of fast break points scored by the Memphis Grizzlies at home during the 2005 season? SELECT SUM(pts_fb_home) FROM other_stats WHERE game_id IN ( SELECT game_id FROM game WHERE team_name_home = 'Memphis Grizzlies' AND season_id = '22005' ); 368
What was the average points difference in home games won by the Denver Nuggets? SELECT AVG(pts_home - pts_away) FROM game WHERE team_abbreviation_home = 'DEN' AND wl_home = 'W'; 11.96471532
How many times did the Memphis Grizzlies lose at home in the 2008 season despite recording more steals and blocks than their opponent? SELECT COUNT(*) FROM game g WHERE g.team_abbreviation_home = 'MEM' AND g.wl_home = 'L' AND g.stl_home > g.stl_away AND g.blk_home > g.blk_away AND g.season_id = '22008'; 3
In which season did the Boston Celtics have the highest average reb at home? SELECT season_id, AVG(reb_home) as avg_stat FROM game WHERE team_name_home = 'Boston Celtics' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 1958.0
In the 2020 season, what was the average number of second chance points allowed by the New Orleans Pelicans in games they won by less than 5 points? SELECT AVG(o.pts_2nd_chance_away) FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE ((g.team_abbreviation_home = 'NOP' AND g.wl_home = 'W' AND ABS(g.pts_home - g.pts_away) < 5) OR (g.team_abbreviation_away = 'NOP' AND g.wl_away = 'W' AND ABS(g.pts_home - g.pts_away) < 5)) AND g.season_id = '22020'; 16.6
How many games did the Golden State Warriors lose away in 1996? SELECT COUNT(*) as away_losses FROM game WHERE team_name_away = 'Golden State Warriors' AND wl_away = 'L' AND season_id = '21996'; 29.0
Which team was most often held under 60 points in a game? SELECT team FROM (SELECT team_abbreviation_home AS team, pts_home AS pts FROM game UNION ALL SELECT team_abbreviation_away, pts_away FROM game) WHERE pts < 60 GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1; BOS
What is the average number of three-pointers made by the Golden State Warriors at home in the 2018 season? SELECT AVG(fg3m_home) FROM game WHERE team_abbreviation_home = 'GSW' AND season_id = '22018'; 13.1951219512195
What is the Los Angeles Lakers' largest lead in a home game during the 2016 season? SELECT MAX(plus_minus_home) FROM game WHERE team_abbreviation_home = 'LAL' AND season_id = '22016'; 27
What is the average number of points in the paint allowed by the Philadelphia 76ers when playing at home in the 2020 season in games with more than 15 lead changes? SELECT AVG(o.pts_paint_away) FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_abbreviation_home = 'PHI' AND g.season_id = '22020' AND o.lead_changes > 15; 50.0
How many points did the home team score in the game with the most lead changes and the fewest total fouls? SELECT pts_home FROM game WHERE game_id = (SELECT game_id FROM other_stats JOIN game USING(game_id) ORDER BY lead_changes DESC, (pf_home + pf_away) ASC LIMIT 1); 122.0
How many games did the Cleveland Cavaliers lose away with more than 10 fast break points in 1996? SELECT COUNT(*) as losses FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_name_away = 'Cleveland Cavaliers' AND g.wl_away = 'L' AND os.pts_fb_away > 10 AND g.season_id = '21996'; 4.0
What is the highest combined ast in any game involving the Orlando Magic? SELECT MAX(ast_home + ast_away) FROM game WHERE team_name_home = 'Orlando Magic' OR team_name_away = 'Orlando Magic'; 74.0
What is the average points in the paint by the Utah Jazz away when they won? SELECT AVG(os.pts_paint_away) as avg_pts_paint FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_name_away = 'Utah Jazz' AND g.wl_away = 'W'; 42.48
How many games did the Los Angeles Lakers play away in 1996? SELECT COUNT(*) as away_games FROM game WHERE team_name_away = 'Los Angeles Lakers' AND season_id = '21996'; 41.0
How many games had at least one team with 30+ assists? SELECT COUNT(*) FROM game WHERE ast_home >= 30 OR ast_away >= 30; 11305
What is the highest three-point percentage the Phoenix Suns achieved in an away game? SELECT MAX(fg3_pct_away) FROM game WHERE team_abbreviation_away = 'PHX'; 1
How many away games did the Miami Heat play in the 2021 season? SELECT COUNT(*) FROM game WHERE team_name_away = 'Miami Heat' AND season_id = '22021'; 41.0
How many times did the Boston Celtics win at home during the 2015 season? SELECT COUNT(*) FROM game WHERE team_abbreviation_home = 'BOS' AND season_id = '22015' AND wl_home = 'W'; 28
How many free throws did the Houston Rockets attempt in away games they won during the 2020 season? SELECT SUM(fta_away) FROM game WHERE team_name_away = 'Houston Rockets' AND wl_away = 'W' AND season_id = '22020'; 149.0
Which away team has scored the most points against the Miami Heat in a single game? SELECT team_name_away, pts_away FROM game WHERE team_abbreviation_home = 'MIA' ORDER BY pts_away DESC LIMIT 1; Milwaukee Bucks|144.0
How many points were scored in the earliest recorded game in the database? SELECT (pts_home + pts_away) FROM game ORDER BY game_date ASC LIMIT 1; 134.0
What is the average number of tov in away games by the Los Angeles Lakers? SELECT AVG(tov_away) FROM game WHERE team_name_away = 'Los Angeles Lakers'; 14.554896142433234
What is the total number of rebounds by the Milwaukee Bucks at home? SELECT SUM(reb_home) as total_rebounds FROM game WHERE team_name_home = 'Milwaukee Bucks'; 76050.0
What is the highest number of assists recorded by the Indiana Pacers in a single home game? SELECT MAX(ast_home) FROM game WHERE team_name_home = 'Indiana Pacers'; 44.0
How many times did the Miami Heat score more than 120 points at home in the 2015 season? SELECT COUNT(*) FROM game WHERE team_abbreviation_home = 'MIA' AND season_id = '22015' AND pts_home > 120; 3
What was the lowest number of combined turnovers in any game involving the San Antonio Spurs during the 2019 season? SELECT MIN(o.total_turnovers_home + o.total_turnovers_away) AS min_combined_turnovers FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE (g.team_name_home = 'San Antonio Spurs' OR g.team_name_away = 'San Antonio Spurs') AND g.season_id = '22019'; 13
What was the average number of fastbreak points scored by the Los Angeles Lakers in home wins during the 2020 season? SELECT AVG(o.pts_fb_home) AS avg_fastbreak_points FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_name_home = 'Los Angeles Lakers' AND g.wl_home = 'W' AND g.season_id = '22020'; 13.64705882
What was the highest number of steals by the Detroit Pistons in a single game during the 2004 season? SELECT MAX(stl) AS max_steals FROM ( SELECT stl_home AS stl FROM game WHERE team_abbreviation_home = 'DET' AND season_id = '22004' UNION ALL SELECT stl_away AS stl FROM game WHERE team_abbreviation_away = 'DET' AND season_id = '22004' ); 13
In 2018, which team has the most home wins and how many home wins did they have? SELECT team_abbreviation_home, COUNT(*) FROM game WHERE wl_home = 'W' AND season_id = '22018' GROUP BY team_abbreviation_home ORDER BY COUNT(*) DESC LIMIT 1; (DEN, 34)
How many three-pointers did the Golden State Warriors attempt in total during the 2017 season? SELECT SUM(fg3a) AS total_three_attempts FROM ( SELECT fg3a_home AS fg3a FROM game WHERE team_abbreviation_home = 'GSW' AND season_id = '22017' UNION ALL SELECT fg3a_away AS fg3a FROM game WHERE team_abbreviation_away = 'GSW' AND season_id = '22017' ); 2369.0
What is the highest number of three-pointers made in a single game by the Houston Rockets at home? SELECT MAX(fg3m_home) FROM game WHERE team_name_home = 'Houston Rockets'; 27.0
How many games did the Boston Celtics win on the road during the 2018 season? SELECT COUNT(*) AS away_wins FROM game WHERE team_name_away = 'Boston Celtics' AND wl_away = 'W' AND season_id = '22018'; 21
What is the most three-pointers the Brooklyn Nets have ever made in a home game? SELECT MAX(fg3m_home) FROM game WHERE team_name_home = 'Brooklyn Nets'; 22.0
How many total offensive rebounds did the Houston Rockets have in away games during the 2018 season? SELECT SUM(oreb_away) FROM game WHERE team_name_away = 'Houston Rockets' AND season_id = '22018'; 419.0
What is the average number of pts in away games by the Miami Heat? SELECT AVG(pts_away) FROM game WHERE team_name_away = 'Miami Heat'; 96.7824377457405
What is the state of the team nicknamed 'Jazz'? SELECT state FROM team WHERE nickname = 'Jazz'; Utah
How many points did the Phoenix Suns score in the highest scoring away game they played? SELECT MAX(pts_away) FROM game WHERE team_abbreviation_away = 'PHX'; 161.0
In which season did the Charlotte Hornets have the highest average reb at home? SELECT season_id, AVG(reb_home) as avg_stat FROM game WHERE team_name_home = 'Charlotte Hornets' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 2017.0
Which team had the worst average point differential in the 2007 season? SELECT team_abbreviation, AVG(point_diff) AS avg_point_differential FROM ( SELECT team_abbreviation_home AS team_abbreviation, (pts_home - pts_away) AS point_diff FROM game WHERE season_id = '22007' UNION ALL SELECT team_abbreviation_away, (pts_away - pts_home) FROM game WHERE season_id = '22007' ) GROUP BY team_abbreviation ORDER BY avg_point_differential ASC LIMIT 1; SEA|-8.75609756097561
In which season did the Milwaukee Bucks have the highest average fg_pct at home? SELECT season_id, AVG(fg_pct_home) as avg_stat FROM game WHERE team_name_home = 'Milwaukee Bucks' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 42017.0
In games where the Brooklyn Nets scored more than 50 points in the paint at home, what was their assist-to-field goal made ratio? SELECT SUM(g.ast_home) * 1.0 / SUM(g.fgm_home) AS assist_to_fgm_ratio FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_name_home = 'Brooklyn Nets' AND o.pts_paint_home > 50; 0.588761175
How many away games did the Chicago Bulls play in the 2020 season? SELECT COUNT(*) FROM game WHERE team_name_away = 'Chicago Bulls' AND season_id = '22020'; 36.0
What is the average scoring ouput for home teams. Round to 2 decimal places. SELECT ROUND(AVG(pts_home),2) AS avg_home_points FROM game WHERE season_type = 'Regular Season'; 104.76
In which season did the Golden State Warriors have the highest average reb at home? SELECT season_id, AVG(reb_home) as avg_stat FROM game WHERE team_name_home = 'Golden State Warriors' GROUP BY season_id ORDER BY avg_stat DESC LIMIT 1; 1974.0
Which team founded in the 70s has a nickname starting with 'C'? SELECT full_name FROM team WHERE year_founded BETWEEN 1970 AND 1979 AND nickname LIKE 'C%'; Cleveland Cavaliers, Los Angeles Clippers
What is the highest combined ft_pct in any game involving the Los Angeles Lakers? SELECT MAX(ft_pct_home + ft_pct_away) FROM game WHERE team_name_home = 'Los Angeles Lakers' OR team_name_away = 'Los Angeles Lakers'; 1.957
How many fastbreak points did the Los Angeles Clippers average in home games during the 2020 season? SELECT AVG(o.pts_fb_home) AS avg_fastbreak_points FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_name_home = 'LA Clippers' AND g.season_id = '22020'; 11.5
What is the average number of three-pointers made by away teams in games where they had more turnovers than assists? SELECT AVG(fg3m_away) FROM game WHERE tov_away > ast_away; 4.511052937754508
What was the difference in average free throw attempts between the Brooklyn Nets and their opponents in home games during the 2020 season? SELECT AVG(fta_home - fta_away) AS fta_diff FROM game WHERE team_name_home = 'Brooklyn Nets' AND season_id = '22020'; 1.083333333
What is the total points scored by the Philadelphia Warriors away? SELECT SUM(pts_away) as total_points FROM game WHERE team_name_away = 'Philadelphia 76ers'; 251917.0
When was the last time the New York Knicks won a home game? SELECT game_date FROM game WHERE team_abbreviation_home = 'NYK' AND wl_home = 'W' ORDER BY game_date DESC LIMIT 1; 2023-05-10 00:00:00
What was the lowest-scoring game involving the Indiana Pacers in the 1994 season? SELECT MIN(total_points) AS lowest_scoring_game FROM ( SELECT (pts_home + pts_away) AS total_points FROM game WHERE season_id = '21994' AND (team_abbreviation_home = 'IND' OR team_abbreviation_away = 'IND') ); 155.0
How many games did the Sacramento Kings lose at home in 1996? SELECT COUNT(*) as home_losses FROM game WHERE team_name_home = 'Sacramento Kings' AND wl_home = 'L' AND season_id = '21996'; 19.0
What was the total score of the only game in which the home team made exactly 33 field goals? SELECT pts_home + pts_away FROM game WHERE fgm_home = 33 LIMIT 1; 144.0
What was the difference in second-chance points between the Chicago Bulls and their opponents in their closest home game of the 2016 season? SELECT o.pts_2nd_chance_home - o.pts_2nd_chance_away AS second_chance_diff FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_name_home = 'Chicago Bulls' AND g.season_id = '22016' ORDER BY ABS(g.pts_home - g.pts_away) ASC LIMIT 1; -5
What is the highest plus-minus score for the Indiana Pacers at home? SELECT MAX(plus_minus_home) as max_plus_minus FROM game WHERE team_name_home = 'Indiana Pacers'; 65.0
What is the total number of three-pointers made by the Golden State Warriors at home versus the Cleveland Cavaliers in all seasons combined? SELECT SUM(fg3m_home) AS total_threes FROM game WHERE team_name_home = 'Golden State Warriors' AND team_name_away = 'Cleveland Cavaliers'; 407
How many points did the away team score in the only game where the home team had exactly 69 field goal attempts? SELECT pts_away FROM game WHERE fga_home = 69 LIMIT 1; 81.0
What is the average number of ast in away games by the Milwaukee Bucks? SELECT AVG(ast_away) FROM game WHERE team_name_away = 'Milwaukee Bucks'; 22.16927374301676
What is the total number of steals recorded by the Miami Heat in games against the Boston Celtics? SELECT SUM(CASE WHEN team_name_home = 'Miami Heat' THEN stl_home ELSE stl_away END) AS total_steals FROM game WHERE (team_name_home = 'Miami Heat' AND team_name_away = 'Boston Celtics') OR (team_name_home = 'Boston Celtics' AND team_name_away = 'Miami Heat'); 1253
Which team had the most games where both teams scored over 110 points? SELECT team FROM (SELECT team_abbreviation_home AS team FROM game WHERE pts_home > 110 AND pts_away > 110 UNION ALL SELECT team_abbreviation_away FROM game WHERE pts_home > 110 AND pts_away > 110) GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1; LAL
What is the highest number of points the Los Angeles Lakers have scored in a single away game? SELECT MAX(pts_away) FROM game WHERE team_abbreviation_away = 'LAL'; 153.0
What is the total second chance points by the Washington Wizards away? SELECT SUM(pts_2nd_chance_away) as total_2nd_chance FROM other_stats WHERE team_abbreviation_away = 'WAS'; 13226.0
What is the average number of assists per game for the Golden State Warriors when they won during the 2018 season? SELECT AVG(assists) AS avg_assists FROM ( SELECT ast_home AS assists FROM game WHERE team_name_home = 'Golden State Warriors' AND wl_home = 'W' AND season_id = '22018' UNION ALL SELECT ast_away AS assists FROM game WHERE team_name_away = 'Golden State Warriors' AND wl_away = 'W' AND season_id = '22018' ) AS winning_games 31
What was the total number of points in the game where both teams had the exact same number of personal fouls? SELECT pts_home + pts_away FROM game WHERE pf_home = pf_away ORDER BY game_date DESC LIMIT 1; 258.0
How many games did the Boston Celtics win at home during the 2020 season? SELECT COUNT(*) FROM game WHERE team_name_home = 'Boston Celtics' AND wl_home = 'W' AND season_id = '22020'; 21
Which team had the highest average free throw percentage at home in the 2016 season? SELECT team_name_home, AVG(ft_pct_home) AS avg_ft_percentage FROM game WHERE season_id = '22016' GROUP BY team_name_home ORDER BY avg_ft_percentage DESC LIMIT 1; Boston Celtics | 0.820975609756098
In the 2001 season, what was the average number of second chance points scored by the opponents when the Atlanta Hawks played at home and lost? SELECT AVG(o.pts_2nd_chance_away) FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.team_abbreviation_home = 'ATL' AND g.wl_home = 'L' AND g.season_id = '22001'; 13.333333333333334
Which team had the highest average points from second chance opportunities in home games they won during the 2016 season? SELECT g.team_name_home, AVG(o.pts_2nd_chance_home) AS avg_second_chance_pts FROM game g JOIN other_stats o ON g.game_id = o.game_id WHERE g.wl_home = 'W' AND g.season_id = '22016' GROUP BY g.team_name_home ORDER BY avg_second_chance_pts DESC LIMIT 1; Los Angeles Lakers | 15.6153846153846
What is the highest number of points the Golden State Warriors have ever scored in a single home game? SELECT MAX(pts_home) FROM game WHERE team_abbreviation_home = 'GSW'; 149.0
What is the average number of ft_pct in home games by the Los Angeles Lakers? SELECT AVG(ft_pct_home) FROM game WHERE team_name_home = 'Los Angeles Lakers'; 0.7450706106870195
How many team turnovers did the New York Knicks have at home? SELECT SUM(team_turnovers_home) as total_team_turnovers FROM other_stats WHERE team_abbreviation_home = 'NYK'; 550.0
How many three-pointers did the Golden State Warriors make in total during the 2016 season? SELECT SUM(fg3m_home + fg3m_away) AS total_three_pointers FROM game WHERE season_id = '22016' AND (team_name_home = 'Golden State Warriors' OR team_name_away = 'Golden State Warriors'); 1719.0
What is the total rebounds by the Miami Heat at home? SELECT SUM(reb_home) as total_rebounds FROM game WHERE team_name_home = 'Miami Heat'; 65199.0
What is the average number of fg_pct in away games by the Los Angeles Lakers? SELECT AVG(fg_pct_away) FROM game WHERE team_name_away = 'Los Angeles Lakers'; 0.4678996728462382
How many points did the home team score in the game with the most second chance points? SELECT pts_home FROM game WHERE game_id = (SELECT game_id FROM other_stats ORDER BY (pts_2nd_chance_home + pts_2nd_chance_away) DESC LIMIT 1); 115.0
What was the total number of points in the only game where the sum of both teams' free throws made was exactly 42? SELECT pts_home + pts_away FROM game WHERE (ftm_home + ftm_away) = 42 LIMIT 1; 156.0
What is the average number of ft_pct in home games by the Charlotte Hornets? SELECT AVG(ft_pct_home) FROM game WHERE team_name_home = 'Charlotte Hornets'; 0.7601475237091683
Which team is based in the city of Chicago? SELECT full_name FROM team WHERE city = 'Chicago'; Chicago Bulls
What is the Chicago Bulls' largest lead in a home game during the 2016 season? SELECT MAX(plus_minus_home) FROM game WHERE team_abbreviation_home = 'CHI' AND season_id = '22016'; 47
Which players scored 50 or more points in a game during the 1990s? SELECT game_id, game_date, CASE WHEN pts_home >= 50 THEN team_name_home ELSE team_name_away END AS team_name, CASE WHEN pts_home >= 50 THEN pts_home ELSE pts_away END AS points FROM game WHERE (pts_home >= 50 OR pts_away >= 50) AND CAST(SUBSTR(season_id, 2) AS INTEGER) BETWEEN 1990 AND 1999 ORDER BY points DESC
How many home games did the Los Angeles Lakers play in the 2022 season? SELECT COUNT(*) FROM game WHERE team_name_home = 'Los Angeles Lakers' AND season_id = '22022'; 41.0
What is the total points in the paint by the Milwaukee Bucks away? SELECT SUM(pts_paint_away) as total_pts_paint FROM other_stats WHERE team_abbreviation_away = 'MIL'; 39056.0
What is the largest margin of victory in a game, whether home or away? SELECT game_date, ABS(pts_home - pts_away) AS margin FROM game ORDER BY margin DESC LIMIT 1; 2021-12-02 00:00:00|73.0
What is the average number of pts in away games by the Portland Trail Blazers? SELECT AVG(pts_away) FROM game WHERE team_name_away = 'Portland Trail Blazers'; 102.6668215613383
What is the highest number of rebounds recorded by a home team in a game during the 2005 season? SELECT MAX(reb_home) FROM game WHERE season_id = '22005'; 65.0
What is the highest combined ast in any game involving the Boston Celtics? SELECT MAX(ast_home + ast_away) FROM game WHERE team_name_home = 'Boston Celtics' OR team_name_away = 'Boston Celtics'; 79.0
How many times were games tied when the Indiana Pacers played away? SELECT SUM(times_tied) as total_times_tied FROM other_stats WHERE team_abbreviation_away = 'IND'; 4910.0
How many points did the away team score when the home team had more than 20 offensive rebounds? SELECT SUM(pts_away) FROM game WHERE game_id IN (SELECT game_id FROM game WHERE oreb_home > 20); 199836.0
What is the highest combined score in a game between the Golden State Warriors and the Cleveland Cavaliers? SELECT MAX(pts_home + pts_away) FROM game WHERE (team_name_home = 'Golden State Warriors' AND team_name_away = 'Cleveland Cavaliers') OR (team_name_home = 'Cleveland Cavaliers' AND team_name_away = 'Golden State Warriors'); 266.0
Which game had the highest total points scored by both teams when the Los Angeles Lakers played at home? SELECT game_id, (pts_home + pts_away) AS total_points FROM game WHERE team_abbreviation_home = 'LAL' ORDER BY total_points DESC LIMIT 1; (0028000933, 294.0)
How many games did the Sacramento Kings lose away with more than 15 fast break points in 1996? SELECT COUNT(*) as losses FROM other_stats os JOIN game g ON os.game_id = g.game_id WHERE g.team_name_away = 'Sacramento Kings' AND g.wl_away = 'L' AND os.pts_fb_away > 15 AND g.season_id = '21996'; 10.0
What is the lowest number of points the Golden State Warriors have scored in an away game? SELECT MIN(pts_away) FROM game WHERE team_abbreviation_away = 'GSW'; 65.0