|
@@ -0,0 +1,332 @@
|
|
|
+{"question": "What is the average age of players in the NBA who are older than 5 years and 5 months", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE AGE * 12 > 5*5;"}
|
|
|
+{"question": "What is the average age of the older players in the NBA", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE AGE > (SELECT AVG(AGE) FROM nba_roster) * 5;"}
|
|
|
+{"question": "Which team has the oldest average age among its players", "sql": "SELECT team, AVG(AGE) AS avg_age FROM nba_roster GROUP BY team ORDER BY avg_age DESC LIMIT 1;"}
|
|
|
+{"question": "What are the names and jersey numbers of the players who are older than 5 years old, listed in order from lowest to highest jersey number", "sql": "SELECT name, Jersey FROM nba_roster WHERE AGE > 5 ORDER BY CAST(SUBSTR(Jersey, 1, INSTR(Jersey,' ') - 1) AS INTEGER) ASC;"}
|
|
|
+{"question": "What is the average age of all players in the NBA who are older than 5 years", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE AGE > 5*12;"}
|
|
|
+{"question": "Which team has the highest average jersey number among all teams in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTR(Jersey, 1, LENGTH(Jersey)-1) AS INTEGER)) as average_jersey FROM nba_roster WHERE Jersey!= 'NA' GROUP BY team ORDER BY average_jersey DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the league", "sql": "SELECT NAME, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) AS Salary FROM nba_roster WHERE SALARY!= '--' ORDER BY Salary DESC LIMIT 5;"}
|
|
|
+{"question": "Which team has the highest average salary among all teams in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the three tallest players in the NBA", "sql": "SELECT NAME, HT FROM nba_roster ORDER BY CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What team has the largest roster in the NBA", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team;"}
|
|
|
+{"question": "Who is the highest-paid player in the league who is not a point guard", "sql": "SELECT NAME FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster WHERE POS!= 'PG');"}
|
|
|
+{"question": "What are the top 3 highest-paid players who did not attend Michigan or Duke University", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE COLLEGE!= '--' AND COLLEGE!= 'Michigan' AND COLLEGE!= 'Duke University' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "Which teams have the most young players in the NBA", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE < 25 GROUP BY team ORDER BY num_players DESC;"}
|
|
|
+{"question": "What are the top 5 highest salaries for players over 30 in the NBA", "sql": "SELECT * FROM nba_roster WHERE SALARY IN (SELECT DISTINCT SALARY FROM nba_roster WHERE age > 30 ORDER BY SALARY DESC LIMIT 5);"}
|
|
|
+{"question": "What is the average salary of NBA players who are 25 years old or younger", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "Who are the top 5 players with the highest jersey numbers in the NBA", "sql": "SELECT NAME, JERSEY FROM nba_roster WHERE JERSEY!= 'NA' ORDER BY CAST(JERSEY AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the number of players in the NBA who are significantly overpaid compared to their peers", "sql": "SELECT COUNT(*) FROM nba_roster WHERE SALARY > CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) * 5 AND COLLEGE!= '--';"}
|
|
|
+{"question": "Who is the heaviest player in the NBA", "sql": "SELECT * FROM nba_roster WHERE WT = (SELECT MAX(WT) FROM nba_roster);"}
|
|
|
+{"question": "Which NBA player has attended the most colleges", "sql": "SELECT name, AVG(CASE WHEN COLLEGE!= '--' THEN 1 ELSE 0 END) as college_avg FROM nba_roster GROUP BY name ORDER BY college_avg DESC LIMIT 1;"}
|
|
|
+{"question": "Which teams have the most players with a Michigan background", "sql": "SELECT team, COUNT(*) FROM nba_roster WHERE COLLEGE='Michigan' GROUP BY team;"}
|
|
|
+{"question": "What is the average age of players who attended college in the NBA", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "Who is the player with the most games played in the NBA", "sql": "SELECT NAME, COUNT(*) as games_played FROM nba_roster GROUP BY NAME ORDER BY games_played DESC LIMIT 1;"}
|
|
|
+{"question": "How many veteran players in the NBA are older than 30 years old", "sql": "SELECT COUNT(*) FROM nba_roster WHERE POS IN ('PG', 'SG', 'SF', 'PF', 'C') AND AGE > 30;"}
|
|
|
+{"question": "What is the average age of the players on each NBA team", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC;"}
|
|
|
+{"question": "Who are the top 3 players from non-Michigan colleges who have jersey numbers similar to the top 3 players from Michigan", "sql": "SELECT NAME FROM nba_roster WHERE COLLEGE!= '--' AND NAME IN (SELECT NAME FROM nba_roster WHERE COLLEGE = 'Michigan' ORDER BY CAST(SUBSTRING(Jersey, 0, INSTR(Jersey,'')-1) AS INTEGER) DESC LIMIT 3);"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the NBA, excluding those with unknown salaries", "sql": "SELECT name, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(SUBSTRING(SALARY, 2) AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average salary of all players in the NBA", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "Who are the 5 tallest centers in the league", "sql": "SELECT name, HT FROM nba_roster WHERE POS = 'C' ORDER BY CAST(SUBSTRING(HT, 0, INSTR(HT,'')) AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "How many players in the NBA are more than 5 years older than the average age of all players", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE - (SELECT AVG(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "Who are the top 3 players with the highest jersey numbers in the league", "sql": "SELECT name, jersey FROM nba_roster ORDER BY CAST(SUBSTRING(jersey, 0, INSTR(jersey,'')-1) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the top 3 tallest players in the NBA", "sql": "SELECT NAME, CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) as height_inches, CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT) as height_feet FROM nba_roster ORDER BY height_inches*12 + height_feet DESC LIMIT 3;"}
|
|
|
+{"question": "Which team has the oldest average age among all teams in the NBA", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "Which five teams in the NBA have the highest average salary", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 5;"}
|
|
|
+{"question": "Which team has the most players aged 25 or older", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster WHERE age >= 25 GROUP BY team ORDER BY num_players DESC;"}
|
|
|
+{"question": "What is the average height of the players in the nba_roster table", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster;"}
|
|
|
+{"question": "Who is the player with the highest average salary in the NBA", "sql": "SELECT name, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY name ORDER BY avg_salary DESC LIMIT 1;"}
|
|
|
+{"question": "How many players on the Los Angeles Lakers are taller than 6'8", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE TEAM = 'Los Angeles Lakers' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) > 68;"}
|
|
|
+{"question": "Who are the three youngest players on the Toronto Raptors", "sql": "SELECT NAME, AGE FROM nba_roster WHERE TEAM='Toronto Raptors' AND AGE < 25 ORDER BY AGE ASC LIMIT 3;"}
|
|
|
+{"question": "What are the teams with the tallest players on average", "sql": "SELECT team, AVG(LENGTH(HT)) AS average_height FROM nba_roster GROUP BY team ORDER BY average_height DESC;"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the NBA with a known salary", "sql": "SELECT name, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(SALARY AS REAL) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average salary of all players who attended the University of Michigan", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE COLLEGE='Michigan';"}
|
|
|
+{"question": "What is the average height of the Toronto Raptors players", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster WHERE team='Toronto Raptors';"}
|
|
|
+{"question": "What is the highest-paid player from the University of Michigan", "sql": "SELECT name, salary FROM nba_roster WHERE college='Michigan' ORDER BY salary DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the youngest average age among all teams in the NBA", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age ASC LIMIT 1;"}
|
|
|
+{"question": "What are the 5 tallest players in the NBA", "sql": "SELECT name, CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) AS height FROM nba_roster ORDER BY height DESC LIMIT 5;"}
|
|
|
+{"question": "What are the average ages of the players on each NBA team", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC;"}
|
|
|
+{"question": "Which team has the tallest players on average", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster GROUP BY team ORDER BY average_height DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the oldest player who earns the highest salary", "sql": "SELECT team, NAME FROM nba_roster WHERE AGE=(SELECT MAX(AGE) FROM nba_roster WHERE SALARY IN (SELECT MAX(SALARY) FROM nba_roster));"}
|
|
|
+{"question": "What are the names of the tallest players on the Chicago Bulls who are 25 years old or younger", "sql": "SELECT NAME FROM nba_roster WHERE team='Chicago Bulls' AND AGE <= 25 ORDER BY CAST(SUBSTRING(HT, INSTR(HT,'')+1) AS INTEGER) DESC;"}
|
|
|
+{"question": "What is the average age of all NBA players", "sql": "SELECT AVG(CAST(AGE AS INTEGER)) AS average_age FROM nba_roster;"}
|
|
|
+{"question": "What is the most common position in the NBA with the highest average age", "sql": "SELECT POS, COUNT(*) as count, ROUND(AVG(AGE), 2) as avg_age FROM nba_roster GROUP BY POS ORDER BY count DESC;"}
|
|
|
+{"question": "Which three NBA teams have the most players with a recorded height", "sql": "SELECT team, COUNT(*) FROM nba_roster WHERE HT!= 'NA' GROUP BY team ORDER BY COUNT(*) DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the top 3 players at each position other than Point Guard", "sql": "SELECT NAME, JERSEY FROM nba_roster WHERE POS!= 'PG' ORDER BY JERSEY LIMIT 3;"}
|
|
|
+{"question": "Who is the highest-paid player who attended college", "sql": "SELECT name, salary FROM nba_roster WHERE COLLEGE!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the average salaries for each position in the NBA, and which position has the highest average salary", "sql": "SELECT POS, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY POS ORDER BY average_salary DESC;"}
|
|
|
+{"question": "How many NBA players attended the University of Michigan", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE COLLEGE = 'Michigan';"}
|
|
|
+{"question": "What is the average salary of NBA players who are older than 5 years old", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) AS avg_salary FROM nba_roster WHERE AGE > 5;"}
|
|
|
+{"question": "Which jersey numbers are worn by the most players in the NBA", "sql": "SELECT Jersey, NAME, COUNT(*) as count FROM nba_roster GROUP BY Jersey ORDER BY count DESC LIMIT 3;"}
|
|
|
+{"question": "What are the most common salaries in the NBA", "sql": "SELECT SALARY, COUNT(*) AS frequency FROM nba_roster WHERE SALARY!= '--' GROUP BY SALARY ORDER BY frequency DESC;"}
|
|
|
+{"question": "How many players in the NBA roster have a valid jersey number", "sql": "SELECT COUNT(*) FROM nba_roster WHERE HT!= 'NA';"}
|
|
|
+{"question": "How many players on the Boston Celtics are 6 feet 8 inches tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Boston Celtics' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER)= '6' AND SUBSTRING(HT, INSTR(HT,'')+1)='8';"}
|
|
|
+{"question": "Which team has the tallest average height among players under the age of 36", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height FROM nba_roster WHERE AGE < 3*12 GROUP BY team ORDER BY height DESC LIMIT 1;"}
|
|
|
+{"question": "What is the highest paid player in the NBA", "sql": "SELECT COLLEGE, COUNT(*) as num_players, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "What is the average height of players who attended the University of Michigan", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster WHERE COLLEGE='Michigan';"}
|
|
|
+{"question": "What are the ages of the players on the Chicago Bulls who have a recorded salary", "sql": "SELECT NAME, AGE FROM nba_roster WHERE AGE > 10 AND SALARY!= '--';"}
|
|
|
+{"question": "What is the distribution of heights among NBA players", "sql": "SELECT HT, COUNT(*) AS count, CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) AS height_feet, CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 AS height_inches FROM nba_roster GROUP BY HT ORDER BY height_feet, height_inches;"}
|
|
|
+{"question": "Which player has the highest jersey number in the NBA", "sql": "SELECT NAME, MAX(Jersey) as highest_jersey FROM nba_roster WHERE Jersey!= 'NA' GROUP BY NAME ORDER BY highest_jersey DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average age and average salary for each position in the NBA, with the oldest and youngest players, as well as the highest and lowest average salaries, by position", "sql": "SELECT pos, AVG(AGE) as avg_age, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY pos ORDER BY avg_age DESC;"}
|
|
|
+{"question": "Which teams have the oldest and youngest rosters in the NBA", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC;"}
|
|
|
+{"question": "What is the range of salaries in the NBA", "sql": "SELECT MIN(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS min_salary, MAX(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS max_salary FROM nba_roster;"}
|
|
|
+{"question": "How many players in the NBA roster are 6'8", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = '6' AND SUBSTRING(HT, INSTR(HT,'')+1) = '8';"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the NBA who are 25 years or older", "sql": "SELECT name, SALARY FROM nba_roster WHERE AGE >= 25 ORDER BY SALARY DESC LIMIT 5;"}
|
|
|
+{"question": "Which team has the most players who are significantly older than the average age of all NBA players", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE - (SELECT AVG(AGE) FROM nba_roster) > 5 GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of players in the NBA who are 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "Which five teams in the NBA have the highest average salary among their players", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 5;"}
|
|
|
+{"question": "How many players on the Boston Celtics have attended a college other than '--'?", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Boston Celtics' AND COLLEGE!='--';"}
|
|
|
+{"question": "Who is the player with the highest jersey number in the NBA", "sql": "SELECT NAME, Jersey FROM nba_roster WHERE Jersey = (SELECT MAX(Jersey) FROM nba_roster);"}
|
|
|
+{"question": "What is the highest salary in the NBA", "sql": "SELECT MAX(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as highest_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "Who is the highest-paid college-educated player on the Toronto Raptors", "sql": "SELECT name, SALARY FROM nba_roster WHERE team='Toronto Raptors' AND COLLEGE!='--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the three highest-paid players in the NBA", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(SUBSTR(SALARY, 2) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What are the top 5 teams with the most players in the NBA", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster GROUP BY team ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "How many players on the Golden State Warriors are at least 6 feet 8 inches tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Golden State Warriors' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) >= 68;"}
|
|
|
+{"question": "Which 5 teams have the tallest average height among their players, excluding those with unknown jersey numbers", "sql": "SELECT team, NAME, Jersey, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height FROM nba_roster WHERE Jersey!= 'NA' GROUP BY team, NAME, Jersey ORDER BY height DESC LIMIT 5;"}
|
|
|
+{"question": "Who are the three tallest players in the league", "sql": "SELECT NAME, HT FROM nba_roster ORDER BY CAST(SUBSTRING(HT, 0, INSTR(HT,'')) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What is the team with the highest average salary for players who attended college", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 3 highest-paid college-educated players in the NBA", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE COLLEGE!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What is the average age of each player in the NBA roster", "sql": "SELECT NAME, AVG(AGE) AS Average_Age FROM nba_roster GROUP BY NAME;"}
|
|
|
+{"question": "What are the top 5 teams in the NBA in terms of average player salary", "sql": "SELECT team, AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY avg_salary DESC;"}
|
|
|
+{"question": "What are the top 3 teams with the highest average salary in the NBA", "sql": "SELECT TEAM, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY TEAM ORDER BY avg_salary DESC LIMIT 3;"}
|
|
|
+{"question": "Who is the oldest player currently playing in the NBA", "sql": "SELECT NAME, AGE FROM nba_roster ORDER BY AGE DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the top 5 players in the NBA with assigned jersey numbers", "sql": "SELECT NAME, JERSEY FROM nba_roster WHERE JERSEY!= 'NA' ORDER BY JERSEY LIMIT 5;"}
|
|
|
+{"question": "How many players on the Chicago Bulls are 25 years old or younger", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Chicago Bulls' AND AGE <= 25;"}
|
|
|
+{"question": "What is the number of players in the NBA who are 6'8", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = 6.8;"}
|
|
|
+{"question": "What is the average salary of all players in the NBA who are 25 years old or younger", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE AGE <= 25 AND SALARY!= '--';"}
|
|
|
+{"question": "Who are the top 5 players in the NBA in terms of their total value, combining their salary and jersey number", "sql": "SELECT name, (CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) + CAST(Jersey AS INTEGER)) as total_value, POS FROM nba_roster WHERE SALARY!= '--' ORDER BY total_value DESC LIMIT 5;"}
|
|
|
+{"question": "Which team has the oldest average age of players", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "What is the range of heights of NBA players", "sql": "SELECT MIN(LENGTH(SUBSTR(HT, 0, INSTR(HT,'')-1))) AS min_height, MAX(LENGTH(SUBSTR(HT, 0, INSTR(HT,'')-1))) AS max_height FROM nba_roster;"}
|
|
|
+{"question": "What are the 5 teams with the highest average weight in the NBA, excluding players with unknown heights", "sql": "SELECT HT, AVG(WT) AS avg_weight FROM nba_roster WHERE HT!= 'NA' GROUP BY HT ORDER BY avg_weight DESC LIMIT 5;"}
|
|
|
+{"question": "What are the top 5 colleges that produce the most players for each position in the NBA", "sql": "SELECT POS, COLLEGE, COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY POS, COLLEGE ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "Who is the oldest player in the NBA who attended college", "sql": "SELECT name, age FROM nba_roster WHERE COLLEGE!= '--' ORDER BY age DESC LIMIT 1;"}
|
|
|
+{"question": "How many players in the NBA are 25 years old or older", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "How many colleges in the NBA have multiple players", "sql": "SELECT COUNT(*) FROM nba_roster WHERE COLLEGE IN (SELECT COLLEGE FROM nba_roster GROUP BY COLLEGE HAVING COUNT(*) > 1);"}
|
|
|
+{"question": "What is the average age of all players in the NBA who are 25 years old or older", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "What team has the largest roster of players 25 years old or younger", "sql": "SELECT team, count(*) FROM nba_roster WHERE AGE <= 25 GROUP BY team ORDER BY count(*) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the team with the highest average salary among players who are within 5 years of the average age of the entire league", "sql": "SELECT TEAM, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE + (SELECT AVG(Age) FROM nba_roster) * 5 <= (SELECT MAX(Age) FROM nba_roster) GROUP BY TEAM ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What is the highest-paid player on the Chicago Bulls", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE team='Chicago Bulls' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Which colleges have the most players in the NBA, and how many of them earn more than $5 million per year", "sql": "SELECT COLLEGE, COUNT(*) AS num_players, SUM(CASE WHEN CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) > 5000000 THEN 1 ELSE 0 END) AS num_players_over_5m FROM nba_roster GROUP BY COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "Who is the highest-paid player with at least 5 years of NBA experience", "sql": "SELECT NAME FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster WHERE (AGE - (SELECT MIN(AGE) FROM nba_roster) + 1) >= 5);"}
|
|
|
+{"question": "How many players in the NBA have a salary greater than $10,000,000 and attended the University of Michigan", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE SALARY > '10000000' AND COLLEGE='Michigan';"}
|
|
|
+{"question": "Which teams have the most players from a particular college", "sql": "SELECT team, COLLEGE, COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team, COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "What colleges did the players in the NBA roster attend, excluding those who attended a college that is not listed", "sql": "SELECT NAME, COLLEGE FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "Who are the 5 oldest players in the NBA with a jersey number", "sql": "SELECT NAME, AGE FROM nba_roster WHERE Jersey!= 'NA' ORDER BY AGE DESC LIMIT 5;"}
|
|
|
+{"question": "How many experienced players in the NBA play one of the five main positions and have a salary", "sql": "SELECT COUNT(*) FROM nba_roster WHERE POS IN ('PG', 'SG', 'SF', 'PF', 'C') AND SALARY!= '--' AND AGE > 25;"}
|
|
|
+{"question": "What teams have the most players from the same college", "sql": "SELECT TEAM, COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE IN (SELECT COLLEGE FROM nba_roster GROUP BY COLLEGE ORDER BY COUNT(*) DESC LIMIT 1) GROUP BY TEAM;"}
|
|
|
+{"question": "What are the top 3 teams with the highest average salaries, excluding centers, in the NBA", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' AND POS!= 'C' GROUP BY team ORDER BY average_salary DESC LIMIT 3;"}
|
|
|
+{"question": "What is the average age of the players in the NBA who are 25 years old or older", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "What is the list of players in the NBA who are 25 years old or older", "sql": "SELECT name, AGE FROM nba_roster WHERE AGE >= 25 ORDER BY AGE;"}
|
|
|
+{"question": "Which teams have the most young players in their roster", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE <= 25 GROUP BY team;"}
|
|
|
+{"question": "Which college has produced the most NBA players, excluding those who have not disclosed their salary", "sql": "SELECT COLLEGE, COUNT(*) FROM nba_roster WHERE SALARY!= '--' GROUP BY COLLEGE ORDER BY COUNT(*) DESC LIMIT 1;"}
|
|
|
+{"question": "What college has produced the most players for the Toronto Raptors", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster WHERE TEAM = 'Toronto Raptors' GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of Power Forward players in the NBA", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) AS height FROM nba_roster WHERE POS='PF';"}
|
|
|
+{"question": "What is the average height of each team in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) AS average_height FROM nba_roster GROUP BY team ORDER BY average_height ASC;"}
|
|
|
+{"question": "What is the average height of all NBA players", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster;"}
|
|
|
+{"question": "What are the names, teams, and salaries of the NBA players who are over 25 years old and earn more than $5,000,000", "sql": "SELECT name, team, SALARY FROM nba_roster WHERE AGE > 25 AND SALARY!= '--' AND CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) > 5000000;"}
|
|
|
+{"question": "Who is the highest-paid player under the age of 24 on a non-rookie contract", "sql": "SELECT name, team, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) AS salary FROM nba_roster WHERE POS!= '--' AND AGE < 25 AND SALARY!= '--' ORDER BY salary DESC LIMIT 1;"}
|
|
|
+{"question": "What age group has the most diverse range of players in the NBA", "sql": "SELECT COUNT(DISTINCT AGE) AS count, AGE FROM nba_roster GROUP BY AGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What colleges have produced multiple NBA players", "sql": "SELECT name FROM nba_roster WHERE COLLEGE IN (SELECT COLLEGE FROM nba_roster WHERE NAME LIKE '%LeBron%');"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the NBA, excluding the Chicago Bulls", "sql": "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC) as row_num FROM nba_roster WHERE SALARY!= '--') as temp WHERE row_num <= 5 AND team!= 'Chicago Bulls';"}
|
|
|
+{"question": "What is the average height of all players in the NBA who are 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) as INTEGER)) FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "What is the age range of the majority of players in the NBA", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE + 10 <= (SELECT MAX(Age) FROM nba_roster);"}
|
|
|
+{"question": "Which three teams have the oldest average age of players in the NBA", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC LIMIT 3;"}
|
|
|
+{"question": "What is the team with the highest average salary", "sql": "SELECT team, AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What are the teams with the youngest and oldest rosters in the NBA", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age ASC;"}
|
|
|
+{"question": "Which three teams have the highest paid players in the NBA", "sql": "SELECT * FROM nba_roster WHERE SALARY IN (SELECT MAX(SALARY) FROM nba_roster GROUP BY TEAM ORDER BY MAX(SALARY) LIMIT 3);"}
|
|
|
+{"question": "Which three teams in the NBA have the highest average salary for players who attended college", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 3;"}
|
|
|
+{"question": "What is the height of the tallest player on each team in the NBA", "sql": "SELECT team, (SELECT MAX(HT) FROM nba_roster WHERE team = nba_roster.team) AS tallest_player FROM nba_roster GROUP BY team;"}
|
|
|
+{"question": "What college has the most players in the NBA", "sql": "SELECT COLLEGE, COUNT(*) AS count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Which NBA team has the most players who are at least 6 feet 7 inches tall", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 >= 6.67 GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "Which teams have the smallest rosters in the NBA", "sql": "SELECT team, COUNT(*) as num_players, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY num_players ASC;"}
|
|
|
+{"question": "How many players on the Toronto Raptors are more than 5 years older than the average age of the team", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Toronto Raptors' AND (AGE - (SELECT AVG(AGE) FROM nba_roster WHERE team='Toronto Raptors')) > 5;"}
|
|
|
+{"question": "How many players in the NBA have attended Duke, Kentucky, or North Carolina and play as a Forward", "sql": "SELECT COUNT(*) FROM nba_roster WHERE COLLEGE IN ('--', 'Duke', 'Kentucky', 'North Carolina') AND POS LIKE '%F';"}
|
|
|
+{"question": "What is the average salary of NBA players 25 years old or older", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,'$')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE age >= 25;"}
|
|
|
+{"question": "What is the average age of all NBA players who are older than 5 years old", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE AGE > 5*12;"}
|
|
|
+{"question": "Which team has the highest average salary in the NBA, excluding teams with unknown salaries", "sql": "SELECT Team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY Team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What position has the largest number of players in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE POS!= 'NA' GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Which teams have the youngest players in the NBA", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age ASC;"}
|
|
|
+{"question": "Who is the highest-paid player on the team with the largest roster", "sql": "SELECT NAME FROM nba_roster WHERE team=(SELECT team FROM nba_roster GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1) AND SALARY=(SELECT MAX(SALARY) FROM nba_roster WHERE team=(SELECT team FROM nba_roster GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1));"}
|
|
|
+{"question": "Which three teams have the most players who attended college", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "Who is the oldest player in the NBA with a known salary", "sql": "SELECT name, age FROM nba_roster WHERE age > 5 AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the oldest average age among all NBA teams", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the league, excluding those with unknown salaries", "sql": "SELECT name, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "Which NBA teams have the most players under the age of 25", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE <= 25 GROUP BY team ORDER BY num_players DESC;"}
|
|
|
+{"question": "What is the 75th percentile salary of NBA players who are 25 years or older", "sql": "SELECT CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER) as percentile FROM nba_roster WHERE AGE >= 25 ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE AGE >= 25)*75/100-1;"}
|
|
|
+{"question": "What is the team with the most players under the age of 25", "sql": "SELECT Team, COUNT(*) as num_players FROM nba_roster WHERE AGE <= 25 GROUP BY Team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What is the number of players in the NBA who are 5 years or younger than the oldest player in the league", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE + 5 <= (SELECT MAX(Age) FROM nba_roster);"}
|
|
|
+{"question": "Who are the top 3 highest-paid players in the NBA roster", "sql": "SELECT NAME, SALARY FROM nba_roster ORDER BY CAST(SALARY AS REAL) DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the 5 players with the highest jersey numbers in the league", "sql": "SELECT name, jersey FROM nba_roster ORDER BY CAST(SUBSTRING(jersey, 0, INSTR(jersey,'')-1) AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average height of NBA players who are 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height FROM nba_roster WHERE CAST(AGE AS INTEGER) <= 25;"}
|
|
|
+{"question": "What is the team with the most players in the NBA", "sql": "SELECT COUNT(*) as num_players, TEAM FROM nba_roster GROUP BY TEAM ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the heaviest average weight", "sql": "SELECT team, AVG(CAST(SUBSTR(WT, 1, INSTR(WT,' ')-1) AS INTEGER) + CAST(SUBSTR(WT, INSTR(WT,' ')+1) AS FLOAT)/16) as average_weight FROM nba_roster WHERE WT!= 'NA' GROUP BY team ORDER BY average_weight DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the shortest player on the Golden State Warriors", "sql": "SELECT name, HT FROM nba_roster WHERE team='Golden State Warriors' ORDER BY CAST(SUBSTRING(HT, INSTR(HT,'')+1) AS INTEGER) ASC LIMIT 1;"}
|
|
|
+{"question": "What are the average salaries for each NBA team, excluding teams with unknown salaries", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC;"}
|
|
|
+{"question": "What is the average salary for players in the NBA who are 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "Which team has the most players who attended college", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What is the tallest team in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) + CAST(SUBSTRING(HT, INSTR(HT,'')+1) AS INTEGER) / 12.0) AS average_height FROM nba_roster GROUP BY team ORDER BY average_height DESC LIMIT 1;"}
|
|
|
+{"question": "Which college has produced the fewest number of NBA players", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster GROUP BY COLLEGE ORDER BY count ASC LIMIT 1;"}
|
|
|
+{"question": "Which teams have the youngest rosters in the NBA", "sql": "SELECT team, AVG(age) as avg_age FROM nba_roster GROUP BY team ORDER BY avg_age ASC;"}
|
|
|
+{"question": "What are the top 3 players from colleges that have at least 3 players in the NBA", "sql": "SELECT college, name, salary FROM nba_roster WHERE college IN (SELECT college FROM nba_roster GROUP BY college HAVING COUNT(*) >= 3) ORDER BY salary DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the top 3 highest-paid players in the league, excluding those who have not disclosed their salaries", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(SUBSTR(SALARY, 2) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What is the most common position on the Boston Celtics", "sql": "SELECT POS, COUNT(*) AS COUNT FROM nba_roster WHERE team='Boston Celtics' GROUP BY POS ORDER BY COUNT DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 3 highest-paid young players on the Toronto Raptors", "sql": "SELECT name, SALARY FROM nba_roster WHERE team='Toronto Raptors' AND CAST(AGE AS INTEGER) < 25 ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What is the average salary in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster GROUP BY POS ORDER BY count DESC;"}
|
|
|
+{"question": "What is the average weight in the NBA", "sql": "SELECT NAME, COLLEGE FROM nba_roster GROUP BY COLLEGE ORDER BY COUNT(COLLEGE) DESC LIMIT 3;"}
|
|
|
+{"question": "Which NBA team has the most players over the age of 30", "sql": "SELECT TEAM, COUNT(*) as num_players FROM nba_roster WHERE AGE > 30 GROUP BY TEAM ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the top 3 players with the highest total value, considering both their salary and jersey number", "sql": "SELECT NAME, (CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) + CAST(Jersey AS INTEGER)) AS total_value FROM nba_roster WHERE SALARY!= '--' AND Jersey!= 'NA' ORDER BY total_value DESC LIMIT 3;"}
|
|
|
+{"question": "What is the average age of players in the NBA who have 5 years of experience or less", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE AGE * 12 * 5 <= (SELECT SUM(AGE * 12) FROM nba_roster);"}
|
|
|
+{"question": "Which five teams have the most players who are 25 years old", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE = 25 GROUP BY team ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average height of power forwards in the NBA", "sql": "SELECT POS, AVG(CAST(SUBSTR(HT, 0, INSTR(HT,'')-1) AS INTEGER)) AS avg_height FROM nba_roster WHERE HT!= 'NA' GROUP BY POS;"}
|
|
|
+{"question": "Which positions have the most players on the same team", "sql": "SELECT COUNT(*) as total_players, pos FROM nba_roster GROUP BY pos HAVING COUNT(*) > 1 ORDER BY total_players DESC;"}
|
|
|
+{"question": "Which three teams in the NBA have the oldest average age among their players", "sql": "SELECT Team, AVG(AGE) as average_age FROM nba_roster GROUP BY Team ORDER BY average_age DESC LIMIT 3;"}
|
|
|
+{"question": "What college has produced the oldest average age of players in the NBA", "sql": "SELECT college, AVG(age) AS average_age FROM nba_roster WHERE college!= '--' GROUP BY college ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "Which five teams have the oldest average age among their players", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC LIMIT 5;"}
|
|
|
+{"question": "Who is the highest-paid non-point guard on the Los Angeles Lakers", "sql": "SELECT NAME, JERSEY FROM nba_roster WHERE TEAM='Los Angeles Lakers' AND POS!= 'PG' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "How many players on the Toronto Raptors are 6 feet 8 inches or taller", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Toronto Raptors' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = '6' || '8';"}
|
|
|
+{"question": "What is the average age of players in the NBA who are older than 5 times the average age of all players", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster WHERE AGE > (SELECT AVG(AGE) FROM nba_roster) * 5;"}
|
|
|
+{"question": "Which NBA teams have the most players over the age of 25", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster WHERE AGE > 25 GROUP BY team ORDER BY num_players DESC;"}
|
|
|
+{"question": "Which colleges have produced the most players in the NBA", "sql": "SELECT COLLEGE, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "What are the average ages of players by position, with the oldest positions listed first", "sql": "SELECT POS, AVG(AGE) as average_age FROM nba_roster GROUP BY POS ORDER BY average_age DESC;"}
|
|
|
+{"question": "What is the average age of players in the NBA who are taller than 6 feet 7 inches", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 > 6.67;"}
|
|
|
+{"question": "What are the top 5 players in the league by average age, considering only those who are taller than 6'7", "sql": "SELECT NAME, AVG(AGE) AS avg_age FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 > 6.67 GROUP BY NAME ORDER BY avg_age DESC LIMIT 5;"}
|
|
|
+{"question": "How many players in the NBA are older than five times the average age of all players", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE > (SELECT AVG(AGE) FROM nba_roster) * 5;"}
|
|
|
+{"question": "Which teams have multiple players who attended the same college", "sql": "SELECT team, COUNT(*) as num_players, COLLEGE FROM nba_roster GROUP BY team, COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "What is the highest-paid player on the team with the smallest roster", "sql": "SELECT * FROM nba_roster WHERE TEAM = (SELECT TEAM FROM nba_roster GROUP BY TEAM ORDER BY COUNT(*) ASC LIMIT 1) ORDER BY SALARY DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of players on each team, excluding teams with players who have a height listed as 'NA'", "sql": "SELECT team, AVG(CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER)) AS avg_height FROM nba_roster WHERE HT!= 'NA' GROUP BY team ORDER BY avg_height DESC;"}
|
|
|
+{"question": "What is the most common position in the NBA with the most players", "sql": "SELECT POS, COUNT(*) AS count FROM nba_roster WHERE POS!= 'NA' GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the jersey number with the most players in the NBA", "sql": "SELECT Jersey, COUNT(*) AS Count FROM nba_roster GROUP BY Jersey ORDER BY Count DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the most players over the age of 30", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE > 30 GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of players who attended the University of Michigan", "sql": "SELECT COLLEGE, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE COLLEGE = 'Michigan' GROUP BY COLLEGE;"}
|
|
|
+{"question": "What is the average salary of players in the NBA who are 25 years or older", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,'$')-1) AS INTEGER)) as average_salary FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "Which teams have the most players from the same college", "sql": "SELECT Team, COUNT(*) as Count, COLLEGE FROM nba_roster GROUP BY Team, COLLEGE ORDER BY Count DESC LIMIT 5;"}
|
|
|
+{"question": "What age group has the most representation in the NBA", "sql": "SELECT COUNT(*) as count, AGE as age_group FROM nba_roster GROUP BY AGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the oldest player with the highest salary in the NBA", "sql": "SELECT name, salary FROM nba_roster WHERE age > (SELECT AVG(age) FROM nba_roster) AND salary = (SELECT MAX(salary) FROM nba_roster) ORDER BY age LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of NBA players who attended college", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "Which team has the most college-educated players", "sql": "SELECT team, COUNT(*) as num_college_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team ORDER BY num_college_players DESC LIMIT 1;"}
|
|
|
+{"question": "What is the height of the 75th percentile of NBA players", "sql": "SELECT CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) as percentile FROM nba_roster ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster)*75/100-1;"}
|
|
|
+{"question": "What is the median age of all players in the NBA", "sql": "SELECT AGE as percentile FROM nba_roster ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster)*50/100-1;"}
|
|
|
+{"question": "What are the top 3 teams in the NBA by average salary", "sql": "SELECT team, AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 3;"}
|
|
|
+{"question": "How many players in the NBA are more than 5 years older than the average age of all players and did not attend college", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE - (SELECT AVG(AGE) FROM nba_roster) > 5 AND COLLEGE!= '--';"}
|
|
|
+{"question": "What is the average salary of NBA players aged 25 or older", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "Who are the top three tallest players in the NBA", "sql": "SELECT NAME, CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) AS height FROM nba_roster ORDER BY height DESC LIMIT 3;"}
|
|
|
+{"question": "What is the team with the most players from the same college", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster JOIN (SELECT COLLEGE, COUNT(*) as num_players FROM nba_roster GROUP BY COLLEGE ORDER BY num_players DESC) as top_colleges ON nba_roster.COLLEGE = top_colleges.COLLEGE WHERE nba_roster.COLLEGE = top_colleges.COLLEGE GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "Which three teams have the most players in the NBA", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster GROUP BY team ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "Who is the highest-paid player on the Toronto Raptors who attended college and has a known salary", "sql": "SELECT NAME, Jersey FROM nba_roster WHERE team='Toronto Raptors' AND SALARY!= '--' AND COLLEGE!='--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the 5 tallest players in the NBA", "sql": "SELECT NAME, HT FROM nba_roster WHERE HT!= 'NA' ORDER BY LENGTH(HT) DESC LIMIT 5;"}
|
|
|
+{"question": "What position has the most players in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Which five teams have the most players over the age of 25", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE > 25 GROUP BY team ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "What is the weight of the 75th percentile of NBA players who have a recorded weight", "sql": "SELECT CAST(SUBSTRING(WT, 0, INSTR(WT,'') - 1) AS INTEGER) as percentile FROM nba_roster WHERE WT!= 'NA' ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE WT!= 'NA') * 75 / 100 - 1;"}
|
|
|
+{"question": "Which 5 teams in the NBA have the highest average age, with an average age greater than 25.5 years old", "sql": "SELECT team, AVG(AGE) AS average_age, COUNT(*) AS num_players FROM nba_roster GROUP BY team HAVING AVG(AGE) > 25.5 ORDER BY average_age DESC LIMIT 5;"}
|
|
|
+{"question": "What are the names of the players in the NBA who are 6'7", "sql": "SELECT name FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 >= 6.67;"}
|
|
|
+{"question": "Who are the three tallest players on the Los Angeles Lakers", "sql": "SELECT NAME, HT FROM nba_roster WHERE team='Los Angeles Lakers' ORDER BY CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "What is the total salary of all Brooklyn Nets players, excluding those with unknown salaries", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE TEAM = 'Brooklyn Nets' AND SALARY!= '--';"}
|
|
|
+{"question": "Which NBA teams have the youngest and oldest rosters", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age ASC;"}
|
|
|
+{"question": "Which five teams have the largest rosters in the NBA", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE team!= 'NA' GROUP BY team ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "Which three teams in the NBA have the highest average salary among their players", "sql": "SELECT team, AVG(CAST(SUBSTRING(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 3;"}
|
|
|
+{"question": "Which team has the tallest average height among players 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height FROM nba_roster WHERE age <= 25 GROUP BY team ORDER BY height DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the highest-paid player in the NBA who attended a college starting with the letter 'M'", "sql": "SELECT name, salary FROM nba_roster WHERE COLLEGE LIKE 'M%' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 3 most common positions in the NBA", "sql": "SELECT POS, COUNT(*) AS count FROM nba_roster GROUP BY POS ORDER BY count DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the top 3 highest-paid players in the NBA, excluding those with unknown salaries", "sql": "SELECT name, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(SUBSTR(SALARY, 2) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "How many players in the NBA are 25 years old or younger and play one of the five main positions", "sql": "SELECT COUNT(*) FROM nba_roster WHERE POS IN ('PG', 'SG', 'SF', 'PF', 'C') AND AGE <= 25;"}
|
|
|
+{"question": "Who is the oldest player in the NBA roster", "sql": "SELECT name, age FROM nba_roster ORDER BY age DESC LIMIT 1;"}
|
|
|
+{"question": "Who are the top 3 players in the NBA by total weight", "sql": "SELECT NAME, SUM(CAST(SUBSTR(WT, 1, INSTR(WT,'') - 1) AS INTEGER)) AS total_weight, NAME FROM nba_roster GROUP BY NAME ORDER BY total_weight DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the top 3 players on the Toronto Raptors by jersey number", "sql": "SELECT name, jersey FROM nba_roster WHERE team='Toronto Raptors' ORDER BY CAST(Jersey AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "Who are the top 5 highest-paid players on the Toronto Raptors", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE TEAM = 'Toronto Raptors' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What college sent the most players to the current NBA who are 25 years old or younger", "sql": "SELECT college, COUNT(*) AS num_players FROM nba_roster WHERE college!= '--' AND AGE <= 25 GROUP BY college ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of the players on the Chicago Bulls", "sql": "SELECT AVG(LENGTH(HT)) FROM nba_roster WHERE team='Chicago Bulls';"}
|
|
|
+{"question": "Who are the top 5 players in the NBA with the highest salary-to-age ratio", "sql": "SELECT NAME, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) as salary, AGE, (CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) / AGE) as salary_to_age_ratio FROM nba_roster WHERE SALARY!= '--' ORDER BY salary_to_age_ratio DESC LIMIT 5;"}
|
|
|
+{"question": "Which team has the most players at the point guard position", "sql": "SELECT team, COUNT(*) as count FROM nba_roster WHERE POS='PG' GROUP BY team ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Which 5 players have played for the same college as the most other players in the NBA", "sql": "SELECT name, COLLEGE, COUNT(*) as count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY name, COLLEGE ORDER BY count DESC LIMIT 5;"}
|
|
|
+{"question": "Who are the top 3 highest-paid players in the league, excluding those with unknown salaries", "sql": "SELECT name, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 3 OFFSET 3;"}
|
|
|
+{"question": "What are the top 3 teams in the NBA with the highest average salaries", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY avg_salary DESC LIMIT 3;"}
|
|
|
+{"question": "Which team has the tallest average height in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) AS average_height FROM nba_roster GROUP BY team ORDER BY average_height DESC LIMIT 1;"}
|
|
|
+{"question": "Which teams in the NBA have the highest average salary and what is the average age of their players", "sql": "SELECT team, AVG(AGE) AS average_age, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster GROUP BY team ORDER BY average_salary DESC;"}
|
|
|
+{"question": "What are the colleges with the highest average salaries for their NBA players", "sql": "SELECT COLLEGE, AVG(CAST(SUBSTR(SALARY, 2) AS INTEGER)) AS avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY COLLEGE ORDER BY avg_salary DESC;"}
|
|
|
+{"question": "Which players in the NBA are 25 years old or older", "sql": "SELECT name FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the league among guards and forwards", "sql": "SELECT name, SALARY FROM nba_roster WHERE POS IN ('PG', 'SG', 'SF', 'PF', 'C') ORDER BY CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average salary of players who are more than 5 years older than the average age of all players in the NBA", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE - (SELECT AVG(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "What is the number of players in the NBA who attended a college that is not specified (i.e., '--'), or whose college name contains the words 'University', 'College', 'Institute', or 'School'", "sql": "SELECT COUNT(*) AS count FROM nba_roster WHERE COLLEGE='--' OR COLLEGE LIKE '%University%' OR COLLEGE LIKE '%College%' OR COLLEGE LIKE '%Institute%' OR COLLEGE LIKE '%School%';"}
|
|
|
+{"question": "Who is the youngest player on the Brooklyn Nets", "sql": "SELECT NAME FROM nba_roster WHERE TEAM = 'Brooklyn Nets' AND AGE = (SELECT MIN(AGE) FROM nba_roster WHERE TEAM = 'Brooklyn Nets');"}
|
|
|
+{"question": "What is the average age of the players on the Dallas Mavericks", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE team='Dallas Mavericks';"}
|
|
|
+{"question": "What are the top 5 highest paid players from the college that sent the most players to the NBA", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE COLLEGE IN (SELECT COLLEGE FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY COUNT(*) DESC LIMIT 1) AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "Which team has the most players from a specific college", "sql": "SELECT team, COLLEGE, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team, COLLEGE ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 5 players with the highest jersey numbers in the NBA", "sql": "SELECT jersey, name FROM nba_roster WHERE jersey!= 'NA' ORDER BY CAST(jersey AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "Who are the top 5 players in the league with the highest jersey numbers", "sql": "SELECT NAME, JERSEY FROM nba_roster ORDER BY JERSEY DESC LIMIT 5;"}
|
|
|
+{"question": "What are the top 5 colleges that have the most players in each age group", "sql": "SELECT NAME, COLLEGE, AGE FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE, AGE ORDER BY COUNT(*) DESC LIMIT 5;"}
|
|
|
+{"question": "Which colleges tend to produce the oldest players in the NBA", "sql": "SELECT AVG(AGE) as average_age, COLLEGE FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY average_age DESC;"}
|
|
|
+{"question": "Which NBA team has the lowest total salary", "sql": "SELECT TEAM, SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS TOTAL_SALARY FROM nba_roster WHERE SALARY!= '--' GROUP BY TEAM ORDER BY TOTAL_SALARY ASC;"}
|
|
|
+{"question": "Which 5 teams in the NBA have the highest average salary", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster GROUP BY team ORDER BY average_salary DESC LIMIT 5;"}
|
|
|
+{"question": "What is the height of the tallest player in the NBA, excluding players with unknown heights", "sql": "SELECT CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) as weight FROM nba_roster WHERE HT!= 'NA' ORDER BY weight LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE HT!= 'NA')*0.25-1;"}
|
|
|
+{"question": "What are the most common heights in the NBA, and what is the average height for each of these heights", "sql": "SELECT HT, COUNT(*) as count, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER)) as avg_height FROM nba_roster WHERE HT!= 'NA' GROUP BY HT ORDER BY count DESC;"}
|
|
|
+{"question": "What is the number of the player with the highest jersey number on the Los Angeles Lakers", "sql": "SELECT NAME, Jersey FROM nba_roster WHERE team='Los Angeles Lakers' AND Jersey!= 'NA' ORDER BY CAST(Jersey AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average age of players on the Memphis Grizzlies", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age ASC;"}
|
|
|
+{"question": "What are the positions in the NBA that tend to be the tallest and heaviest", "sql": "SELECT POS, AVG(LENGTH(HT)) AS avg_height, AVG(LENGTH(SUBSTR(WT, 1, LENGTH(WT)-4))) AS avg_weight FROM nba_roster GROUP BY POS ORDER BY avg_height DESC, avg_weight DESC;"}
|
|
|
+{"question": "What are the top 5 most common positions in the NBA", "sql": "SELECT POS, COUNT(*) AS num_players FROM nba_roster GROUP BY POS ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "Which colleges have the most players earning over $5 million per year", "sql": "SELECT COLLEGE, COUNT(*) as num_players, SUM(CASE WHEN CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) > 5000000 THEN 1 ELSE 0 END) as num_players_over_5_million FROM nba_roster WHERE SALARY!= '--' GROUP BY COLLEGE ORDER BY num_players_over_5_million DESC;"}
|
|
|
+{"question": "Who is the highest-paid non-point guard in the league", "sql": "SELECT NAME FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster) AND POS!= 'PG';"}
|
|
|
+{"question": "What is the most common position among players in the NBA who are 25 years old or younger", "sql": "SELECT POS, COUNT(*) AS count FROM nba_roster WHERE AGE <= 25 GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Which NBA players are taller than 6 feet 8 inches", "sql": "SELECT NAME, HT FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 > 6.8 ORDER BY HT DESC;"}
|
|
|
+{"question": "What is the average height of NBA players, excluding those with unknown heights", "sql": "SELECT AVG(LENGTH(HT)) AS average_height FROM nba_roster WHERE HT!= 'NA';"}
|
|
|
+{"question": "What are the top 10 most popular jersey numbers in the NBA", "sql": "SELECT COUNT(DISTINCT Jersey) as unique_jerseys, Jersey FROM nba_roster WHERE Jersey!= 'NA' GROUP BY Jersey ORDER BY unique_jerseys DESC LIMIT 10;"}
|
|
|
+{"question": "What are the most common positions in the NBA and what is the average age of players at each of these positions", "sql": "SELECT POS, COUNT(*) as count, ROUND(AVG(AGE),2) as avg_age FROM nba_roster WHERE POS!= '--' GROUP BY POS ORDER BY count DESC;"}
|
|
|
+{"question": "What is the average salary of NBA players, excluding those with unknown or missing salaries", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What are the top 10 colleges that have produced the most players in the NBA", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY count DESC LIMIT 10;"}
|
|
|
+{"question": "Who are the top 10 players in the league who have played for the most different colleges", "sql": "SELECT name, COLLEGE, COUNT(*) as num_colleges FROM nba_roster WHERE COLLEGE!= '--' GROUP BY name, COLLEGE ORDER BY num_colleges DESC LIMIT 10;"}
|
|
|
+{"question": "What is the average age of the Brooklyn Nets players", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE TEAM = 'Brooklyn Nets';"}
|
|
|
+{"question": "What is the highest paid player on the Memphis Grizzlies", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE >= 25 GROUP BY team;"}
|
|
|
+{"question": "What is the average salary for colleges with multiple players in the NBA", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) as average_salary FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "What are the names, heights, and positions of the power forwards and centers in the NBA who are 6'8", "sql": "SELECT name, HT, POS FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) = 68 AND POS LIKE '%F%' OR POS LIKE '%C%';"}
|
|
|
+{"question": "How many players in the NBA have attended the University of Michigan", "sql": "SELECT COUNT(*) FROM nba_roster WHERE COLLEGE = 'Michigan';"}
|
|
|
+{"question": "Which team has the oldest average age of its players", "sql": "SELECT team, AVG(AGE) as average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "Which NBA teams have the most players on their roster", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster GROUP BY team ORDER BY num_players DESC;"}
|
|
|
+{"question": "Which three teams in the NBA have the largest rosters", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster GROUP BY team ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "What are the top 5 colleges that produce the most NBA players", "sql": "SELECT college, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY college ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "What is the number of players in the NBA who are at least 5 years older than the youngest player in the league", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE - (SELECT MIN(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "What is the salary of the 25th percentile of NBA players", "sql": "SELECT (CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as percentile FROM nba_roster WHERE SALARY!= '--' ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE SALARY!= '--')*25/100-1;"}
|
|
|
+{"question": "What is the average salary premium for experienced players in the NBA", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) - (SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) FROM nba_roster WHERE SALARY!= '--') FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "Which five teams in the NBA have the largest rosters", "sql": "SELECT TEAM, COUNT(*) AS num_players FROM nba_roster GROUP BY TEAM ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "What is the team with the highest average salary for players under the age of 3", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE AGE < 3*12 GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What is the 25th percentile salary in the NBA", "sql": "SELECT TEAM, COUNT(*) AS num_players FROM nba_roster WHERE HT!= 'NA' GROUP BY TEAM ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the highest-paid player among those who did not attend college", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE COLLEGE = '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the most players who attended the University of Michigan", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE = 'Michigan' GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "How many players in the league are 25 years or younger", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE AGE + 25 <= (SELECT MAX(Age) FROM nba_roster);"}
|
|
|
+{"question": "Which three teams have the largest rosters in the current NBA", "sql": "SELECT Team, COUNT(*) AS num_players FROM nba_roster GROUP BY Team ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "What is the oldest player in each team who plays as a Point Guard", "sql": "SELECT Team, NAME, AGE FROM nba_roster WHERE AGE = (SELECT MAX(AGE) FROM nba_roster WHERE POS = 'PG') ORDER BY Team;"}
|
|
|
+{"question": "What is the highest paid center on the Dallas Mavericks", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE AGE <= 25 GROUP BY team ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "What team has the highest average salary", "sql": "SELECT team, AVG(CAST(SUBSTRING(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of players on the Toronto Raptors who are 25 years or older", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE team='Toronto Raptors' AND AGE >= 25 AND SALARY!= '--';"}
|
|
|
+{"question": "What are the positions with the tallest average height in the NBA", "sql": "SELECT POS, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height_by_pos FROM nba_roster GROUP BY POS ORDER BY height_by_pos DESC;"}
|
|
|
+{"question": "Which team has the highest average salary among its players", "sql": "SELECT team, name, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team, name ORDER BY avg_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What is the number of players in the NBA who attended a college and are more than 5 years older than the average age of all players", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE!= '--' AND AGE - (SELECT AVG(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "How many players on the Miami Heat are 6'8 or taller", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Miami Heat' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = '6' || '8';"}
|
|
|
+{"question": "What is the number of veteran players in the NBA", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE - (SELECT MIN(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "Which teams have the most players with recorded heights", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster WHERE HT!= 'NA' GROUP BY team ORDER BY num_players DESC;"}
|
|
|
+{"question": "Which three teams have the highest average salary for players under the age of 36", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE AGE < 3*12 GROUP BY team ORDER BY average_salary DESC LIMIT 3;"}
|
|
|
+{"question": "Which three teams have the tallest average height among players who are at least 5 years old", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height FROM nba_roster WHERE AGE > 5*12 GROUP BY team ORDER BY height DESC LIMIT 3;"}
|
|
|
+{"question": "What are the teams with the oldest and youngest rosters in the NBA", "sql": "SELECT team, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC;"}
|
|
|
+{"question": "Who is the tallest player in the NBA who is older than 25 years old", "sql": "SELECT name, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster WHERE AGE > 25 GROUP BY name ORDER BY average_height DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total number of players in the NBA who have a known salary", "sql": "SELECT COUNT(*) as total_players FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the team with the most players from a specific college, excluding players who did not attend college", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team, COLLEGE ORDER BY num_players DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has the oldest average age of point guards", "sql": "SELECT team, AVG(AGE) as avg_age FROM nba_roster WHERE POS = 'PG' GROUP BY team ORDER BY avg_age DESC LIMIT 1;"}
|
|
|
+{"question": "Which three teams have the tallest average height among their players aged 25 or older", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height FROM nba_roster WHERE AGE >= 25 GROUP BY team ORDER BY average_height DESC LIMIT 3;"}
|
|
|
+{"question": "What is the player with the highest average salary among players over the age of 5", "sql": "SELECT name, AVG(CAST(SUBSTRING(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) AS average_salary FROM nba_roster WHERE SALARY!= '--' AND AGE > 5 GROUP BY name ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What are the 5 most common positions in the NBA", "sql": "SELECT POS, COUNT(*) AS count FROM nba_roster WHERE POS!= 'NA' GROUP BY POS ORDER BY count DESC LIMIT 5;"}
|
|
|
+{"question": "Who is the pointguard for the Golden State Warriors?", "sql": "select name from nba_roster where team='Golden State Warriors' and POS='PG';"}
|
|
|
+{"question": "Who is the highest paid player in the NBA?", "sql": "SELECT NAME, salary FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What team is LaMelo Ball on?", "sql": "select team from nba_roster where name='LaMelo Ball';"}
|
|
|
+{"question": "How much does Lonzo Ball weigh?", "sql": "select wt from nba_roster where name='Lonzo Ball';"}
|
|
|
+{"question": "What college sent the most players to the current NBA?", "sql": "select college from nba_roster where college != '--' group by college order by count(*) desc limit 1;"}
|
|
|
+{"question": "How old is Lebron James?", "sql": "select age from nba_roster where name='LeBron James';"}
|
|
|
+{"question": "What is the most popular jersey number in the current NBA?", "sql": "select Jersey from nba_roster where Jersey != 'NA' group by Jersey order by count(*) desc limit 1;"}
|
|
|
+{"question": "What team has the smallest roster?", "sql": "select team from nba_roster group by team order by count(*) asc limit 1;"}
|
|
|
+{"question": "What team has the largest roster?", "sql": "select team, count(*) from nba_roster group by team order by count(*) desc limit 1;"}
|
|
|
+{"question": "What team is paying its players the most in total?", "sql": "select team, sum(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) from nba_roster group by team order by sum(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) desc limit 1;"}
|
|
|
+{"question": "Which team is paying its players the least?", "sql": "select team from nba_roster group by team order by sum(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) asc limit 1;"}
|
|
|
+{"question": "Which team is on average the tallest?", "sql": "select team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height from nba_roster group by team order by height desc limit 1;"}
|
|
|
+{"question": "Which team is on average the shortest?", "sql": "select team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as height from nba_roster group by team order by height asc limit 1;"}
|
|
|
+{"question": "Who are the tallest 5 centers in the league?", "sql": "SELECT name, HT FROM nba_roster WHERE POS = 'C' ORDER BY HT DESC LIMIT 5;"}
|
|
|
+{"question": "Who are the top 5 highest paid power forwards in the league?", "sql": "SELECT NAME, salary FROM nba_roster WHERE POS = 'PF' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the median salary in the NBA?", "sql": "SELECT (CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as percentile FROM nba_roster WHERE SALARY!= '--' order by percentile limit 1 offset (select count(*) from nba_roster where SALARY != '--')*50/100-1;"}
|
|
|
+{"question": "What is the average salary in the NBA?", "sql": "SELECT avg(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as percentile FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "Which five players in the NBA have attended the most different colleges", "sql": "SELECT name, COLLEGE, COUNT(DISTINCT COLLEGE) as num_colleges FROM nba_roster WHERE COLLEGE!= '--' GROUP BY name ORDER BY num_colleges DESC LIMIT 5;"}
|
|
|
+{"question": "What college sent the most players to the current NBA", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster GROUP BY team ORDER BY num_players DESC LIMIT 5;"}
|
|
|
+{"question": "Who are the top 3 highest-paid players on the Golden State Warriors", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE team='Golden State Warriors' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 3;"}
|