question: What is the 99th percentile salary in the NBA?

answer: 46741590

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?

answer: 13932008

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?

answer: 2413304

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?

answer: 215

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?

answer: 214.98

sql: SELECT AVG(CAST(SUBSTR(WT, 1, INSTR(WT,' ')) as INTEGER)) FROM nba_roster;


question: What is the median height in the NBA?

answer: 6.58333333333333

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: What is the average height in the NBA?

answer: 6.54986111111111

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;


question: Can you tell me how many players are in the NBA?

answer: 600

sql: select count(*) from nba_roster;


question: Would you please let me know what the highest paid players are for each position?

answer: The highest paid players are Nikola Jokic (C), Paul George (F), Norman Powell (G), Kevin Durant (PF), Stephen Curry (PG), LeBron James (SF), Bradley Beal (SG).

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?

answer: No, Jalen Johnson is 21 years old

sql: Select name, age from nba_roster where name='Jalen Johnson';


question: Who is the oldest player on the Brooklyn Nets?

answer: Spencer Dinwiddie, Dorian Finney-Smith, Royce O'Neale

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 highest salary on the Memphis Grizzlies?

answer: Ja Morant

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 highest salary on the Cleveland Cavaliers?

answer: Darius Garland

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?

answer: Dereck Lively II

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?

answer: $18,833,712

sql: select salary from nba_roster where name='Marcus Smart';


question: What's the average age of the Trail Blazers?

answer: 24

sql: select avg(age) from nba_roster where team='Portland Trail Blazers';


question: What's the median age of the NBA?

answer: 25

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?

answer: 26

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;


question: What are the 5 teams with the oldest average age in the NBA

answer: Golden State Warriors, Milwaukee Bucks, Miami Heat, LA Clippers, Phoenix Suns

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 Power Forward players in the NBA

answer: $10948045

sql: select avg(CAST(REPLACE(REPLACE(SALARY, '$', ''), ',','') AS INTEGER)) as average_salary from nba_roster where POS = 'PF';