|
@@ -0,0 +1,330 @@
|
|
|
+{"question": "What college has the most players in the NBA who are 30 years old or older", "sql": "SELECT COLLEGE, COUNT(*) AS count FROM nba_roster WHERE AGE >= 30 GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of all NBA players", "sql": "SELECT SUM(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)*1000000) FROM nba_roster;"}
|
|
|
+{"question": "What are the most common positions in the NBA", "sql": "SELECT POS, COUNT(*) AS num_players FROM nba_roster GROUP BY POS;"}
|
|
|
+{"question": "What is the average salary for each age group in the NBA", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary, AGE as age_group FROM nba_roster WHERE SALARY!= '--' GROUP BY AGE ORDER BY age_group;"}
|
|
|
+{"question": "What are the top 5 colleges that have produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY count DESC LIMIT 5;"}
|
|
|
+{"question": "How many players in the NBA attended college", "sql": "SELECT COUNT(*) AS num_college_players FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "What are the top 3 colleges with 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 3;"}
|
|
|
+{"question": "What is the average age of all players in the NBA", "sql": "SELECT AVG(AGE) FROM nba_roster;"}
|
|
|
+{"question": "What is the most represented college 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 college has produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of 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 is the average age of players on each team in the NBA", "sql": "SELECT team, AVG(AGE) as avg_age FROM nba_roster WHERE SALARY!= '--' GROUP BY team;"}
|
|
|
+{"question": "What are the top 3 positions with the highest total salary expenditure in the NBA", "sql": "SELECT pos, name, SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY pos ORDER BY total_salary DESC LIMIT 3;"}
|
|
|
+{"question": "Which colleges have 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 is the average salary for each team in the NBA", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team;"}
|
|
|
+{"question": "What are the teams with the highest average salaries 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;"}
|
|
|
+{"question": "What are the 5 colleges that 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 LIMIT 5;"}
|
|
|
+{"question": "What is the most common position in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of Power Forwards in the NBA who are at least 25 years old", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE >= 25 AND POS = 'PF';"}
|
|
|
+{"question": "What is the average age of 6-foot Power Forwards in the NBA", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) = 6 AND POS='PF';"}
|
|
|
+{"question": "What is the name of the player with the highest average weight among Power Forwards in the NBA", "sql": "SELECT NAME, AVG(CAST(SUBSTR(WT, 1, INSTR(WT,' ')) AS INTEGER)) AS avg_weight FROM nba_roster WHERE POS='PF' GROUP BY NAME ORDER BY avg_weight DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has 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 1;"}
|
|
|
+{"question": "What is the average salary of all NBA players", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster;"}
|
|
|
+{"question": "What is the average age of the players on the Toronto Raptors", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE team='Toronto Raptors';"}
|
|
|
+{"question": "Which three teams have the most players from a single college", "sql": "SELECT team, COLLEGE, COUNT(*) AS num_players FROM nba_roster GROUP BY team, COLLEGE ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "How many players in the NBA are at least 5 years older than the youngest player in the league", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE - (SELECT MIN(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "What is the average salary of NBA players who are 25 years or older", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$') - 1) as INTEGER)) FROM nba_roster WHERE CAST(AGE as INTEGER) >= 25;"}
|
|
|
+{"question": "What is the number of players on each team in the NBA", "sql": "SELECT Team, COUNT(*) as num_players FROM nba_roster GROUP BY Team;"}
|
|
|
+{"question": "What is the average salary for each position in the NBA, excluding players with unknown salaries", "sql": "SELECT POS, AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$') - 1) as INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY POS;"}
|
|
|
+{"question": "What are the oldest players on each team with a roster size of 6 or more", "sql": "SELECT NAME FROM nba_roster WHERE AGE IN (SELECT MAX(AGE) FROM nba_roster WHERE TEAM IN (SELECT TEAM FROM nba_roster GROUP BY TEAM HAVING COUNT(*) > 5));"}
|
|
|
+{"question": "What is the average height of the players on the Toronto Raptors", "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 team='Toronto Raptors';"}
|
|
|
+{"question": "What is the highest-paid Toronto Raptors player who attended college", "sql": "SELECT name, salary FROM nba_roster WHERE team='Toronto Raptors' AND COLLEGE!='--' AND SALARY!='--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the median weight in the NBA", "sql": "SELECT NAME, COLLEGE, COUNT(*) as num_colleges FROM nba_roster WHERE COLLEGE!= '--' GROUP BY NAME, COLLEGE ORDER BY num_colleges DESC;"}
|
|
|
+{"question": "Who are the top 5 highest-paid players in the NBA", "sql": "SELECT * FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average height of players on each NBA team", "sql": "SELECT team, AVG(CAST(SUBSTRING(HT, 1, INSTR(HT,'')-1) AS INTEGER) + CAST(SUBSTRING(HT, INSTR(HT,'')+1) AS INTEGER) / 12.0) as avg_height FROM nba_roster WHERE HT!= 'NA' GROUP BY team;"}
|
|
|
+{"question": "Who are the top 3 highest-paid players in the NBA", "sql": "SELECT name, SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY name ORDER BY total_salary DESC LIMIT 3;"}
|
|
|
+{"question": "What is the average salary of NBA players", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "How many players in the NBA are 68 inches tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) = 68;"}
|
|
|
+{"question": "What are the top 5 teams with 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 5;"}
|
|
|
+{"question": "What is the average salary of the Los Angeles Lakers players", "sql": "SELECT AVG(CAST(SALARY AS INTEGER) ) AS average_salary FROM nba_roster WHERE team='Los Angeles Lakers';"}
|
|
|
+{"question": "What is the college that has produced the most players currently playing for the Boston Celtics", "sql": "SELECT COLLEGE, COUNT(*) AS count FROM nba_roster WHERE team='Boston Celtics' GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the most common position for players under the age of 25 in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE AGE <= 25 GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of players on each NBA team, excluding players with unknown heights", "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 are the 5 most common heights among NBA players", "sql": "SELECT HT, COUNT(*) AS count FROM nba_roster GROUP BY HT ORDER BY count DESC LIMIT 5;"}
|
|
|
+{"question": "What are the top 5 colleges with 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 5;"}
|
|
|
+{"question": "What is the average height of NBA players who are 25 years or older", "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": "What are the top 3 teams with the highest average salaries 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": "What is the position with the most players in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE SALARY!= '--' GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of NBA players who are at least 5 years old", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE AGE > 5;"}
|
|
|
+{"question": "What is the most common age range among NBA players", "sql": "SELECT AGE, COUNT(*) AS count FROM nba_roster GROUP BY AGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of NBA players who are 25 years old or older", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE AGE > 25;"}
|
|
|
+{"question": "What is the average age of the players in the NBA who are more than 5 years older than the average age of all players", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE AGE + (SELECT AVG(AGE) FROM nba_roster) > 5*12;"}
|
|
|
+{"question": "What is the average age of the players in the NBA who are older than 5 years old", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE AGE > 5*12;"}
|
|
|
+{"question": "What colleges have produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"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": "How many players in the NBA 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": "What are the 5 teams with the highest average salary in the NBA", "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 each team 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;"}
|
|
|
+{"question": "How many players in the NBA are 10 years old or older", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE age + (JULIANDAY('now') - JULIANDAY(DATE('now', '-10 year'))) / 365.25 >= 10;"}
|
|
|
+{"question": "How many players on the Toronto Raptors are 6 feet 8 inches tall", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE team='Toronto Raptors' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = '6' || '8';"}
|
|
|
+{"question": "How many players in the NBA are over the age of 25", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE > 25;"}
|
|
|
+{"question": "What is the average height of NBA players under the age of 25", "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;"}
|
|
|
+{"question": "What is the total salary of all players in the NBA who are more than 5 years older than the average age of all players", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE (AGE - (SELECT AVG(AGE) FROM nba_roster)) > 5;"}
|
|
|
+{"question": "What is the most common height in the NBA", "sql": "SELECT SUBSTR(HT, 1, INSTR(HT,'')-1) as height, COUNT(*) as count FROM nba_roster GROUP BY SUBSTR(HT, 1, INSTR(HT,'')-1) ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of NBA players 25 years or older", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "What are the 5 most common heights in the NBA", "sql": "SELECT HT, COUNT(*) AS frequency FROM nba_roster GROUP BY HT ORDER BY frequency DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average height of the players on the Los Angeles Lakers", "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 TEAM = 'Los Angeles Lakers';"}
|
|
|
+{"question": "What is the average age of all players in the NBA who are older than 5 years old", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE AGE > 5;"}
|
|
|
+{"question": "What is the most popular college attended by NBA players", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height for each position in the NBA", "sql": "SELECT POS, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) as INTEGER)) AS average_height FROM nba_roster GROUP BY POS ORDER BY average_height;"}
|
|
|
+{"question": "What are the jersey numbers of the first 5 players in the NBA roster", "sql": "SELECT NAME, JERSEY FROM nba_roster ORDER BY JERSEY LIMIT 5;"}
|
|
|
+{"question": "What is the age range of the players in the NBA", "sql": "SELECT MIN(AGE) as youngest_player, MAX(AGE) as oldest_player FROM nba_roster;"}
|
|
|
+{"question": "What is the total salary for each team in the NBA", "sql": "SELECT team, SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team;"}
|
|
|
+{"question": "What are the top 5 teams in the NBA with the highest average salary", "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 5;"}
|
|
|
+{"question": "What are the top 5 highest-paid players in the NBA", "sql": "SELECT NAME, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) as total_salary FROM nba_roster WHERE SALARY!= '--' ORDER BY total_salary DESC LIMIT 5;"}
|
|
|
+{"question": "What is the 99th percentile salary in the NBA", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "How many players are on the Toronto Raptors", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE TEAM = 'Toronto Raptors';"}
|
|
|
+{"question": "What are the 5 highest-paid players in the NBA", "sql": "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY SALARY DESC) AS row_num FROM nba_roster) AS temp_table WHERE row_num <= 5;"}
|
|
|
+{"question": "Which players have had the most varied careers in the NBA, having played for the most different teams", "sql": "SELECT name, COUNT(DISTINCT team) as num_teams FROM nba_roster WHERE team!= 'NA' GROUP BY name ORDER BY num_teams DESC LIMIT 10;"}
|
|
|
+{"question": "Which three 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 LIMIT 3;"}
|
|
|
+{"question": "What are the colleges with the highest average salaries in the NBA", "sql": "SELECT college, COUNT(*) as count, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY college ORDER BY avg_salary DESC;"}
|
|
|
+{"question": "What is the name and jersey number of the player with the highest jersey number in the NBA", "sql": "SELECT NAME, JERSEY FROM nba_roster WHERE JERSEY!= 'NA' ORDER BY CAST(JERSEY AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average age of NBA players", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster;"}
|
|
|
+{"question": "What are the top 3 teams with the oldest average age in the NBA", "sql": "SELECT TEAM, AVG(AGE) as average_age FROM nba_roster WHERE SALARY!= '--' GROUP BY TEAM ORDER BY average_age DESC LIMIT 3;"}
|
|
|
+{"question": "Which colleges have multiple players in the NBA", "sql": "SELECT COUNT(*) AS college_players, COLLEGE FROM nba_roster GROUP BY COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "What is the average age of players on each NBA team", "sql": "SELECT team, AVG(CAST(AGE as INTEGER)) as avg_age FROM nba_roster GROUP BY team;"}
|
|
|
+{"question": "What is the average salary of Power Forward players in the NBA", "sql": "SELECT age, COUNT(*) as count FROM nba_roster GROUP BY age ORDER BY count DESC;"}
|
|
|
+{"question": "What is the team with the highest average salary for players over 25 years old", "sql": "SELECT team, AVG(CAST(SUBSTRING(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE > 25 AND SALARY!= '--' GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What is the age range of players in the NBA", "sql": "SELECT MIN(AGE) as youngest, MAX(AGE) as oldest FROM nba_roster;"}
|
|
|
+{"question": "What is the most successful college in terms of producing NBA players", "sql": "SELECT COLLEGE, COUNT(*) as frequency FROM nba_roster GROUP BY COLLEGE ORDER BY frequency DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of the Boston Celtics players", "sql": "SELECT AVG(CAST(SALARY AS INTEGER) ) AS average_salary FROM nba_roster WHERE team='Boston Celtics';"}
|
|
|
+{"question": "Which colleges have produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) AS count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY count DESC;"}
|
|
|
+{"question": "Who is the highest-paid player in the NBA", "sql": "SELECT NAME FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster);"}
|
|
|
+{"question": "Which 5 players have the highest jersey numbers in the NBA", "sql": "SELECT name, jersey FROM nba_roster WHERE jersey!= 'NA' ORDER BY CAST(REPLACE(REPLACE(jersey, '0', ''), 'NA', '') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What are the names of the players who are older than 30 years old in the NBA", "sql": "SELECT name, age FROM nba_roster WHERE age > 30 ORDER BY age;"}
|
|
|
+{"question": "How many players in the NBA are younger than the oldest player in the league by 25 years", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE + 25 > (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "Which 10 players have played for the most teams in their NBA careers", "sql": "SELECT name, COUNT(DISTINCT team) AS num_teams FROM nba_roster GROUP BY name ORDER BY num_teams DESC LIMIT 10;"}
|
|
|
+{"question": "What is the average height for each height range in the NBA", "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;"}
|
|
|
+{"question": "How many players in the NBA are 6 feet 8 inches tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = 68;"}
|
|
|
+{"question": "What percentage of players in the NBA are 10 years or less away from the oldest player in the league", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE + 10 <= (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "What is the college that has produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) AS count FROM nba_roster GROUP BY COLLEGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of the youngest players on each NBA team", "sql": "SELECT team, AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE <= 22 GROUP BY team ORDER BY average_salary DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average age of players in the NBA who have a publicly disclosed salary", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the average salary for each position in the NBA", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary, POS FROM nba_roster WHERE SALARY!= '--' GROUP BY POS ORDER BY average_salary DESC;"}
|
|
|
+{"question": "What is the average age of players in the NBA who are at least 60 years old", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE AGE > 5*12;"}
|
|
|
+{"question": "Who are the 10 tallest players in the NBA", "sql": "SELECT HT, NAME FROM nba_roster ORDER BY CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) DESC LIMIT 10;"}
|
|
|
+{"question": "Which NBA team has 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 average age of players from each college, excluding those who did not attend college, listed in order from oldest to youngest", "sql": "SELECT COLLEGE, AVG(AGE) as average_age FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY average_age DESC;"}
|
|
|
+{"question": "What is the average salary for each position in the NBA, with the highest-paid positions listed first", "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": "What is the average height of NBA players 25 years old or older", "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": "What are the top 10 colleges with 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 LIMIT 10;"}
|
|
|
+{"question": "What is the average height of all players in the NBA", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)) as average_height FROM nba_roster;"}
|
|
|
+{"question": "What are the top 5 colleges that produce the highest-paid NBA players", "sql": "SELECT COLLEGE, AVG(CAST(SUBSTR(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY COLLEGE ORDER BY average_salary DESC LIMIT 5;"}
|
|
|
+{"question": "Which teams have the most players under 6'8", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE HT!= 'NA' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) < 68 GROUP BY team;"}
|
|
|
+{"question": "What is the number of players in the NBA who are 25 years old or younger", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "What is the team with the highest average salary in the NBA", "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 are the average heights for each position in the NBA, from tallest to shortest", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) + CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) as average_height, POS FROM nba_roster GROUP BY POS ORDER BY average_height DESC;"}
|
|
|
+{"question": "How many players in the NBA are over the age of 30", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE > 30;"}
|
|
|
+{"question": "Who is the tallest player in the NBA", "sql": "SELECT NAME, HT FROM nba_roster ORDER BY LENGTH(HT) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 3 teams in the NBA with the highest average 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 LIMIT 3;"}
|
|
|
+{"question": "Which team has the highest average salary in the NBA", "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 is the total number of players in the NBA who have attended a college other than '--'?", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "Who is the player who has played for the most teams in their NBA career", "sql": "SELECT NAME, COUNT(DISTINCT TEAM) AS num_teams FROM nba_roster WHERE SALARY!= '--' GROUP BY NAME ORDER BY num_teams DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 10 highest-paid college-educated players in the NBA", "sql": "SELECT name, SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS total_salary FROM nba_roster WHERE COLLEGE!= '--' GROUP BY name ORDER BY total_salary DESC LIMIT 10;"}
|
|
|
+{"question": "Which NBA players have attended multiple colleges", "sql": "SELECT NAME, COLLEGE FROM nba_roster WHERE COLLEGE!= '--' GROUP BY NAME, COLLEGE HAVING COUNT(COLLEGE) > 1;"}
|
|
|
+{"question": "What are the 5 teams with the tallest average height in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER)) AS average_height FROM nba_roster GROUP BY team ORDER BY average_height DESC;"}
|
|
|
+{"question": "What is the average height of players in the NBA who are older than 25 years old", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER)) AS average_height FROM nba_roster WHERE AGE > 25;"}
|
|
|
+{"question": "How many players are on the Toronto Raptors' roster", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Toronto Raptors';"}
|
|
|
+{"question": "What is the weight of the heaviest 75% of NBA players", "sql": "SELECT WT FROM nba_roster ORDER BY CAST(REPLACE(REPLACE(WT,'lbs', ''),'', '') AS INTEGER) DESC LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE WT!= '--') * 75 / 100 - 1;"}
|
|
|
+{"question": "Who is the highest-paid player in the league, excluding those with unknown positions, salaries, or colleges", "sql": "SELECT name, salary FROM nba_roster WHERE POS!= 'NA' AND SALARY!= '--' AND COLLEGE!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "How many players in the NBA attended Duke, Kentucky, or North Carolina for college", "sql": "SELECT COUNT(*) AS count FROM nba_roster WHERE COLLEGE!= '--' AND COLLEGE IN ('Duke', 'Kentucky', 'North Carolina');"}
|
|
|
+{"question": "What is the most common college represented in the NBA", "sql": "SELECT COLLEGE, COUNT(*) as frequency FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY frequency DESC LIMIT 1;"}
|
|
|
+{"question": "What is the number of players in the NBA who attended a college other than '--'?", "sql": "SELECT COUNT(*) FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "How many players on the Toronto Raptors are 25 years old or older", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE team='Toronto Raptors' AND AGE >= 25;"}
|
|
|
+{"question": "How many players on the Toronto Raptors are 6'8", "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 team with the most players over 30 years old in the NBA", "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 highest-paid Power Forward in the NBA", "sql": "SELECT POS, NAME, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) as Salary FROM nba_roster WHERE SALARY!= '--' ORDER BY Salary DESC LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE SALARY!= '--' AND POS = 'PF')-1;"}
|
|
|
+{"question": "How many players in the NBA are older than the average age of all players", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE > (SELECT AVG(AGE) FROM nba_roster);"}
|
|
|
+{"question": "What positions in the NBA tend to have the oldest average age", "sql": "SELECT POS, COUNT(*) AS count, AVG(AGE) AS average_age FROM nba_roster GROUP BY POS ORDER BY average_age DESC;"}
|
|
|
+{"question": "Which players have more than 5 teammates with the same name", "sql": "SELECT NAME FROM nba_roster WHERE (SELECT COUNT(*) FROM nba_roster WHERE NAME = nba_roster.NAME AND TEAM = nba_roster.TEAM) > 5;"}
|
|
|
+{"question": "Which 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;"}
|
|
|
+{"question": "What is the total salary of the most expensive team in the NBA", "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 DESC;"}
|
|
|
+{"question": "How many players on the Boston Celtics are 6 feet 8 inches tall or taller", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE team='Boston Celtics' AND CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = '6' || '8';"}
|
|
|
+{"question": "What are the most common colleges represented in the NBA", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster GROUP BY COLLEGE ORDER BY count DESC;"}
|
|
|
+{"question": "What are the 5 teams with the oldest average age in the NBA", "sql": "SELECT team, AVG(AGE) AS average_age, COUNT(*) AS num_players FROM nba_roster GROUP BY team HAVING COUNT(*) > 5 ORDER BY average_age DESC;"}
|
|
|
+{"question": "How many players in the NBA are 6 feet tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) = 6;"}
|
|
|
+{"question": "Who are the tallest players in the NBA", "sql": "SELECT NAME FROM nba_roster WHERE HT > (SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) FROM nba_roster);"}
|
|
|
+{"question": "What are the ages of the youngest and oldest players in the NBA", "sql": "SELECT MIN(AGE) AS youngest_player, MAX(AGE) AS oldest_player FROM nba_roster;"}
|
|
|
+{"question": "What are the 5 teams with the lightest average weight for players with known heights", "sql": "SELECT HT, WT, AVG(CAST(SUBSTR(WT, 1, LENGTH(WT)-3) AS INTEGER)) 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 positions with the tallest average height in the NBA", "sql": "SELECT POS, COUNT(*) AS count, AVG(CAST(SUBSTR(HT, 1, LENGTH(HT)-2) AS INTEGER)) AS avg_height FROM nba_roster WHERE HT!= 'NA' GROUP BY POS ORDER BY count DESC LIMIT 5;"}
|
|
|
+{"question": "Which 5 players have played for the most teams in their NBA careers", "sql": "SELECT NAME, COUNT(DISTINCT team) AS num_teams FROM nba_roster GROUP BY NAME ORDER BY num_teams DESC LIMIT 5;"}
|
|
|
+{"question": "What are the most common heights in the NBA", "sql": "SELECT HT, COUNT(*) as count FROM nba_roster GROUP BY HT ORDER BY count DESC LIMIT 10;"}
|
|
|
+{"question": "How many players on the Los Angeles Lakers are 6 feet 8 inches tall", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE team='Los Angeles Lakers' AND CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) = '6' || '8';"}
|
|
|
+{"question": "What are the most common positions for players under the age of 25 in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE AGE < 25 GROUP BY POS ORDER BY count DESC;"}
|
|
|
+{"question": "What are the top colleges that produce the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) as count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY count DESC;"}
|
|
|
+{"question": "What are the colleges that have produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) AS num_players FROM nba_roster GROUP BY COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "How many players in the NBA are 25 years or younger", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE + 25 <= (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "What is the average age of players from the college that has produced the youngest players in the NBA", "sql": "SELECT AVG(AGE) as average_age FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY average_age LIMIT 1;"}
|
|
|
+{"question": "How many players in the NBA have attended Duke, Kentucky, North Carolina, or did not attend college", "sql": "SELECT COUNT(*) FROM nba_roster WHERE COLLEGE IN ('--', 'Duke', 'Kentucky', 'North Carolina');"}
|
|
|
+{"question": "What are the teams with the most players from a particular college", "sql": "SELECT team, COLLEGE, COUNT(*) AS num_players FROM nba_roster GROUP BY team, COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "What is the number of players in the NBA who are older than 10 years old", "sql": "SELECT COUNT(*) FROM nba_roster WHERE (CAST(CAST(AGE AS INTEGER) AS REAL) > 10);"}
|
|
|
+{"question": "What are the top 3 highest paid players from each college", "sql": "SELECT name, college, MAX(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as max_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY college ORDER BY max_salary DESC LIMIT 3;"}
|
|
|
+{"question": "How many players in the NBA are at least 6 feet 8 inches tall", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) >= 68;"}
|
|
|
+{"question": "Which NBA teams have the most players from a particular college", "sql": "SELECT Team, COLLEGE, COUNT(*) as Count FROM nba_roster WHERE COLLEGE!= '--' GROUP BY Team, COLLEGE ORDER BY Count DESC;"}
|
|
|
+{"question": "What is the most common college attended by NBA players", "sql": "SELECT COLLEGE, COUNT(*) AS frequency FROM nba_roster GROUP BY COLLEGE ORDER BY frequency DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of all NBA players, excluding those with unknown salaries", "sql": "SELECT SUM(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)*1000000) AS total_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What are the teams with the tallest average height in the NBA", "sql": "SELECT team, AVG(LENGTH(HT)) AS average_height FROM nba_roster GROUP BY team ORDER BY average_height DESC;"}
|
|
|
+{"question": "Which 10 players have played for the most teams in their NBA career", "sql": "SELECT name, COUNT(DISTINCT team) as num_teams FROM nba_roster WHERE SALARY!= '--' GROUP BY name ORDER BY num_teams DESC LIMIT 10;"}
|
|
|
+{"question": "What is the average height of NBA players 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')) AS INTEGER)) AS average_height FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "What is the average weight of NBA players", "sql": "SELECT 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!= '--';"}
|
|
|
+{"question": "Which teams in the NBA have a significantly larger roster size compared to the number of point guards in the league", "sql": "SELECT Team, COUNT(*) as num_players FROM nba_roster GROUP BY Team HAVING COUNT(*) > (SELECT COUNT(*) FROM nba_roster WHERE POS = 'PG')*0.3;"}
|
|
|
+{"question": "What are the top 5 colleges that produce the oldest average age of NBA players", "sql": "SELECT COLLEGE, AVG(AGE) as avg_age FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY avg_age DESC LIMIT 5;"}
|
|
|
+{"question": "What is the average salary of all players in the positions of PG, SG, SF, PF, and C in the NBA", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE POS = 'PG' OR POS = 'SG' OR POS = 'SF' OR POS = 'PF' OR POS = 'C';"}
|
|
|
+{"question": "Who is the player with the highest salary in the NBA", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster);"}
|
|
|
+{"question": "What are the top 10 teams with the most players in the NBA, considering only teams with at least 10 players with height information", "sql": "SELECT name, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)) as avg_height, COUNT(*) as count FROM nba_roster WHERE HT!= 'NA' GROUP BY name ORDER BY count DESC LIMIT 10;"}
|
|
|
+{"question": "Which players have played for the most teams in their NBA careers", "sql": "SELECT name, COUNT(DISTINCT team) as team_count FROM nba_roster WHERE team!= 'NA' GROUP BY name ORDER BY team_count DESC LIMIT 10;"}
|
|
|
+{"question": "What is the 75th percentile jersey number in the NBA", "sql": "SELECT CAST(Jersey AS INTEGER) as percentile FROM nba_roster ORDER BY CAST(Jersey AS INTEGER) LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster) * 0.75;"}
|
|
|
+{"question": "How many players in the NBA are younger than the oldest player in the league by 15 years", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE + 15 > (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "Which jersey numbers are the most popular among NBA players", "sql": "SELECT NAME, JERSEY FROM nba_roster GROUP BY JERSEY ORDER BY COUNT(*) DESC LIMIT 3;"}
|
|
|
+{"question": "Which team has the highest average salary", "sql": "SELECT team, AVG(CAST(SUBSTRING(SALARY, 2, LENGTH(SALARY)-2) AS INTEGER)) AS avg_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY avg_salary DESC LIMIT 1;"}
|
|
|
+{"question": "How many players in the NBA are older than 25 years old", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE > 25;"}
|
|
|
+{"question": "Which colleges have produced the most multiple NBA players", "sql": "SELECT COLLEGE, COUNT(*) FROM nba_roster GROUP BY COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "Who has the highest salary on the Los Angeles Lakers", "sql": "SELECT name, salary FROM nba_roster WHERE team='Los Angeles Lakers' AND salary!= '--' ORDER BY CAST(REPLACE(REPLACE(salary, '$', ''), ',', '') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the minimum and maximum salaries for each team 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, team FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY min_salary DESC, max_salary DESC;"}
|
|
|
+{"question": "What is the average age of the team with the oldest roster in the NBA", "sql": "SELECT AVG(AGE) as avg_age FROM nba_roster GROUP BY team ORDER BY avg_age DESC LIMIT 1;"}
|
|
|
+{"question": "What are the teams with more than 5 players in the age range of 25 to 30 in the NBA", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster WHERE AGE BETWEEN 25 AND 30 GROUP BY team HAVING COUNT(*) > 5;"}
|
|
|
+{"question": "Who is the highest-paid player who did not attend college", "sql": "SELECT name, salary FROM nba_roster WHERE SALARY!= '--' AND COLLEGE = '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total number of players in the NBA", "sql": "SELECT COUNT(*) FROM nba_roster;"}
|
|
|
+{"question": "What is the most common position among players under the age of 25 in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE AGE <= 25 GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the oldest player in the NBA", "sql": "SELECT name, age FROM nba_roster ORDER BY age DESC LIMIT 1;"}
|
|
|
+{"question": "What are the minimum and maximum 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 WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the average salary of Power Forward players in the NBA who are under the age of 25", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE POS = 'PF' AND AGE < 25;"}
|
|
|
+{"question": "What is the total number of players in the NBA who are 25 years or younger", "sql": "SELECT COUNT(*) as total_players FROM nba_roster WHERE AGE + 25 <= (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "Who is the highest-paid player on the Toronto Raptors", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE TEAM = 'Toronto Raptors' AND SALARY = (SELECT MAX(SALARY) FROM nba_roster WHERE TEAM = 'Toronto Raptors');"}
|
|
|
+{"question": "Who is the highest-paid player on the Los Angeles Lakers", "sql": "SELECT name FROM nba_roster WHERE team='Los Angeles Lakers' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 3 teams with the most players over the age of 5 in the NBA", "sql": "SELECT team, COUNT(*) as num_players FROM nba_roster WHERE age > 5 GROUP BY team ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "Which teams have the tallest players, excluding those with unknown salaries", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)) as avg_height FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY avg_height DESC;"}
|
|
|
+{"question": "What is the number of players in the NBA who are 25 years or younger", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE + 25 <= (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "What is the age group with the most players in the NBA", "sql": "SELECT AGE, COUNT(*) as count FROM nba_roster GROUP BY AGE ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the most common position for players aged 25 or older in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE AGE >= 25 GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of all players in the NBA", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster;"}
|
|
|
+{"question": "Which three teams have the most players from the same college", "sql": "SELECT team, COUNT(*) AS num_players, COLLEGE FROM nba_roster GROUP BY team, COLLEGE ORDER BY num_players DESC LIMIT 3;"}
|
|
|
+{"question": "What is the average age of players in the NBA who are more than 5 years older than 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": "What is the heaviest player in the NBA", "sql": "SELECT NAME, WT FROM nba_roster WHERE WT!= 'NA' ORDER BY CAST(SUBSTRING(WT, 0, INSTR(WT,'') - 1) AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of all players in the NBA roster", "sql": "SELECT AVG(LENGTH(HT)) AS average_height FROM nba_roster;"}
|
|
|
+{"question": "What are the average height and age of players on each team in the NBA", "sql": "SELECT team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER)) AS average_height, AVG(AGE) AS average_age FROM nba_roster GROUP BY team ORDER BY average_age DESC;"}
|
|
|
+{"question": "How many players in the NBA are 6' or 8' tall", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE CAST(SUBSTRING(HT, 1, INSTR(HT,'')-1) AS INTEGER) = 6 | 8;"}
|
|
|
+{"question": "What is the shortest weight listed in the 'nba_roster' table", "sql": "SELECT NAME, WT FROM nba_roster ORDER BY LENGTH(WT) LIMIT 1;"}
|
|
|
+{"question": "What is the highest-paid player in the NBA", "sql": "SELECT TEAM, NAME, SALARY FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster) ORDER BY TEAM;"}
|
|
|
+{"question": "What college has produced the most NBA players", "sql": "SELECT COLLEGE, COUNT(*) AS frequency FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY frequency DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of all players in the NBA who are 25 years old or younger", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "What is the oldest player for each position in the NBA", "sql": "SELECT pos, NAME, MAX(AGE) as max_age FROM nba_roster GROUP BY pos;"}
|
|
|
+{"question": "Who is the highest-paid player in the NBA 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": "What is the salary of the 25th percentile of players in the NBA who are 25 years old or younger", "sql": "SELECT CAST(SALARY as INTEGER) as percentile FROM nba_roster WHERE AGE <= 25 ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster WHERE AGE <= 25) / 4;"}
|
|
|
+{"question": "What are the most common positions in the NBA, and which position has the highest average weight", "sql": "SELECT POS, COUNT(*) AS count, AVG(CAST(SUBSTR(WT, 1, INSTR(WT,'')) AS INTEGER)) AS average_weight FROM nba_roster WHERE POS!= 'NA' GROUP BY POS ORDER BY count DESC;"}
|
|
|
+{"question": "What is the 75th percentile age of the NBA players", "sql": "SELECT CAST(AGE AS INTEGER) AS percentile FROM nba_roster ORDER BY percentile LIMIT 1 OFFSET (SELECT COUNT(*) FROM nba_roster) * 0.75;"}
|
|
|
+{"question": "What is the average salary of paid NBA players", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY,' ')-1) AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What age group has the most players in the NBA", "sql": "SELECT AGE, COUNT(*) as count FROM nba_roster GROUP BY AGE ORDER BY count DESC;"}
|
|
|
+{"question": "What is the height of the tallest player on the Los Angeles Lakers", "sql": "SELECT HT, NAME FROM nba_roster WHERE team='Los Angeles Lakers' AND HT!= 'NA' ORDER BY CAST(SUBSTRING(HT, 0, INSTR(HT,'')) AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average salary of the Toronto Raptors players", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS average_salary FROM nba_roster WHERE team='Toronto Raptors';"}
|
|
|
+{"question": "What is the average salary of an NBA player", "sql": "SELECT AVG(CAST(SALARY AS INTEGER) / 1000000) AS average_salary FROM nba_roster;"}
|
|
|
+{"question": "What is the team with the highest average age 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 team has the most players over the age of 25 in the NBA", "sql": "SELECT Team, COUNT(*) FROM nba_roster WHERE AGE > 25 GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of the team with the highest total salary in the NBA", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) AS total_salary, team FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY total_salary DESC;"}
|
|
|
+{"question": "How many players in the NBA are exactly 6 feet tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) = 6 AND HT!= 'NA';"}
|
|
|
+{"question": "What is the age with the most unique players in the NBA", "sql": "SELECT COUNT(DISTINCT AGE) AS age_count, AGE FROM nba_roster GROUP BY AGE ORDER BY age_count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the highest-paid player who did not attend college", "sql": "SELECT name, salary FROM nba_roster WHERE COLLEGE = '--' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Which age group has the most players in the NBA", "sql": "SELECT COUNT(*), AGE FROM nba_roster GROUP BY AGE ORDER BY COUNT(*) DESC;"}
|
|
|
+{"question": "What is the average height in the NBA?", "sql": "SELECT COUNT(*) as num_college_players FROM nba_roster WHERE COLLEGE!= '--';"}
|
|
|
+{"question": "Which 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": "What are the top 10 colleges that have produced 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 10;"}
|
|
|
+{"question": "What is the average age of players from colleges that have multiple players in the NBA", "sql": "SELECT AVG(AGE) AS average_age, COLLEGE FROM nba_roster GROUP BY COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "Which colleges have the most representation in the NBA", "sql": "SELECT COLLEGE, COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "Who are the oldest players in the NBA, excluding those who are above the average age of all players", "sql": "SELECT NAME FROM nba_roster WHERE AGE > (SELECT AVG(AGE) FROM nba_roster) ORDER BY AGE DESC;"}
|
|
|
+{"question": "What are the top 3 highest-paid players on the Toronto Raptors", "sql": "SELECT name, SALARY FROM nba_roster WHERE team='Toronto Raptors' ORDER BY CAST(SUBSTRING(SALARY, 2) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "Which colleges have produced multiple players in the NBA", "sql": "SELECT COLLEGE, COUNT(*) AS num_players FROM nba_roster GROUP BY COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "What is the average salary of NBA players 25 years old or younger", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE CAST(AGE AS INTEGER) <= 25;"}
|
|
|
+{"question": "What is the highest-paid player who has played for more than one team", "sql": "SELECT NAME, TEAM, SALARY FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster) AND (SELECT COUNT(DISTINCT TEAM) FROM nba_roster WHERE NAME = nba_roster.NAME) > 1;"}
|
|
|
+{"question": "Who is the tallest player in the NBA, based on average height", "sql": "SELECT NAME, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')) AS INTEGER)) AS AVG_HEIGHT, COUNT(DISTINCT TEAM) AS TEAM_COUNT FROM nba_roster GROUP BY NAME ORDER BY AVG_HEIGHT DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total weight of all players in the NBA", "sql": "SELECT SUM(CAST(SUBSTR(WT, 1, INSTR(WT,' ')) as INTEGER)) FROM nba_roster;"}
|
|
|
+{"question": "What are the top 10 highest-paid teams in the NBA, based on the average salary of their players", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) as avg_salary, AVG(AGE) as avg_age FROM nba_roster WHERE SALARY!= '--' GROUP BY SALARY ORDER BY avg_salary DESC LIMIT 10;"}
|
|
|
+{"question": "What is the highest salary for each team in the NBA", "sql": "SELECT team, MAX(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) as highest_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team;"}
|
|
|
+{"question": "What is the average age of all players in the NBA who are at least 60 years old", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster WHERE AGE > 5*12;"}
|
|
|
+{"question": "What is the average age of the youngest players in the NBA", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "What are the top 3 teams with 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 3;"}
|
|
|
+{"question": "What is the most popular jersey number in the NBA", "sql": "SELECT Jersey, COUNT(*) as frequency FROM nba_roster WHERE Jersey!= 'NA' GROUP BY Jersey ORDER BY frequency DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of all players in the NBA, excluding those with unknown salaries", "sql": "SELECT SUM(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) as total_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the number of players in the NBA roster who are 10 years or less away from the oldest player in the league", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE AGE + 10 <= (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "Which three teams have 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 height FROM nba_roster GROUP BY team ORDER BY height DESC LIMIT 3;"}
|
|
|
+{"question": "How many players in the NBA are older than 5 years old", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE AGE > 5;"}
|
|
|
+{"question": "What are the 5 teams with the most players from 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 5;"}
|
|
|
+{"question": "What is the number of players in the NBA who are 15 years or younger than the oldest player in the league", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE + 15 <= (SELECT MAX(AGE) FROM nba_roster);"}
|
|
|
+{"question": "What are the minimum and maximum salaries of NBA players", "sql": "SELECT MIN(SALARY) AS min_salary, MAX(SALARY) AS max_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the total salary of all players on the Toronto Raptors who are at least 6 feet 7 inches tall", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE team='Toronto Raptors' AND CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 >= 6.67;"}
|
|
|
+{"question": "What is the height with the most players in the NBA", "sql": "SELECT HT, COUNT(*) as count, AVG(WT) as avg_weight FROM nba_roster GROUP BY HT ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the most common height of NBA players", "sql": "SELECT CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) AS height, COUNT(*) AS count FROM nba_roster GROUP BY CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the total salary of all NBA players with known salaries", "sql": "SELECT SUM(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as total_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the oldest player in the NBA", "sql": "SELECT AVG(AGE) as average_age, NAME from nba_roster GROUP BY NAME ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of NBA players aged 25 or older", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')) as INTEGER)) AS avg_height FROM nba_roster WHERE AGE >= 25;"}
|
|
|
+{"question": "How many players in the NBA are 6'6", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER) = '6' || '6';"}
|
|
|
+{"question": "Who are the oldest players on each team in the NBA, excluding the average age of their team", "sql": "SELECT nba_roster.NAME FROM nba_roster WHERE AGE > (SELECT AVG(AGE) FROM nba_roster WHERE TEAM = nba_roster.TEAM) ORDER BY AGE DESC;"}
|
|
|
+{"question": "What is the most common position played by Jalen Johnson", "sql": "SELECT POS, COUNT(*) AS count, POS FROM nba_roster GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the number of players on each team who are 25 years old or older", "sql": "SELECT team, COUNT(*) AS num_players FROM nba_roster WHERE AGE >= 25 GROUP BY team;"}
|
|
|
+{"question": "What are the top 5 players in the NBA in terms of average height", "sql": "SELECT name, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)) as avg_height FROM nba_roster GROUP BY name ORDER BY avg_height DESC LIMIT 5;"}
|
|
|
+{"question": "What players in the NBA are taller than the average height of all players", "sql": "SELECT NAME FROM nba_roster WHERE HT > (SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12) FROM nba_roster);"}
|
|
|
+{"question": "Which team has the most players 25 years old or older", "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 are the 5 most common jersey numbers in the NBA", "sql": "SELECT COUNT(DISTINCT Jersey), Jersey FROM nba_roster GROUP BY Jersey ORDER BY COUNT(DISTINCT Jersey) DESC LIMIT 5;"}
|
|
|
+{"question": "What colleges are most represented in the NBA", "sql": "SELECT COLLEGE, COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE!= '--' GROUP BY COLLEGE;"}
|
|
|
+{"question": "What is the average salary of NBA players under the age of 25", "sql": "SELECT AVG(CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER)) AS average_salary FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "What are the top 10 teams in the NBA by 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 10;"}
|
|
|
+{"question": "What is the player with the highest salary in the NBA", "sql": "SELECT name, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) AS salary FROM nba_roster WHERE SALARY!= '--' ORDER BY salary DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the oldest player in the NBA who is not a rookie", "sql": "SELECT name, age FROM nba_roster WHERE SALARY!= '--' ORDER BY age DESC LIMIT 1;"}
|
|
|
+{"question": "How many players in the NBA are 6 feet 8 inches or taller", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE CAST(SUBSTRING(HT, 0, INSTR(HT,'')-1) AS INTEGER) >= 68;"}
|
|
|
+{"question": "How many players in the NBA are 25 years old", "sql": "SELECT COUNT(*) FROM nba_roster WHERE age = 25;"}
|
|
|
+{"question": "What is the team with the oldest average age in the NBA", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster GROUP BY TEAM ORDER BY average_age DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the highest-paid player in the NBA, excluding those with unknown salaries", "sql": "SELECT MAX(SALARY) AS highest_salary, NAME FROM nba_roster WHERE SALARY!= '--' GROUP BY NAME ORDER BY highest_salary DESC LIMIT 1;"}
|
|
|
+{"question": "Which team has 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 are the top 3 jersey numbers with the most players in the NBA", "sql": "SELECT jersey, COUNT(*) as count FROM nba_roster WHERE jersey!= 'NA' GROUP BY jersey ORDER BY count DESC LIMIT 3;"}
|
|
|
+{"question": "What percentage of NBA players are at least 6 feet 8 inches tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER) >= 68 AND CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 >= 6.5;"}
|
|
|
+{"question": "What is the average age and height of NBA players, excluding those with unknown heights", "sql": "SELECT AVG(AGE) as average_age, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')) as INTEGER)) as average_height FROM nba_roster WHERE HT!= 'NA';"}
|
|
|
+{"question": "What is the player who has played for the most teams in the NBA", "sql": "SELECT name, COUNT(*) as num_teams FROM nba_roster GROUP BY name ORDER BY num_teams DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average height of players in the NBA who are 25 years or older", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')) as INTEGER)) AS avg_height FROM nba_roster WHERE CAST(AGE as INTEGER) >= 25;"}
|
|
|
+{"question": "Which team has the most unique players in the NBA", "sql": "SELECT COUNT(DISTINCT TEAM), TEAM FROM nba_roster GROUP BY TEAM ORDER BY COUNT(DISTINCT TEAM) DESC LIMIT 1;"}
|
|
|
+{"question": "What are the 5 oldest players in the NBA", "sql": "SELECT NAME, AGE FROM nba_roster ORDER BY AGE DESC LIMIT 5;"}
|
|
|
+{"question": "What is the shortest height of a player in the NBA", "sql": "SELECT name, HT FROM nba_roster ORDER BY LENGTH(HT) LIMIT 1, 1;"}
|
|
|
+{"question": "What is the average height of Power Forwards and Centers 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 average_height FROM nba_roster WHERE POS IN ('PF', 'C');"}
|
|
|
+{"question": "What is the total salary of the team with the highest payroll in the NBA", "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 DESC;"}
|
|
|
+{"question": "What are the top-paid players for each team in the NBA", "sql": "SELECT team, name, CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) as salary FROM nba_roster WHERE SALARY!= '--' GROUP BY team ORDER BY salary DESC;"}
|
|
|
+{"question": "What is the average salary of all NBA players, excluding those with unknown salaries", "sql": "SELECT AVG(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the name and jersey number of the player with the highest jersey number in the NBA roster", "sql": "SELECT NAME, JERSEY FROM nba_roster ORDER BY CAST(JERSEY AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Which five jersey numbers are the most commonly worn by players in the NBA", "sql": "SELECT name, jersey, COUNT(*) as count FROM nba_roster GROUP BY jersey ORDER BY count DESC LIMIT 5;"}
|
|
|
+{"question": "What is the most popular position in the NBA", "sql": "SELECT POS, COUNT(*) AS count FROM nba_roster WHERE POS IN ('PG', 'SG', 'SF', 'PF', 'C') GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "What is the number of players in the NBA who are 68 inches tall", "sql": "SELECT COUNT(*) FROM nba_roster WHERE CAST(SUBSTRING(HT, 0, INSTR(HT,'')) AS INTEGER) = 68;"}
|
|
|
+{"question": "Who is the highest paid player on the team with the most players", "sql": "SELECT NAME FROM nba_roster WHERE SALARY = (SELECT MAX(SALARY) FROM nba_roster) AND TEAM = (SELECT TEAM FROM nba_roster GROUP BY TEAM ORDER BY COUNT(*) DESC LIMIT 1);"}
|
|
|
+{"question": "What is the average height of players on the Toronto Raptors", "sql": "SELECT Team, AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER)) as Average_Height FROM nba_roster GROUP BY Team;"}
|
|
|
+{"question": "What are the top 5 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;"}
|
|
|
+{"question": "What are the top 3 highest-paid players in the NBA", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE SALARY!= '--' ORDER BY CAST(SUBSTR(SALARY, 1, INSTR(SALARY, '$')-1) AS INTEGER) DESC LIMIT 3;"}
|
|
|
+{"question": "How many players in the NBA are 25 years old or younger", "sql": "SELECT COUNT(*) FROM nba_roster WHERE AGE <= 25;"}
|
|
|
+{"question": "How many players in the NBA attended Michigan State University", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE COLLEGE = 'Michigan State';"}
|
|
|
+{"question": "What is the most represented position among University of Michigan alumni in the NBA", "sql": "SELECT POS, COUNT(*) as count FROM nba_roster WHERE COLLEGE='Michigan' GROUP BY POS ORDER BY count DESC LIMIT 1;"}
|
|
|
+{"question": "How many players are on each team in the NBA", "sql": "SELECT TEAM, COUNT(*) AS num_players FROM nba_roster GROUP BY TEAM;"}
|
|
|
+{"question": "What is the number of players in the NBA roster who are more than 5 years older than the average age of all players in the roster", "sql": "SELECT COUNT(*) as num_players FROM nba_roster WHERE AGE - (SELECT AVG(AGE) FROM nba_roster) > 5;"}
|
|
|
+{"question": "What teams have multiple players from the same college", "sql": "SELECT team, COUNT(*) AS num_players, COLLEGE FROM nba_roster GROUP BY team, COLLEGE HAVING COUNT(*) > 1;"}
|
|
|
+{"question": "Which college has the most players on the Brooklyn Nets", "sql": "SELECT team, COUNT(*) AS num_players, COLLEGE FROM nba_roster WHERE COLLEGE!= '--' GROUP BY team, COLLEGE ORDER BY num_players DESC;"}
|
|
|
+{"question": "What is the average age of NBA players who are older than 5 years old", "sql": "SELECT AVG(AGE) AS average_age FROM nba_roster WHERE AGE > 5;"}
|
|
|
+{"question": "What are the 10 players with the tallest and shortest heights in the NBA", "sql": "SELECT name, HT, MAX(CAST(SUBSTRING(HT, 1, INSTR(HT,'')-1) AS INTEGER)) AS max_height, MIN(CAST(SUBSTRING(HT, INSTR(HT,'')+1) AS INTEGER)) AS min_height FROM nba_roster WHERE HT!= 'NA' GROUP BY name ORDER BY max_height DESC, min_height ASC LIMIT 10;"}
|
|
|
+{"question": "What is the age of the oldest player on the Toronto Raptors", "sql": "SELECT name, age FROM nba_roster WHERE team='Toronto Raptors' ORDER BY age DESC LIMIT 1;"}
|
|
|
+{"question": "What are the top 5 highest-paid college-educated players in the NBA", "sql": "SELECT NAME, SALARY FROM nba_roster WHERE COLLEGE!= '--' AND SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 5;"}
|
|
|
+{"question": "What is the number of players in the NBA roster who do not have a college listed", "sql": "SELECT COUNT(*) AS num_players FROM nba_roster WHERE COLLEGE = '--';"}
|
|
|
+{"question": "What is the number of players on the Toronto Raptors who earn more than $10,000,000", "sql": "SELECT COUNT(*) FROM nba_roster WHERE team='Toronto Raptors' AND CAST(SUBSTRING(SALARY, 2) AS INTEGER) > 10000000;"}
|
|
|
+{"question": "What is the average height and age of NBA players, and how do these values vary by height", "sql": "SELECT AVG(CAST(SUBSTR(HT, 1, INSTR(HT,'')-1) AS INTEGER)) AS average_height, AVG(AGE) AS average_age FROM nba_roster GROUP BY CAST(SUBSTR(HT, INSTR(HT,'')+1) AS INTEGER);"}
|
|
|
+{"question": "What is the most frequently worn jersey number in the NBA", "sql": "SELECT COUNT(DISTINCT Jersey) AS total_jerseys, Jersey FROM nba_roster GROUP BY Jersey ORDER BY total_jerseys DESC LIMIT 1;"}
|
|
|
+{"question": "What is the average age of all players in the NBA who have a known salary", "sql": "SELECT AVG(AGE) FROM nba_roster WHERE SALARY!= '--';"}
|
|
|
+{"question": "What is the 99th percentile 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 != '--')*99/100-1;"}
|
|
|
+{"question": "What is the 75th percentile 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 != '--')*75/100-1;"}
|
|
|
+{"question": "What is the 25th percentile 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 != '--')*25/100-1;"}
|
|
|
+{"question": "What is the median weight in the NBA?", "sql": "select CAST(SUBSTR(WT, 1, INSTR(WT,' ')) as INTEGER) as percentile from nba_roster order by percentile limit 1 offset (select count(*) from nba_roster)/2;"}
|
|
|
+{"question": "What is the average weight in the NBA?", "sql": "SELECT AVG(CAST(SUBSTR(WT, 1, INSTR(WT,' ')) as INTEGER)) FROM nba_roster;"}
|
|
|
+{"question": "What is the median height in the NBA?", "sql": "select CAST(SUBSTR(HT, 1, INSTR(HT,' ')-1) AS INTEGER)+ CAST(SUBSTR(HT, INSTR(HT,' ')+1) AS FLOAT)/12 as percentile from nba_roster order by percentile limit 1 offset (select count(*) from nba_roster)/2;"}
|
|
|
+{"question": "Can you tell me how many players are in the NBA?", "sql": "select count(*) from nba_roster;"}
|
|
|
+{"question": "Would you please let me know what the highest paid players are for each position?", "sql": "SELECT name, pos, MAX(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as max_salary FROM nba_roster WHERE SALARY!= '--' GROUP BY POS;"}
|
|
|
+{"question": "Is Jalen Johnson 23 years old?", "sql": "Select name, age from nba_roster where name='Jalen Johnson';"}
|
|
|
+{"question": "Who is the oldest player on the Brooklyn Nets?", "sql": "SELECT NAME FROM nba_roster WHERE TEAM = 'Brooklyn Nets' AND AGE = (SELECT MAX(AGE) FROM nba_roster WHERE TEAM = 'Brooklyn Nets');"}
|
|
|
+{"question": "Who has the higest salary on the Memphis Grizzlies?", "sql": "select salary, name from nba_roster where team='Memphis Grizzlies' and SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Which player has the higest salary on the Cleveland Cavaliers?", "sql": "select salary, name from nba_roster where team='Cleveland Cavaliers' and SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "Who is the highest paid center on the Dallas Mavericks?", "sql": "select salary, name from nba_roster where team='Dallas Mavericks' and POS='C' and SALARY!= '--' ORDER BY CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER) DESC LIMIT 1;"}
|
|
|
+{"question": "How much is Marcus Smart getting paid?", "sql": "select salary from nba_roster where name='Marcus Smart';"}
|
|
|
+{"question": "What's the average age of the Trail Blazers?", "sql": "select avg(age) from nba_roster where team='Portland Trail Blazers';"}
|
|
|
+{"question": "What's the median age of the NBA?", "sql": "select CAST(AGE as INTEGER) as percentile from nba_roster order by percentile limit 1 offset (select count(*) from nba_roster)/2;"}
|
|
|
+{"question": "What's the median age of the Miami Heat?", "sql": "select CAST(AGE as INTEGER) as percentile from nba_roster where team='Miami Heat' order by percentile limit 1 offset (select count(*) from nba_roster where team='Miami Heat')/2;"}
|