ppg PPG
built from sum(pts) sum(games)
Points per game played.
from nba.players select player, ppg group by player order by ppg desc limit 10
nbafrom nba readsnba.player_gamesPG Point guard · SG Shooting guard · SF Small forward · PF Power forward · C Center · G Guard · F Forwardnba.players Player seasons (league)One row per player per season since 1996-97 — the league's own dashboards, with the plus-minus models beside them.
from nba.players select player, team, games, pts, reb, ast, ts_pct, usg_pct, net_rating order by pts desc limit 100
player-season)nba_player_seasons NBA Stats, hoopRplayer team games pts reb ast ts_pct usg_pct net_ratingpts descseasonseasonsptswhere season_type = Playoffs to change it.clubs says how many he played for, and nba.player_team_seasons splits it.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
the position column |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. The club he finished the season at — |
clubs
|
#Clubs | integermeasure |
How many clubs he played for that season. How many clubs he played for that season |
position
completes position
|
Pos | stringdimension |
The position he started at. |
age
|
Age | integermeasure |
His age that season. |
college
|
College | stringdimension |
Where he played before the NBA. |
country
completes country
|
Ctry | stringdimension |
The country he is listed as from. |
height_inches
|
Ht | integermeasure |
Height in inches. Height in inches |
weight_lb
|
Wt | integermeasure |
Weight in pounds. |
experience
|
Exp | integermeasure |
Seasons of NBA experience before this one. Seasons of NBA experience |
games
|
GP | integermeasure |
Games he played in. NBA.com |
wins
|
W | integermeasure |
Wins. |
losses
lower is better
|
L | integermeasure |
Losses. |
minutes
|
MIN | numbermeasure |
Minutes he was on the floor. NBA.com Total minutes played |
pts
|
PTS | integermeasure |
Points scored. NBA.com |
reb
|
REB | integermeasure |
Rebounds. NBA.com |
oreb
|
OREB | integermeasure |
Rebounds of the shooting team's own misses. NBA.com |
dreb
|
DREB | integermeasure |
Rebounds of the opponent's misses. NBA.com |
ast
|
AST | integermeasure |
Assists — passes that led directly to a basket. NBA.com |
stl
|
STL | integermeasure |
Steals. NBA.com |
blk
|
BLK | integermeasure |
Shots blocked. NBA.com |
tov
lower is better
|
TOV | integermeasure |
Turnovers. NBA.com |
pf
lower is better
|
PF | integermeasure |
Fouls committed. NBA.com |
fgm
|
FGM | integermeasure |
Field goals made — every basket except a free throw. NBA.com |
fga
|
FGA | integermeasure |
Field goals attempted. NBA.com |
fg3m
|
3PM | integermeasure |
Three-pointers made. NBA.com |
fg3a
|
3PA | integermeasure |
Three-pointers attempted. NBA.com |
ftm
|
FTM | integermeasure |
Free throws made. NBA.com |
fta
|
FTA | integermeasure |
Free throws attempted. NBA.com |
fg_pct
|
FG% | numbermeasure |
Share of field goals that went in. NBA.com |
fg3_pct
|
3P% | numbermeasure |
Share of three-pointers that went in. NBA.com |
ft_pct
|
FT% | numbermeasure |
Share of free throws that went in. NBA.com |
plus_minus
|
+/- | integermeasure |
How much the club outscored the opponent by over the minutes counted. NBA.com |
off_rating
|
ORtg | numbermeasure |
Points scored per 100 possessions while on the floor. NBA.com Points his club scored per 100 possessions he was on the floor for |
def_rating
lower is better
|
DRtg | numbermeasure |
Points allowed per 100 possessions while on the floor. NBA.com |
net_rating
|
NetRtg | numbermeasure |
Offensive rating less defensive rating. NBA.com |
ts_pct
|
TS% | numbermeasure |
True shooting percentage — points per scoring possession, counting twos, threes and free throws together. The single fairest measure of how efficiently a player scores. NBA.com |
efg_pct
|
eFG% | numbermeasure |
Effective field goal percentage — shooting percentage with a three counted as a basket and a half, because it is worth that. NBA.com |
usg_pct
|
USG% | numbermeasure |
Usage rate — the share of the club's possessions finished while on the floor, by shooting, drawing a foul or turning it over. NBA.com Share of his club's possessions he ended while on the floor |
ast_pct
|
AST% | numbermeasure |
Share of the baskets assisted while on the floor. NBA.com |
reb_pct
|
REB% | numbermeasure |
Share of the available rebounds taken while on the floor. NBA.com |
oreb_pct
|
OREB% | numbermeasure |
Share of the available offensive rebounds taken while on the floor. NBA.com |
dreb_pct
|
DREB% | numbermeasure |
Share of the available defensive rebounds taken while on the floor. NBA.com |
ast_to
|
AST/TO | numbermeasure |
Assists per turnover. NBA.com |
ast_ratio
|
AST Ratio | numbermeasure |
Assists per hundred possessions he used. |
tov_pct
lower is better
|
TOV% | numbermeasure |
Share of the possessions he used that ended in a turnover. |
pace
|
Pace | numbermeasure |
Possessions per 48 minutes — how fast the game was played. NBA.com |
pie
|
PIE | numbermeasure |
Player impact estimate — a share of everything statistical that happened in the game, as one percentage. NBA.com His share of everything both clubs did in the games he played |
poss
|
Poss | integermeasure |
Possessions he was on the floor for. Possessions he was on the floor for |
rapm
|
RAPM | numbermeasure |
Regularized adjusted plus-minus: his effect on the scoreboard per hundred possessions, once every teammate and opponent on the floor is accounted for. Regularized adjusted plus-minus: his effect per 100 possessions once every teammate and opponent is accounted for RAPM starts in 1997 |
o_rapm
|
O-RAPM | numbermeasure |
The offensive half of RAPM. O-RAPM starts in 1997 |
d_rapm
|
D-RAPM | numbermeasure |
The defensive half of RAPM. D-RAPM starts in 1997 |
adj_rapm
|
Adj RAPM | numbermeasure |
RAPM with a prior applied, which is what keeps a small sample from reading as a superstar. RAPM with a prior, which is what makes a small sample behave Adj RAPM starts in 1997 |
bpm
|
BPM | numbermeasure |
Box plus-minus: the same question asked of the box score alone. Box plus-minus — the same question asked of the box score alone BPM starts in 1997 |
obpm
|
OBPM | numbermeasure |
The offensive half of box plus-minus. OBPM starts in 1997 |
dbpm
|
DBPM | numbermeasure |
The defensive half of box plus-minus. DBPM starts in 1997 |
spm
|
SPM | numbermeasure |
Statistical plus-minus — a box-score estimate of his effect per hundred possessions. Statistical plus-minus SPM starts in 1997 |
war
|
WAR | numbermeasure |
Wins above a replacement-level player. It sums, so a career total is Wins above a replacement-level player — sums, so a career total is WAR starts in 1997 |
darko
|
DARKO | numbermeasure |
A skill estimate that updates game by game rather than settling at the season's end. A skill estimate that updates game by game rather than settling at the season's end DARKO starts in 1997 |
pts_paint
|
Paint | integermeasure |
Points scored in the paint. |
pts_fb
|
FB | integermeasure |
Points scored on the fast break. Fast-break points |
pts_off_tov
|
Off TOV | integermeasure |
Points scored off the opponent's turnovers. |
pts_2nd_chance
|
2nd | integermeasure |
Points scored after an offensive rebound. |
pct_pts_3pt
|
%Pts 3 | numbermeasure |
Share of his points that came from three. Share of his points that came from threes |
pct_pts_paint
|
%Pts Paint | numbermeasure |
Share of his points scored in the paint. |
pct_pts_ft
|
%Pts FT | numbermeasure |
Share of his points from the free-throw line. |
pct_fga_3pt
|
%FGA 3 | numbermeasure |
Share of his attempts that were threes. Share of his attempts that were threes |
pct_uast_fgm
|
%Unast | numbermeasure |
Share of his made field goals nobody assisted — the shots he created himself. Share of his made shots nobody assisted |
pct_ast_fgm
|
%Ast | numbermeasure |
Share of his made field goals that somebody assisted. |
pct_pts
|
%Team Pts | numbermeasure |
Share of his club's points. Share of his club's points |
pct_reb
|
%Team Reb | numbermeasure |
Share of his club's rebounds. |
pct_ast
|
%Team Ast | numbermeasure |
Share of his club's assists. |
dd2
|
DD | integermeasure |
Double-doubles — ten or more in two of points, rebounds, assists, steals and blocks. Double-doubles |
td3
|
TD | integermeasure |
Triple-doubles. Triple-doubles |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
ppg PPGbuilt from sum(pts) sum(games)
Points per game played.
from nba.players select player, ppg group by player order by ppg desc limit 10
rpg RPGbuilt from sum(reb) sum(games)
Rebounds per game played.
from nba.players select player, rpg group by player order by rpg desc limit 10
apg APGbuilt from sum(ast) sum(games)
Assists per game played.
from nba.players select player, apg group by player order by apg desc limit 10
mpg MPGbuilt from sum(minutes) sum(games)
Minutes per game. NBA.com
from nba.players select player, mpg group by player order by mpg desc limit 10
fromThe one table a query reads
from nba.players select player, team, games, pts, reb, ast, ts_pct, usg_pct, net_rating order by pts desc limit 100
selectThe columns the answer carries
from nba.players select player, team, games, pts, reb, ast, ts_pct, usg_pct, net_rating order by pts desc limit 100
asRenames a column's heading and nothing else
from nba.players select player, team, games as GP order by games desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.players where season = $year select player, team, games order by games desc limit 10
limitHow many rows come back
from nba.players select player, team, games, pts, reb, ast, ts_pct, usg_pct, net_rating order by pts desc limit 100
order byWhich end of the answer comes first
from nba.players select player, team, games order by games desc limit 10
#A comment, to the end of the line
# Player seasons (league) — One row per player per season since 1996-97 — the league's own dashboards, with the plus-minus models beside them. from nba.players select player, team, games, pts, reb, ast, ts_pct, usg_pct, net_rating order by pts desc limit 100
whereChooses the rows the question is about
from nba.players where season = 2026 select player, games order by games desc limit 10
andContinues whichever filter clause came last
from nba.players where season = 2026 and games > 0 select player, games order by games desc limit 10
havingFilters the groups a fold made
from nba.players select player, sum(games) group by player having sum(games) > 0 order by sum(games) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.players where season = 2026 select player, games, games_percentile keep games_percentile >= 90 order by games_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.players select player, season, games highlight season = 2026 order by games desc limit 10
ofA threshold that is another row rather than a number
from nba.players where games >= max(games) of position PG select player, games order by games desc limit 10
group byFolds the rows sharing these keys into one
from nba.players select player, count(*), sum(games) group by player order by sum(games) desc limit 10
thenFolds the answer a second time
from nba.players select player, team, count(*) group by player, team having count(*) > 10 then select player, count(*) as Teams group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.players select player, team, sum(games) group by player, team pivot by team limit 25
first / lastOnly part of each career, before anything else runs
from nba.players first 3 seasons select player, sum(games) group by player order by sum(games) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.players select player, sum(games) group by player order by sum(games) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.players select player, avg(games) group by player order by avg(games) desc limit 10
min(…)The smallest value in each group
from nba.players select player, min(games) group by player order by min(games) desc limit 10
max(…)The largest value in each group
from nba.players select player, max(games) group by player order by max(games) desc limit 10
count(…)How many rows a group swallowed
from nba.players select player, count(games) group by player order by count(games) desc limit 10
distinct(…)How many different values a group holds
from nba.players select player, distinct(team) group by player order by distinct(team) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.players where season = 2026 select player, only(team) group by player order by only(team) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.players select player, latest(player) group by player order by count(*) desc limit 10
top(…)The value on the group's biggest row
from nba.players select player, top(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.players select player, mean(games) group by player order by mean(games) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.players select player, median(games) group by player order by median(games) desc limit 10
mode(…)The commonest value in the group
from nba.players select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.players where season = 2026 select player, games, games_percentile order by games_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.players select player, sum(games), percentile(sum(games)) group by player order by sum(games) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.players where season = 2026 select player, games, standing(games) order by games desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.players where season = 2026 select player, clubs, age, composite(clubs, age) order by composite(clubs, age) desc limit 10
ratio(…)One column divided by another
from nba.players select player, count(*), ratio(sum(games), count(*)) group by player order by ratio(sum(games), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.players where season = 2026 select player, clubs, age, calc(standing(clubs) - standing(age)) order by calc(standing(clubs) - standing(age)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.players select player, games, format(games, > 0 -> "on the board", <= 0 -> "nothing yet") order by games desc limit 10
pairDraws two columns of the answer in one
from nba.players where season = 2026 select player, games, games_percentile pair games with games_percentile order by games desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.players where season = 2026 select player, clubs, age, height_inches, composite(clubs, age, height_inches) as Score hint composite(clubs, age, height_inches) as "#Clubs + Age + Ht" order by composite(clubs, age, height_inches) desc limit 10
year(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.player_games Player box scoresOne row per player per game, traditional and advanced together.
from nba.player_games select game_date, player, team, minutes, pts, reb, ast, ts_pct order by pts desc limit 200
player-game)nba_player_games NBA Stats, hoopRgame_date player team minutes pts reb ast ts_pctpts descseasonseasons game_dates gamesgame_datewhere season_type = Playoffs to change it.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
the position column |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
game_date
|
Date | datedimension |
The date the game was played. |
position
completes position
|
Pos | stringdimension |
The position he started at. The position he is listed at |
minutes
|
MIN | numbermeasure |
Minutes he was on the floor. NBA.com Minutes played, as a decimal |
played
|
Played | booleandimension |
Whether he actually got on the floor. Whether he actually appeared — false for a did-not-play row |
pts
|
PTS | integermeasure |
Points scored. NBA.com |
reb
|
REB | integermeasure |
Rebounds. NBA.com |
oreb
|
OREB | integermeasure |
Rebounds of the shooting team's own misses. NBA.com |
dreb
|
DREB | integermeasure |
Rebounds of the opponent's misses. NBA.com |
ast
|
AST | integermeasure |
Assists — passes that led directly to a basket. NBA.com |
stl
|
STL | integermeasure |
Steals. NBA.com |
blk
|
BLK | integermeasure |
Shots blocked. NBA.com |
tov
lower is better
|
TOV | integermeasure |
Turnovers. NBA.com |
pf
lower is better
|
PF | integermeasure |
Fouls committed. NBA.com |
fgm
|
FGM | integermeasure |
Field goals made — every basket except a free throw. NBA.com |
fga
|
FGA | integermeasure |
Field goals attempted. NBA.com |
fg3m
|
3PM | integermeasure |
Three-pointers made. NBA.com |
fg3a
|
3PA | integermeasure |
Three-pointers attempted. NBA.com |
ftm
|
FTM | integermeasure |
Free throws made. NBA.com |
fta
|
FTA | integermeasure |
Free throws attempted. NBA.com |
fg_pct
|
FG% | numbermeasure |
Share of field goals that went in. NBA.com |
fg3_pct
|
3P% | numbermeasure |
Share of three-pointers that went in. NBA.com |
ft_pct
|
FT% | numbermeasure |
Share of free throws that went in. NBA.com |
efg_pct
|
eFG% | numbermeasure |
Effective field goal percentage — shooting percentage with a three counted as a basket and a half, because it is worth that. NBA.com |
ts_pct
|
TS% | numbermeasure |
True shooting percentage — points per scoring possession, counting twos, threes and free throws together. The single fairest measure of how efficiently a player scores. NBA.com |
usg_pct
|
USG% | numbermeasure |
Usage rate — the share of the club's possessions finished while on the floor, by shooting, drawing a foul or turning it over. NBA.com |
reb_pct
|
REB% | numbermeasure |
Share of the available rebounds taken while on the floor. NBA.com |
oreb_pct
|
OREB% | numbermeasure |
Share of the available offensive rebounds taken while on the floor. NBA.com |
dreb_pct
|
DREB% | numbermeasure |
Share of the available defensive rebounds taken while on the floor. NBA.com |
ast_pct
|
AST% | numbermeasure |
Share of the baskets assisted while on the floor. NBA.com |
ast_to
|
AST/TO | numbermeasure |
Assists per turnover. NBA.com |
off_rating
|
ORtg | numbermeasure |
Points scored per 100 possessions while on the floor. NBA.com |
def_rating
lower is better
|
DRtg | numbermeasure |
Points allowed per 100 possessions while on the floor. NBA.com |
net_rating
|
NetRtg | numbermeasure |
Offensive rating less defensive rating. NBA.com |
pace
|
Pace | numbermeasure |
Possessions per 48 minutes — how fast the game was played. NBA.com |
pie
|
PIE | numbermeasure |
Player impact estimate — a share of everything statistical that happened in the game, as one percentage. NBA.com |
plus_minus
|
+/- | integermeasure |
How much the club outscored the opponent by over the minutes counted. NBA.com |
production
|
Prod | integermeasure |
Points, rebounds, assists, steals and blocks less turnovers, as one count. PTS + REB + AST + STL + BLK − TOV A box-score total, not a rating — it weights a rebound like a point |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.player_games select game_date, player, team, minutes, pts, reb, ast, ts_pct order by pts desc limit 200
selectThe columns the answer carries
from nba.player_games select game_date, player, team, minutes, pts, reb, ast, ts_pct order by pts desc limit 200
asRenames a column's heading and nothing else
from nba.player_games select game_date, player, minutes as MIN order by minutes desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.player_games where season = $year select game_date, player, team order by minutes desc limit 10
limitHow many rows come back
from nba.player_games select game_date, player, team, minutes, pts, reb, ast, ts_pct order by pts desc limit 200
order byWhich end of the answer comes first
from nba.player_games select game_date, player, team, minutes order by minutes desc limit 10
#A comment, to the end of the line
# Player box scores — One row per player per game, traditional and advanced together. from nba.player_games select game_date, player, team, minutes, pts, reb, ast, ts_pct order by pts desc limit 200
whereChooses the rows the question is about
from nba.player_games where season = 2026 select player, minutes order by minutes desc limit 10
andContinues whichever filter clause came last
from nba.player_games where season = 2026 and minutes > 0 select player, minutes order by minutes desc limit 10
havingFilters the groups a fold made
from nba.player_games select player, sum(minutes) group by player having sum(minutes) > 0 order by sum(minutes) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.player_games where season = 2026 select player, minutes, minutes_percentile keep minutes_percentile >= 90 order by minutes_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.player_games select player, season, minutes highlight season = 2026 order by minutes desc limit 10
ofA threshold that is another row rather than a number
from nba.player_games where minutes >= max(minutes) of position PG select player, minutes order by minutes desc limit 10
group byFolds the rows sharing these keys into one
from nba.player_games select player, count(*), sum(minutes) group by player order by sum(minutes) desc limit 10
thenFolds the answer a second time
from nba.player_games select player, team, count(*) group by player, team having count(*) > 10 then select player, count(*) as Teams group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.player_games select player, team, sum(minutes) group by player, team pivot by team limit 25
first / lastOnly part of each career, before anything else runs
from nba.player_games first 3 seasons select player, sum(minutes) group by player order by sum(minutes) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.player_games select player, sum(minutes) group by player order by sum(minutes) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.player_games select player, avg(minutes) group by player order by avg(minutes) desc limit 10
min(…)The smallest value in each group
from nba.player_games select player, min(minutes) group by player order by min(minutes) desc limit 10
max(…)The largest value in each group
from nba.player_games select player, max(minutes) group by player order by max(minutes) desc limit 10
count(…)How many rows a group swallowed
from nba.player_games select player, count(minutes) group by player order by count(minutes) desc limit 10
distinct(…)How many different values a group holds
from nba.player_games select player, distinct(team) group by player order by distinct(team) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.player_games where season = 2026 select player, only(team) group by player order by only(team) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.player_games select player, latest(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.player_games select player, mean(minutes) group by player order by mean(minutes) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.player_games select player, median(minutes) group by player order by median(minutes) desc limit 10
mode(…)The commonest value in the group
from nba.player_games select player, mode(player) group by player order by count(*) desc limit 10
year(…)Reads a date as the year it falls in
from nba.player_games select player, year(game_date), sum(minutes) group by player, year(game_date) order by year(game_date) asc limit 20
quarter(…)Reads a date as the quarter it falls in
from nba.player_games select player, quarter(game_date), sum(minutes) group by player, quarter(game_date) order by quarter(game_date) asc limit 20
month(…)Reads a date as the month it falls in
from nba.player_games select player, month(game_date), sum(minutes) group by player, month(game_date) order by month(game_date) asc limit 20
week(…)Reads a date as the week it falls in
from nba.player_games select player, week(game_date), sum(minutes) group by player, week(game_date) order by week(game_date) asc limit 20
as_of(…)The stat as it stood, season to date
from nba.player_games where season = 2026 select player, month(game_date), as_of(minutes) group by player, month(game_date) order by month(game_date) asc limit 25
<stat>_percentileWhere a row sits in its population, 0-100
from nba.player_games where season = 2026 select player, minutes, minutes_percentile order by minutes_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.player_games select player, sum(minutes), percentile(sum(minutes)) group by player order by sum(minutes) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.player_games where season = 2026 select player, minutes, standing(minutes) order by minutes desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.player_games where season = 2026 select player, minutes, pts, composite(minutes, pts) order by composite(minutes, pts) desc limit 10
ratio(…)One column divided by another
from nba.player_games select player, count(*), ratio(sum(minutes), count(*)) group by player order by ratio(sum(minutes), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.player_games where season = 2026 select player, minutes, pts, calc(standing(minutes) - standing(pts)) order by calc(standing(minutes) - standing(pts)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.player_games select player, minutes, format(minutes, > 0 -> "on the board", <= 0 -> "nothing yet") order by minutes desc limit 10
pairDraws two columns of the answer in one
from nba.player_games where season = 2026 select player, minutes, minutes_percentile pair minutes with minutes_percentile order by minutes desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.player_games where season = 2026 select player, minutes, pts, reb, composite(minutes, pts, reb) as Score hint composite(minutes, pts, reb) as "MIN + PTS + REB" order by composite(minutes, pts, reb) desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to picknba.teams Club seasonsOne row per club per season since 1996-97: its own line, its opponents', and the four factors.
from nba.teams select team, season, wins, losses, off_rating, def_rating, net_rating, pace order by net_rating desc limit 100
team-season)nba_team_seasons NBA Stats, hoopRteam season wins losses off_rating def_rating net_rating pacenet_rating descseasonseasonswinswhere season_type = Playoffs to change it.off_rating and def_rating are per 100 possessions, so they compare across eras that played at different speeds — unlike points per game, which does not.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
A club season has no player — query nba.players |
position |
A club season has no position |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
team
completes team
|
Team | stringdimension |
The club. |
team_name
|
Club | stringdimension |
The club's full name. |
conference
completes conference
|
Conf | stringdimension |
East or West. |
division
completes division
|
Div | stringdimension |
The division the club plays in. |
playoff_rank
lower is better
|
Seed | integermeasure |
Where the club seeded in its conference. Where it seeded in its conference |
games
|
GP | integermeasure |
Games he played in. NBA.com |
wins
|
W | integermeasure |
Wins. |
losses
lower is better
|
L | integermeasure |
Losses. |
win_pct
|
W% | numbermeasure |
Wins as a share of games played. |
minutes
|
MIN | numbermeasure |
Minutes he was on the floor. NBA.com |
pts
|
PTS | integermeasure |
Points scored. NBA.com |
reb
|
REB | integermeasure |
Rebounds. NBA.com |
oreb
|
OREB | integermeasure |
Rebounds of the shooting team's own misses. NBA.com |
dreb
|
DREB | integermeasure |
Rebounds of the opponent's misses. NBA.com |
ast
|
AST | integermeasure |
Assists — passes that led directly to a basket. NBA.com |
stl
|
STL | integermeasure |
Steals. NBA.com |
blk
|
BLK | integermeasure |
Shots blocked. NBA.com |
tov
lower is better
|
TOV | integermeasure |
Turnovers. NBA.com |
pf
lower is better
|
PF | integermeasure |
Fouls committed. NBA.com |
fgm
|
FGM | integermeasure |
Field goals made — every basket except a free throw. NBA.com |
fga
|
FGA | integermeasure |
Field goals attempted. NBA.com |
fg3m
|
3PM | integermeasure |
Three-pointers made. NBA.com |
fg3a
|
3PA | integermeasure |
Three-pointers attempted. NBA.com |
ftm
|
FTM | integermeasure |
Free throws made. NBA.com |
fta
|
FTA | integermeasure |
Free throws attempted. NBA.com |
fg_pct
|
FG% | numbermeasure |
Share of field goals that went in. NBA.com |
fg3_pct
|
3P% | numbermeasure |
Share of three-pointers that went in. NBA.com |
ft_pct
|
FT% | numbermeasure |
Share of free throws that went in. NBA.com |
plus_minus
|
+/- | integermeasure |
How much the club outscored the opponent by over the minutes counted. NBA.com |
off_rating
|
ORtg | numbermeasure |
Points scored per 100 possessions while on the floor. NBA.com |
def_rating
lower is better
|
DRtg | numbermeasure |
Points allowed per 100 possessions while on the floor. NBA.com |
net_rating
|
NetRtg | numbermeasure |
Offensive rating less defensive rating. NBA.com |
pace
|
Pace | numbermeasure |
Possessions per 48 minutes — how fast the game was played. NBA.com |
poss
|
Poss | integermeasure |
Possessions he was on the floor for. |
ts_pct
|
TS% | numbermeasure |
True shooting percentage — points per scoring possession, counting twos, threes and free throws together. The single fairest measure of how efficiently a player scores. NBA.com |
efg_pct
|
eFG% | numbermeasure |
Effective field goal percentage — shooting percentage with a three counted as a basket and a half, because it is worth that. NBA.com |
reb_pct
|
REB% | numbermeasure |
Share of the available rebounds taken while on the floor. NBA.com |
oreb_pct
|
OREB% | numbermeasure |
Share of the available offensive rebounds taken while on the floor. NBA.com |
tov_pct
lower is better
|
TOV% | numbermeasure |
Share of the possessions he used that ended in a turnover. |
ast_to
|
AST/TO | numbermeasure |
Assists per turnover. NBA.com |
pie
|
PIE | numbermeasure |
Player impact estimate — a share of everything statistical that happened in the game, as one percentage. NBA.com |
fta_rate
|
FTA Rate | numbermeasure |
Free-throw attempts per field-goal attempt — how often a club gets to the line. Free-throw attempts per field-goal attempt |
opp_efg_pct
lower is better
|
Opp eFG% | numbermeasure |
The opponents' effective field-goal percentage — one of the four factors. |
opp_tov_pct
|
Opp TOV% | numbermeasure |
Share of opponent possessions that ended in a turnover — one of the four factors. Share of opponent possessions it forced a turnover on |
opp_oreb_pct
lower is better
|
Opp OREB% | numbermeasure |
Share of their own misses the opponents rebounded. |
opp_fta_rate
lower is better
|
Opp FTA Rate | numbermeasure |
How often the opponents got to the line, per field-goal attempt. |
opp_pts
lower is better
|
Opp Pts | integermeasure |
Points the opponents scored. |
opp_fgm
lower is better
|
Opp FGM | integermeasure |
Field goals the opponents made. |
opp_fga
|
Opp FGA | integermeasure |
Field goals the opponents attempted. |
opp_fg_pct
lower is better
|
Opp FG% | numbermeasure |
The opponents' field-goal percentage. |
opp_fg3m
lower is better
|
Opp 3PM | integermeasure |
Threes the opponents made. |
opp_fg3_pct
lower is better
|
Opp 3P% | numbermeasure |
The opponents' three-point percentage. |
opp_reb
lower is better
|
Opp Reb | integermeasure |
Rebounds the opponents took. |
opp_ast
lower is better
|
Opp Ast | integermeasure |
Assists the opponents recorded. |
opp_turnovers
|
Opp TOV | integermeasure |
Times the opponents lost the ball. |
pts_paint
|
Paint | integermeasure |
Points scored in the paint. |
pts_fb
|
FB | integermeasure |
Points scored on the fast break. |
pts_off_tov
|
Off TOV | integermeasure |
Points scored off the opponent's turnovers. |
pts_2nd_chance
|
2nd | integermeasure |
Points scored after an offensive rebound. |
pct_pts_3pt
|
%Pts 3 | numbermeasure |
Share of his points that came from three. |
pct_pts_paint
|
%Pts Paint | numbermeasure |
Share of his points scored in the paint. |
pct_ast_fgm
|
%Ast | numbermeasure |
Share of his made field goals that somebody assisted. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
ppg PPGbuilt from sum(pts) sum(games)
Points per game played.
from nba.teams select team, ppg group by team order by ppg desc limit 10
opp_ppg Opp PPGbuilt from sum(opp_pts) sum(games)
Points allowed per game.
from nba.teams select team, opp_ppg group by team order by opp_ppg desc limit 10
fromThe one table a query reads
from nba.teams select team, season, wins, losses, off_rating, def_rating, net_rating, pace order by net_rating desc limit 100
selectThe columns the answer carries
from nba.teams select team, season, wins, losses, off_rating, def_rating, net_rating, pace order by net_rating desc limit 100
asRenames a column's heading and nothing else
from nba.teams select team, season, wins as W order by wins desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.teams where season = $year select team, season, wins order by wins desc limit 10
limitHow many rows come back
from nba.teams select team, season, wins, losses, off_rating, def_rating, net_rating, pace order by net_rating desc limit 100
order byWhich end of the answer comes first
from nba.teams select team, season, wins order by wins desc limit 10
#A comment, to the end of the line
# Club seasons — One row per club per season since 1996-97: its own line, its opponents', and the four factors. from nba.teams select team, season, wins, losses, off_rating, def_rating, net_rating, pace order by net_rating desc limit 100
whereChooses the rows the question is about
from nba.teams where season = 2026 select team, wins order by wins desc limit 10
andContinues whichever filter clause came last
from nba.teams where season = 2026 and wins > 0 select team, wins order by wins desc limit 10
havingFilters the groups a fold made
from nba.teams select team, sum(wins) group by team having sum(wins) > 0 order by sum(wins) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.teams where season = 2026 select team, wins, wins_percentile keep wins_percentile >= 90 order by wins_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.teams select team, season, wins highlight season = 2026 order by wins desc limit 10
ofA threshold that is another row rather than a number
from nba.teams where wins >= max(wins) of season 2026 select team, wins order by wins desc limit 10
group byFolds the rows sharing these keys into one
from nba.teams select team, count(*), sum(wins) group by team order by sum(wins) desc limit 10
thenFolds the answer a second time
from nba.teams select team, season, count(*) group by team, season having count(*) > 10 then select team, count(*) as Seasons group by team order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.teams select team, season, sum(wins) group by team, season pivot by season limit 25
first / lastOnly part of each career, before anything else runs
from nba.teams first 3 seasons select team, sum(wins) group by team order by sum(wins) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.teams select team, sum(wins) group by team order by sum(wins) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.teams select team, avg(wins) group by team order by avg(wins) desc limit 10
min(…)The smallest value in each group
from nba.teams select team, min(wins) group by team order by min(wins) desc limit 10
max(…)The largest value in each group
from nba.teams select team, max(wins) group by team order by max(wins) desc limit 10
count(…)How many rows a group swallowed
from nba.teams select team, count(wins) group by team order by count(wins) desc limit 10
distinct(…)How many different values a group holds
from nba.teams select team, distinct(season) group by team order by distinct(season) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.teams where season = 2026 select team, only(season) group by team order by only(season) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.teams select team, latest(team) group by team order by count(*) desc limit 10
top(…)The value on the group's biggest row
from nba.teams select team, top(team) group by team order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.teams select team, mean(wins) group by team order by mean(wins) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.teams select team, median(wins) group by team order by median(wins) desc limit 10
mode(…)The commonest value in the group
from nba.teams select team, mode(team) group by team order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.teams where season = 2026 select team, wins, wins_percentile order by wins_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.teams select team, sum(wins), percentile(sum(wins)) group by team order by sum(wins) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.teams where season = 2026 select team, wins, standing(wins) order by wins desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.teams where season = 2026 select team, playoff_rank, games, composite(playoff_rank, games) order by composite(playoff_rank, games) desc limit 10
ratio(…)One column divided by another
from nba.teams select team, count(*), ratio(sum(wins), count(*)) group by team order by ratio(sum(wins), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.teams where season = 2026 select team, playoff_rank, games, calc(standing(playoff_rank) - standing(games)) order by calc(standing(playoff_rank) - standing(games)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.teams select team, wins, format(wins, > 0 -> "on the board", <= 0 -> "nothing yet") order by wins desc limit 10
pairDraws two columns of the answer in one
from nba.teams where season = 2026 select team, wins, wins_percentile pair wins with wins_percentile order by wins desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.teams where season = 2026 select team, playoff_rank, games, wins, composite(playoff_rank, games, wins) as Score hint composite(playoff_rank, games, wins) as "Seed + GP + W" order by composite(playoff_rank, games, wins) desc limit 10
year(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.team_games Team box scoresOne row per team per game.
from nba.team_games select game_date, team, opponent, pts, opp_pts, off_rating, def_rating, pace order by game_date desc limit 200
team-game)nba_team_games NBA Stats, hoopRgame_date team opponent pts opp_pts off_rating def_rating pacegame_date descseasonseasons game_dates gamesgame_datewhere season_type = Playoffs to change it.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
This dataset is one row per team — query nba.player_games for players |
position |
Positions belong to players, and this dataset has no players |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
team
completes team
|
Team | stringdimension |
The club. |
game_date
|
Date | datedimension |
The date the game was played. |
home
|
Home | booleandimension |
Whether this club was at home. |
pts
|
PTS | integermeasure |
Points scored. NBA.com |
reb
|
REB | integermeasure |
Rebounds. NBA.com |
oreb
|
OREB | integermeasure |
Rebounds of the shooting team's own misses. NBA.com |
dreb
|
DREB | integermeasure |
Rebounds of the opponent's misses. NBA.com |
ast
|
AST | integermeasure |
Assists — passes that led directly to a basket. NBA.com |
stl
|
STL | integermeasure |
Steals. NBA.com |
blk
|
BLK | integermeasure |
Shots blocked. NBA.com |
tov
lower is better
|
TOV | integermeasure |
Turnovers. NBA.com |
pf
lower is better
|
PF | integermeasure |
Fouls committed. NBA.com |
fgm
|
FGM | integermeasure |
Field goals made — every basket except a free throw. NBA.com |
fga
|
FGA | integermeasure |
Field goals attempted. NBA.com |
fg3m
|
3PM | integermeasure |
Three-pointers made. NBA.com |
fg3a
|
3PA | integermeasure |
Three-pointers attempted. NBA.com |
ftm
|
FTM | integermeasure |
Free throws made. NBA.com |
fta
|
FTA | integermeasure |
Free throws attempted. NBA.com |
fg_pct
|
FG% | numbermeasure |
Share of field goals that went in. NBA.com |
fg3_pct
|
3P% | numbermeasure |
Share of three-pointers that went in. NBA.com |
ft_pct
|
FT% | numbermeasure |
Share of free throws that went in. NBA.com |
efg_pct
|
eFG% | numbermeasure |
Effective field goal percentage — shooting percentage with a three counted as a basket and a half, because it is worth that. NBA.com |
ts_pct
|
TS% | numbermeasure |
True shooting percentage — points per scoring possession, counting twos, threes and free throws together. The single fairest measure of how efficiently a player scores. NBA.com |
usg_pct
|
USG% | numbermeasure |
Usage rate — the share of the club's possessions finished while on the floor, by shooting, drawing a foul or turning it over. NBA.com |
reb_pct
|
REB% | numbermeasure |
Share of the available rebounds taken while on the floor. NBA.com |
oreb_pct
|
OREB% | numbermeasure |
Share of the available offensive rebounds taken while on the floor. NBA.com |
dreb_pct
|
DREB% | numbermeasure |
Share of the available defensive rebounds taken while on the floor. NBA.com |
ast_pct
|
AST% | numbermeasure |
Share of the baskets assisted while on the floor. NBA.com |
ast_to
|
AST/TO | numbermeasure |
Assists per turnover. NBA.com |
off_rating
|
ORtg | numbermeasure |
Points scored per 100 possessions while on the floor. NBA.com |
def_rating
lower is better
|
DRtg | numbermeasure |
Points allowed per 100 possessions while on the floor. NBA.com |
net_rating
|
NetRtg | numbermeasure |
Offensive rating less defensive rating. NBA.com |
pace
|
Pace | numbermeasure |
Possessions per 48 minutes — how fast the game was played. NBA.com |
pie
|
PIE | numbermeasure |
Player impact estimate — a share of everything statistical that happened in the game, as one percentage. NBA.com |
plus_minus
|
+/- | integermeasure |
How much the club outscored the opponent by over the minutes counted. NBA.com |
won
|
W | integermeasure |
Whether the club won. 1 if the club won this game, taken from the final margin A game with no margin recorded counts for neither side |
opponent
completes team
|
Opp | stringdimension |
The other club. |
opp_pts
lower is better
|
Opp Pts | integermeasure |
Points the opponents scored. |
margin
|
Marg | integermeasure |
Points scored less points allowed in this game. Points scored less points allowed |
off_poss
|
Off Poss | integermeasure |
Possessions the club had the ball for. Possessions the club had the ball for |
def_poss
|
Def Poss | integermeasure |
Possessions the club defended. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
fromThe one table a query reads
from nba.team_games select game_date, team, opponent, pts, opp_pts, off_rating, def_rating, pace order by game_date desc limit 200
selectThe columns the answer carries
from nba.team_games select game_date, team, opponent, pts, opp_pts, off_rating, def_rating, pace order by game_date desc limit 200
asRenames a column's heading and nothing else
from nba.team_games select game_date, team, pts as PTS order by pts desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.team_games where season = $year select game_date, team, opponent order by pts desc limit 10
limitHow many rows come back
from nba.team_games select game_date, team, opponent, pts, opp_pts, off_rating, def_rating, pace order by game_date desc limit 200
order byWhich end of the answer comes first
from nba.team_games select game_date, team, opponent, pts order by pts desc limit 10
#A comment, to the end of the line
# Team box scores — One row per team per game. from nba.team_games select game_date, team, opponent, pts, opp_pts, off_rating, def_rating, pace order by game_date desc limit 200
whereChooses the rows the question is about
from nba.team_games where season = 2026 select team, pts order by pts desc limit 10
andContinues whichever filter clause came last
from nba.team_games where season = 2026 and pts > 0 select team, pts order by pts desc limit 10
havingFilters the groups a fold made
from nba.team_games select team, sum(pts) group by team having sum(pts) > 0 order by sum(pts) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.team_games where season = 2026 select team, pts, pts_percentile keep pts_percentile >= 90 order by pts_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.team_games select team, season, pts highlight season = 2026 order by pts desc limit 10
ofA threshold that is another row rather than a number
from nba.team_games where pts >= max(pts) of season 2026 select team, pts order by pts desc limit 10
group byFolds the rows sharing these keys into one
from nba.team_games select team, count(*), sum(pts) group by team order by sum(pts) desc limit 10
thenFolds the answer a second time
from nba.team_games select team, opponent, count(*) group by team, opponent having count(*) > 10 then select team, count(*) as Opps group by team order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.team_games select team, opponent, sum(pts) group by team, opponent pivot by opponent limit 25
first / lastOnly part of each career, before anything else runs
from nba.team_games first 3 seasons select team, sum(pts) group by team order by sum(pts) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.team_games select team, sum(pts) group by team order by sum(pts) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.team_games select team, avg(pts) group by team order by avg(pts) desc limit 10
min(…)The smallest value in each group
from nba.team_games select team, min(pts) group by team order by min(pts) desc limit 10
max(…)The largest value in each group
from nba.team_games select team, max(pts) group by team order by max(pts) desc limit 10
count(…)How many rows a group swallowed
from nba.team_games select team, count(pts) group by team order by count(pts) desc limit 10
distinct(…)How many different values a group holds
from nba.team_games select team, distinct(game_date) group by team order by distinct(game_date) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.team_games where season = 2026 select team, only(game_date) group by team order by only(game_date) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.team_games select team, latest(team) group by team order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.team_games select team, mean(pts) group by team order by mean(pts) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.team_games select team, median(pts) group by team order by median(pts) desc limit 10
mode(…)The commonest value in the group
from nba.team_games select team, mode(team) group by team order by count(*) desc limit 10
year(…)Reads a date as the year it falls in
from nba.team_games select team, year(game_date), sum(pts) group by team, year(game_date) order by year(game_date) asc limit 20
quarter(…)Reads a date as the quarter it falls in
from nba.team_games select team, quarter(game_date), sum(pts) group by team, quarter(game_date) order by quarter(game_date) asc limit 20
month(…)Reads a date as the month it falls in
from nba.team_games select team, month(game_date), sum(pts) group by team, month(game_date) order by month(game_date) asc limit 20
week(…)Reads a date as the week it falls in
from nba.team_games select team, week(game_date), sum(pts) group by team, week(game_date) order by week(game_date) asc limit 20
as_of(…)The stat as it stood, season to date
from nba.team_games where season = 2026 select team, month(game_date), as_of(pts) group by team, month(game_date) order by month(game_date) asc limit 25
<stat>_percentileWhere a row sits in its population, 0-100
from nba.team_games where season = 2026 select team, pts, pts_percentile order by pts_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.team_games select team, sum(pts), percentile(sum(pts)) group by team order by sum(pts) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.team_games where season = 2026 select team, pts, standing(pts) order by pts desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.team_games where season = 2026 select team, pts, reb, composite(pts, reb) order by composite(pts, reb) desc limit 10
ratio(…)One column divided by another
from nba.team_games select team, count(*), ratio(sum(pts), count(*)) group by team order by ratio(sum(pts), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.team_games where season = 2026 select team, pts, reb, calc(standing(pts) - standing(reb)) order by calc(standing(pts) - standing(reb)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.team_games select team, pts, format(pts, > 0 -> "on the board", <= 0 -> "nothing yet") order by pts desc limit 10
pairDraws two columns of the answer in one
from nba.team_games where season = 2026 select team, pts, pts_percentile pair pts with pts_percentile order by pts desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.team_games where season = 2026 select team, pts, reb, oreb, composite(pts, reb, oreb) as Score hint composite(pts, reb, oreb) as "PTS + REB + OREB" order by composite(pts, reb, oreb) desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to picknba.standings StandingsWhere every club finished, with the splits the league keeps beside it.
from nba.standings select team, conference, wins, losses, win_pct, playoff_rank, streak, diff_points_pg order by win_pct desc limit 40
team-season)nba_standings NBA Stats, hoopRteam conference wins losses win_pct playoff_rank streak diff_points_pgwin_pct descseasonseasonswins| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
The standings have no player |
position |
The standings have no position |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
team
completes team
|
Team | stringdimension |
The club. |
team_name
|
Club | stringdimension |
The club's full name. |
conference
completes conference
|
Conf | stringdimension |
East or West. |
division
completes division
|
Div | stringdimension |
The division the club plays in. |
wins
|
W | integermeasure |
Wins. |
losses
lower is better
|
L | integermeasure |
Losses. |
win_pct
|
W% | numbermeasure |
Wins as a share of games played. |
playoff_rank
lower is better
|
Seed | integermeasure |
Where the club seeded in its conference. |
division_rank
lower is better
|
Div# | integermeasure |
Where the club finished in its division. |
record
|
Record | stringdimension |
The club's record, as the league writes it. |
home
|
Home | stringdimension |
Whether this club was at home. |
road
|
Road | stringdimension |
Its record away from home. |
l10
|
L10 | stringdimension |
Its record over the last ten games. |
streak
|
Streak | stringdimension |
Its current run of wins or losses. |
conference_record
|
Conf rec | stringdimension |
Its record against the conference. |
division_record
|
Div rec | stringdimension |
Its record against the division. |
clinch
|
Clinch | stringdimension |
The league's clinch letter for that club. |
long_win_streak
|
Long W | integermeasure |
Its longest winning run of the season. |
long_loss_streak
lower is better
|
Long L | integermeasure |
Its longest losing run of the season. |
points_pg
|
PPG | numbermeasure |
Points per game. |
opp_points_pg
lower is better
|
Opp PPG | numbermeasure |
Points allowed per game. |
diff_points_pg
|
Diff | numbermeasure |
Points scored less points allowed, per game. |
ahead_at_half
|
Ahead H | stringdimension |
Its record when leading at half-time. Record when leading at half-time |
behind_at_half
|
Behind H | stringdimension |
Its record when trailing at half-time. |
three_pts_or_less
|
≤3 pts | stringdimension |
Its record in games decided by three points or fewer. Record in games decided by three or fewer |
ten_pts_or_more
|
≥10 pts | stringdimension |
Its record in games decided by ten or more. |
vs_east
|
vs East | stringdimension |
Its record against the Eastern Conference. |
vs_west
|
vs West | stringdimension |
Its record against the Western Conference. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.standings select team, conference, wins, losses, win_pct, playoff_rank, streak, diff_points_pg order by win_pct desc limit 40
selectThe columns the answer carries
from nba.standings select team, conference, wins, losses, win_pct, playoff_rank, streak, diff_points_pg order by win_pct desc limit 40
asRenames a column's heading and nothing else
from nba.standings select team, conference, wins as W order by wins desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.standings where season = $year select team, conference, wins order by wins desc limit 10
limitHow many rows come back
from nba.standings select team, conference, wins, losses, win_pct, playoff_rank, streak, diff_points_pg order by win_pct desc limit 40
order byWhich end of the answer comes first
from nba.standings select team, conference, wins order by wins desc limit 10
#A comment, to the end of the line
# Standings — Where every club finished, with the splits the league keeps beside it. from nba.standings select team, conference, wins, losses, win_pct, playoff_rank, streak, diff_points_pg order by win_pct desc limit 40
whereChooses the rows the question is about
from nba.standings where season = 2026 select team, wins order by wins desc limit 10
andContinues whichever filter clause came last
from nba.standings where season = 2026 and wins > 0 select team, wins order by wins desc limit 10
havingFilters the groups a fold made
from nba.standings select team, sum(wins) group by team having sum(wins) > 0 order by sum(wins) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.standings where season = 2026 select team, wins, wins_percentile keep wins_percentile >= 90 order by wins_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.standings select team, season, wins highlight season = 2026 order by wins desc limit 10
ofA threshold that is another row rather than a number
from nba.standings where wins >= max(wins) of season 2026 select team, wins order by wins desc limit 10
group byFolds the rows sharing these keys into one
from nba.standings select team, count(*), sum(wins) group by team order by sum(wins) desc limit 10
thenFolds the answer a second time
from nba.standings select team, conference, count(*) group by team, conference having count(*) > 10 then select team, count(*) as Confs group by team order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.standings select team, conference, sum(wins) group by team, conference pivot by conference limit 25
first / lastOnly part of each career, before anything else runs
from nba.standings first 3 seasons select team, sum(wins) group by team order by sum(wins) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.standings select team, sum(wins) group by team order by sum(wins) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.standings select team, avg(wins) group by team order by avg(wins) desc limit 10
min(…)The smallest value in each group
from nba.standings select team, min(wins) group by team order by min(wins) desc limit 10
max(…)The largest value in each group
from nba.standings select team, max(wins) group by team order by max(wins) desc limit 10
count(…)How many rows a group swallowed
from nba.standings select team, count(wins) group by team order by count(wins) desc limit 10
distinct(…)How many different values a group holds
from nba.standings select team, distinct(conference) group by team order by distinct(conference) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.standings where season = 2026 select team, only(conference) group by team order by only(conference) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.standings select team, latest(team) group by team order by count(*) desc limit 10
top(…)The value on the group's biggest row
from nba.standings select team, top(team) group by team order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.standings select team, mean(wins) group by team order by mean(wins) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.standings select team, median(wins) group by team order by median(wins) desc limit 10
mode(…)The commonest value in the group
from nba.standings select team, mode(team) group by team order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.standings where season = 2026 select team, wins, wins_percentile order by wins_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.standings select team, sum(wins), percentile(sum(wins)) group by team order by sum(wins) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.standings where season = 2026 select team, wins, standing(wins) order by wins desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.standings where season = 2026 select team, wins, losses, composite(wins, losses) order by composite(wins, losses) desc limit 10
ratio(…)One column divided by another
from nba.standings select team, count(*), ratio(sum(wins), count(*)) group by team order by ratio(sum(wins), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.standings where season = 2026 select team, wins, losses, calc(standing(wins) - standing(losses)) order by calc(standing(wins) - standing(losses)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.standings select team, wins, format(wins, > 0 -> "on the board", <= 0 -> "nothing yet") order by wins desc limit 10
pairDraws two columns of the answer in one
from nba.standings where season = 2026 select team, wins, wins_percentile pair wins with wins_percentile order by wins desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.standings where season = 2026 select team, wins, losses, win_pct, composite(wins, losses, win_pct) as Score hint composite(wins, losses, win_pct) as "W + L + W%" order by composite(wins, losses, win_pct) desc limit 10
year(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.tracking TrackingWhat the cameras measured, per player per season — drives, touches, passes, contested rebounds, speed and distance.
from nba.tracking select player, team, games, drives, drive_pts, touches, pts_per_touch, dist_miles order by drives desc limit 100
player-season)nba_player_tracking NBA Stats, hoopRplayer team games drives drive_pts touches pts_per_touch dist_milesdrives descseasonseasonstoucheswhere season_type = Playoffs to change it.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
the position column |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
position
completes position
|
Pos | stringdimension |
The position he started at. |
games
|
GP | integermeasure |
Games he played in. NBA.com |
minutes
|
MIN | numbermeasure |
Minutes he was on the floor. NBA.com |
catch_shoot_fga
|
C&S FGA | integermeasure |
Shots taken without dribbling, at least ten feet out. |
catch_shoot_pts
|
C&S Pts | integermeasure |
Points scored catching and shooting. |
catch_shoot_efg
|
C&S eFG% | numbermeasure |
Effective field-goal percentage catching and shooting. |
pull_up_fga
|
Pull FGA | integermeasure |
Shots taken off the dribble, at least ten feet out. |
pull_up_pts
|
Pull Pts | integermeasure |
Points scored pulling up. |
pull_up_efg
|
Pull eFG% | numbermeasure |
Effective field-goal percentage pulling up. |
drives
|
Drives | integermeasure |
Drives — a touch that started at least twenty feet out and ended within ten. Drives starts in 2013 |
drive_pts
|
Drive Pts | integermeasure |
Points he scored on drives. Drive Pts starts in 2013 |
drive_fg_pct
|
Drive FG% | numbermeasure |
His shooting percentage on drives. Drive FG% starts in 2013 |
drive_ast
|
Drive Ast | integermeasure |
Assists he made out of a drive. Drive Ast starts in 2013 |
touches
|
Touches | integermeasure |
Times he touched the ball. Touches starts in 2013 |
front_ct_touches
|
FC Touches | integermeasure |
Touches in the front court. Touches in the front court FC Touches starts in 2013 |
time_of_poss
|
Time | numbermeasure |
Minutes he spent holding the ball. Minutes of possession Time starts in 2013 |
avg_sec_per_touch
|
Sec/Touch | numbermeasure |
Seconds he held the ball on an average touch. Sec/Touch starts in 2013 |
pts_per_touch
|
Pts/Touch | numbermeasure |
Points his club scored per touch he took. Pts/Touch starts in 2013 |
paint_touches
|
Paint | integermeasure |
Touches in the paint with his back to or facing the basket. Paint starts in 2013 |
post_touches
|
Post | integermeasure |
Touches with his back to the basket outside the paint. Post starts in 2013 |
elbow_touches
|
Elbow | integermeasure |
Touches at the elbow. Elbow starts in 2013 |
pts_per_paint_touch
|
Pts/Paint | numbermeasure |
Points his club scored per paint touch of his. Pts/Paint starts in 2013 |
pts_per_post_touch
|
Pts/Post | numbermeasure |
Points his club scored per post touch of his. Pts/Post starts in 2013 |
passes_made
|
Passes | integermeasure |
Passes he threw. Passes starts in 2013 |
potential_ast
|
Pot Ast | integermeasure |
Passes that would have been assists had the shot gone in. Passes that would have been assists had the shot gone in Pot Ast starts in 2013 |
secondary_ast
|
2nd Ast | integermeasure |
The pass before the assist — the hockey assist. The pass before the assist 2nd Ast starts in 2013 |
ast_pts_created
|
Ast Pts | integermeasure |
Points his assists produced. Ast Pts starts in 2013 |
ast_to_pass_pct
|
Ast/Pass | numbermeasure |
Share of his passes that became assists. Ast/Pass starts in 2013 |
reb_chances
|
Reb Chances | integermeasure |
Rebounds that came within three and a half feet of him. Rebounds within his reach Reb Chances starts in 2013 |
reb_chance_pct
|
Reb Conv% | numbermeasure |
Share of the rebounds within reach that he took. Share of the rebounds within reach he took Reb Conv% starts in 2013 |
reb_contest
|
Cont Reb | integermeasure |
Rebounds he took with an opponent within three and a half feet. Rebounds taken with an opponent within a metre Cont Reb starts in 2013 |
reb_contest_pct
|
Cont% | numbermeasure |
Share of his rebounds that were contested. Cont% starts in 2013 |
avg_reb_dist
|
Reb Dist | numbermeasure |
Average feet from the basket he rebounded from. Average feet from the basket he rebounded from Reb Dist starts in 2013 |
dist_miles
|
Miles | numbermeasure |
Miles he travelled on the floor. Miles travelled Miles starts in 2013 |
dist_miles_off
|
Mi Off | numbermeasure |
Miles travelled on offence. Mi Off starts in 2013 |
dist_miles_def
|
Mi Def | numbermeasure |
Miles travelled on defence. Mi Def starts in 2013 |
avg_speed
|
Speed | numbermeasure |
His average speed in miles per hour. Average miles per hour Speed starts in 2013 |
avg_speed_off
|
Speed Off | numbermeasure |
Average speed on offence. Speed Off starts in 2013 |
avg_speed_def
|
Speed Def | numbermeasure |
Average speed on defence. Speed Def starts in 2013 |
def_rim_fga
|
Rim FGA | integermeasure |
Shots at the rim he was the closest defender on. Shots at the rim he defended Rim FGA starts in 2013 |
def_rim_fg_pct
lower is better
|
Rim FG% | numbermeasure |
What those shooters made against him. Rim FG% starts in 2013 |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.tracking select player, team, games, drives, drive_pts, touches, pts_per_touch, dist_miles order by drives desc limit 100
selectThe columns the answer carries
from nba.tracking select player, team, games, drives, drive_pts, touches, pts_per_touch, dist_miles order by drives desc limit 100
asRenames a column's heading and nothing else
from nba.tracking select player, team, games as GP order by games desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.tracking where season = $year select player, team, games order by games desc limit 10
limitHow many rows come back
from nba.tracking select player, team, games, drives, drive_pts, touches, pts_per_touch, dist_miles order by drives desc limit 100
order byWhich end of the answer comes first
from nba.tracking select player, team, games order by games desc limit 10
#A comment, to the end of the line
# Tracking — What the cameras measured, per player per season — drives, touches, passes, contested rebounds, speed and distance. from nba.tracking select player, team, games, drives, drive_pts, touches, pts_per_touch, dist_miles order by drives desc limit 100
whereChooses the rows the question is about
from nba.tracking where season = 2026 select player, games order by games desc limit 10
andContinues whichever filter clause came last
from nba.tracking where season = 2026 and games > 0 select player, games order by games desc limit 10
havingFilters the groups a fold made
from nba.tracking select player, sum(games) group by player having sum(games) > 0 order by sum(games) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.tracking where season = 2026 select player, games, games_percentile keep games_percentile >= 90 order by games_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.tracking select player, season, games highlight season = 2026 order by games desc limit 10
ofA threshold that is another row rather than a number
from nba.tracking where games >= max(games) of position PG select player, games order by games desc limit 10
group byFolds the rows sharing these keys into one
from nba.tracking select player, count(*), sum(games) group by player order by sum(games) desc limit 10
thenFolds the answer a second time
from nba.tracking select player, team, count(*) group by player, team having count(*) > 10 then select player, count(*) as Teams group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.tracking select player, team, sum(games) group by player, team pivot by team limit 25
first / lastOnly part of each career, before anything else runs
from nba.tracking first 3 seasons select player, sum(games) group by player order by sum(games) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.tracking select player, sum(games) group by player order by sum(games) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.tracking select player, avg(games) group by player order by avg(games) desc limit 10
min(…)The smallest value in each group
from nba.tracking select player, min(games) group by player order by min(games) desc limit 10
max(…)The largest value in each group
from nba.tracking select player, max(games) group by player order by max(games) desc limit 10
count(…)How many rows a group swallowed
from nba.tracking select player, count(games) group by player order by count(games) desc limit 10
distinct(…)How many different values a group holds
from nba.tracking select player, distinct(team) group by player order by distinct(team) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.tracking where season = 2026 select player, only(team) group by player order by only(team) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.tracking select player, latest(player) group by player order by count(*) desc limit 10
top(…)The value on the group's biggest row
from nba.tracking select player, top(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.tracking select player, mean(games) group by player order by mean(games) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.tracking select player, median(games) group by player order by median(games) desc limit 10
mode(…)The commonest value in the group
from nba.tracking select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.tracking where season = 2026 select player, games, games_percentile order by games_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.tracking select player, sum(games), percentile(sum(games)) group by player order by sum(games) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.tracking where season = 2026 select player, games, standing(games) order by games desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.tracking where season = 2026 select player, games, minutes, composite(games, minutes) order by composite(games, minutes) desc limit 10
ratio(…)One column divided by another
from nba.tracking select player, count(*), ratio(sum(games), count(*)) group by player order by ratio(sum(games), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.tracking where season = 2026 select player, games, minutes, calc(standing(games) - standing(minutes)) order by calc(standing(games) - standing(minutes)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.tracking select player, games, format(games, > 0 -> "on the board", <= 0 -> "nothing yet") order by games desc limit 10
pairDraws two columns of the answer in one
from nba.tracking where season = 2026 select player, games, games_percentile pair games with games_percentile order by games desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.tracking where season = 2026 select player, games, minutes, catch_shoot_fga, composite(games, minutes, catch_shoot_fga) as Score hint composite(games, minutes, catch_shoot_fga) as "GP + MIN + C&S FGA" order by composite(games, minutes, catch_shoot_fga) desc limit 10
year(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.shots ShotsEvery shot since 1996-97 with where it was taken from — about 230,000 a season.
from nba.shots select game_date, player, team, shot_type, distance, made, points order by distance desc limit 200
player-shot)nba_shots NBA Stats, hoopRgame_date player team shot_type distance made pointsdistance descseasonseasons game_dates shotsgame_datedistancewhere season_type = Playoffs to change it.x runs sideline to sideline and y out from the baseline, so a corner three is a large |x| and a small y.fg_pct and efg_pct are folds over the rows the query matched — filter to a player, a zone or a distance and they answer for that.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
A shot carries no position — query nba.players |
season |
the season column |
shot_typethis sport only |
the shot_type column |
periodthis sport only |
the period column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
game_date
|
Date | datedimension |
The date the game was played. |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
opponent
completes team
|
Opp | stringdimension |
The other club. |
home
|
H/A | booleandimension |
Whether this club was at home. |
period
|
Per | integermeasure |
The quarter, with overtime continuing the count — 5 is the first overtime. |
seconds_remaining
|
Sec | numbermeasure |
Seconds left in the period when it happened. Seconds left in the period |
shot_type
completes shot_type
|
Type | stringdimension |
How the league described the attempt — Jump Shot, Driving Layup, Step Back Jump Shot. The league's description of the attempt — Jump Shot, Driving Layup, Step Back Jump Shot |
shot_value
|
Pts if made | integermeasure |
What the shot was worth if it went in: two or three. 2 or 3 |
distance
|
Dist | numbermeasure |
Feet from the basket. Feet from the basket |
x
|
X | numbermeasure |
Feet across the court from the basket; negative is to the shooter's left looking at it. Feet across the court from the basket — negative is left of it |
y
|
Y | numbermeasure |
Feet out from the baseline. Feet out from the baseline |
made
|
Made | booleandimension |
Whether it went in. |
points
|
Pts | integermeasure |
What the attempt was worth — zero if it missed. What the shot was worth — 0 if it missed |
fg_pct
|
FG% | numbermeasure |
Share of field goals that went in. NBA.com Share of these shots that went in |
efg_pct
|
eFG% | numbermeasure |
Effective field goal percentage — shooting percentage with a three counted as a basket and a half, because it is worth that. NBA.com Shooting percentage with a three counted one and a half times |
pts_per_shot
|
Pts/Shot | numbermeasure |
Points per shot attempt. |
description
|
Shot | stringdimension |
The league's own description of the play. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.shots select game_date, player, team, shot_type, distance, made, points order by distance desc limit 200
selectThe columns the answer carries
from nba.shots select game_date, player, team, shot_type, distance, made, points order by distance desc limit 200
asRenames a column's heading and nothing else
from nba.shots select game_date, player, distance as Dist order by distance desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.shots where season = $year select game_date, player, team order by distance desc limit 10
limitHow many rows come back
from nba.shots select game_date, player, team, shot_type, distance, made, points order by distance desc limit 200
order byWhich end of the answer comes first
from nba.shots select game_date, player, team, distance order by distance desc limit 10
#A comment, to the end of the line
# Shots — Every shot since 1996-97 with where it was taken from — about 230,000 a season. from nba.shots select game_date, player, team, shot_type, distance, made, points order by distance desc limit 200
whereChooses the rows the question is about
from nba.shots where season = 2026 select player, distance order by distance desc limit 10
andContinues whichever filter clause came last
from nba.shots where season = 2026 and distance > 0 select player, distance order by distance desc limit 10
havingFilters the groups a fold made
from nba.shots select player, sum(distance) group by player having sum(distance) > 0 order by sum(distance) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.shots where season = 2026 select player, distance, distance_percentile keep distance_percentile >= 90 order by distance_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.shots select player, season, distance highlight season = 2026 order by distance desc limit 10
ofA threshold that is another row rather than a number
from nba.shots where distance >= max(distance) of season 2026 select player, distance order by distance desc limit 10
group byFolds the rows sharing these keys into one
from nba.shots select player, count(*), sum(distance) group by player order by sum(distance) desc limit 10
thenFolds the answer a second time
from nba.shots select player, team, count(*) group by player, team having count(*) > 10 then select player, count(*) as Teams group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.shots select player, team, sum(distance) group by player, team pivot by team limit 25
first / lastOnly part of each career, before anything else runs
from nba.shots first 3 seasons select player, sum(distance) group by player order by sum(distance) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.shots select player, sum(distance) group by player order by sum(distance) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.shots select player, avg(distance) group by player order by avg(distance) desc limit 10
min(…)The smallest value in each group
from nba.shots select player, min(distance) group by player order by min(distance) desc limit 10
max(…)The largest value in each group
from nba.shots select player, max(distance) group by player order by max(distance) desc limit 10
count(…)How many rows a group swallowed
from nba.shots select player, count(distance) group by player order by count(distance) desc limit 10
distinct(…)How many different values a group holds
from nba.shots select player, distinct(game_date) group by player order by distinct(game_date) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.shots where season = 2026 select player, only(game_date) group by player order by only(game_date) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.shots select player, latest(player) group by player order by count(*) desc limit 10
top(…)The value on the group's biggest row
from nba.shots select player, top(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.shots select player, mean(distance) group by player order by mean(distance) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.shots select player, median(distance) group by player order by median(distance) desc limit 10
mode(…)The commonest value in the group
from nba.shots select player, mode(player) group by player order by count(*) desc limit 10
year(…)Reads a date as the year it falls in
from nba.shots select player, year(game_date), sum(distance) group by player, year(game_date) order by year(game_date) asc limit 20
quarter(…)Reads a date as the quarter it falls in
from nba.shots select player, quarter(game_date), sum(distance) group by player, quarter(game_date) order by quarter(game_date) asc limit 20
month(…)Reads a date as the month it falls in
from nba.shots select player, month(game_date), sum(distance) group by player, month(game_date) order by month(game_date) asc limit 20
week(…)Reads a date as the week it falls in
from nba.shots select player, week(game_date), sum(distance) group by player, week(game_date) order by week(game_date) asc limit 20
as_of(…)The stat as it stood, season to date
from nba.shots where season = 2026 select player, month(game_date), as_of(distance) group by player, month(game_date) order by month(game_date) asc limit 25
<stat>_percentileWhere a row sits in its population, 0-100
from nba.shots where season = 2026 select player, distance, distance_percentile order by distance_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.shots select player, sum(distance), percentile(sum(distance)) group by player order by sum(distance) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.shots where season = 2026 select player, distance, standing(distance) order by distance desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.shots where season = 2026 select player, period, seconds_remaining, composite(period, seconds_remaining) order by composite(period, seconds_remaining) desc limit 10
ratio(…)One column divided by another
from nba.shots select player, count(*), ratio(sum(distance), count(*)) group by player order by ratio(sum(distance), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.shots where season = 2026 select player, period, seconds_remaining, calc(standing(period) - standing(seconds_remaining)) order by calc(standing(period) - standing(seconds_remaining)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.shots select player, distance, format(distance, > 0 -> "on the board", <= 0 -> "nothing yet") order by distance desc limit 10
pairDraws two columns of the answer in one
from nba.shots where season = 2026 select player, distance, distance_percentile pair distance with distance_percentile order by distance desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.shots where season = 2026 select player, period, seconds_remaining, shot_value, composite(period, seconds_remaining, shot_value) as Score hint composite(period, seconds_remaining, shot_value) as "Per + Sec + Pts if made" order by composite(period, seconds_remaining, shot_value) desc limit 10
nba.possessions PossessionsEvery possession since 1996-97: how it started, what it produced, and the ten players on the floor.
from nba.possessions select game_date, team, opponent, period, start_type, length_seconds, points order by points desc limit 200
team-possession)nba_possessions NBA Stats, hoopRgame_date team opponent period start_type length_seconds pointspoints descseasonseasons game_dates possessionsgame_datepointswhere season_type = Playoffs to change it.counts is false for the possessions a pace or rating denominator leaves out — a heave at the buzzer, an end-of-quarter inbound.group by off_player_1 is a real grouping.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
A possession has ten players — query nba.shots for the shooter, or nba.players |
position |
A possession carries no position |
season |
the season column |
periodthis sport only |
the period column |
start_typethis sport only |
the start_type column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
season_type
completes season_type
|
Type | stringdimension |
Whether the game was a regular-season, play-in or playoff game. Regular Season, Playoffs or PlayIn |
game_date
|
Date | datedimension |
The date the game was played. |
team
completes team
|
Team | stringdimension |
The club. The club with the ball |
opponent
completes team
|
Opp | stringdimension |
The other club. |
period
|
Per | integermeasure |
The quarter, with overtime continuing the count — 5 is the first overtime. |
start_type
completes possession_start_type
|
Start | stringdimension |
How the possession began — off a miss, a make, a turnover or a dead ball. OffMissedShot, OffMadeShot, OffTurnover, OffDeadball, OffRebound |
points
|
Pts | integermeasure |
What the attempt was worth — zero if it missed. |
counts
|
Counts | booleandimension |
Whether it counts against a pace or rating denominator. A heave at the buzzer does not. Whether it counts against a pace or rating denominator |
second_chance
|
2nd | booleandimension |
Whether it followed an offensive rebound. |
length_seconds
|
Length | numbermeasure |
Seconds the possession lasted. Seconds the possession lasted |
fg2m
|
2PM | integermeasure |
Two-pointers made on the possession. |
fg2a
|
2PA | integermeasure |
Two-pointers attempted on the possession. |
fg3m
|
3PM | integermeasure |
Three-pointers made. NBA.com |
fg3a
|
3PA | integermeasure |
Three-pointers attempted. NBA.com |
ftm
|
FTM | integermeasure |
Free throws made. NBA.com |
fta
|
FTA | integermeasure |
Free throws attempted. NBA.com |
oreb
|
OREB | integermeasure |
Rebounds of the shooting team's own misses. NBA.com |
turnovers
lower is better
|
TOV | integermeasure |
Times he lost the ball. |
points_per_100
|
Pts/100 | numbermeasure |
Points per hundred possessions. Points per hundred possessions — the whole reason to count possessions |
off_player_1
|
Off 1 | integermeasure |
A player on the floor for the offence, by his league id. The league id of a player on the floor for the offence |
off_player_2
|
Off 2 | integermeasure |
A player on the floor for the offence, by his league id. |
off_player_3
|
Off 3 | integermeasure |
A player on the floor for the offence, by his league id. |
off_player_4
|
Off 4 | integermeasure |
A player on the floor for the offence, by his league id. |
off_player_5
|
Off 5 | integermeasure |
A player on the floor for the offence, by his league id. |
def_player_1
|
Def 1 | integermeasure |
A player on the floor for the defence, by his league id. |
def_player_2
|
Def 2 | integermeasure |
A player on the floor for the defence, by his league id. |
def_player_3
|
Def 3 | integermeasure |
A player on the floor for the defence, by his league id. |
def_player_4
|
Def 4 | integermeasure |
A player on the floor for the defence, by his league id. |
def_player_5
|
Def 5 | integermeasure |
A player on the floor for the defence, by his league id. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.possessions select game_date, team, opponent, period, start_type, length_seconds, points order by points desc limit 200
selectThe columns the answer carries
from nba.possessions select game_date, team, opponent, period, start_type, length_seconds, points order by points desc limit 200
asRenames a column's heading and nothing else
from nba.possessions select game_date, team, period as Per order by period desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.possessions where season = $year select game_date, team, opponent order by period desc limit 10
limitHow many rows come back
from nba.possessions select game_date, team, opponent, period, start_type, length_seconds, points order by points desc limit 200
order byWhich end of the answer comes first
from nba.possessions select game_date, team, opponent, period order by period desc limit 10
#A comment, to the end of the line
# Possessions — Every possession since 1996-97: how it started, what it produced, and the ten players on the floor. from nba.possessions select game_date, team, opponent, period, start_type, length_seconds, points order by points desc limit 200
whereChooses the rows the question is about
from nba.possessions where season = 2026 select team, period order by period desc limit 10
andContinues whichever filter clause came last
from nba.possessions where season = 2026 and period > 0 select team, period order by period desc limit 10
havingFilters the groups a fold made
from nba.possessions select team, sum(period) group by team having sum(period) > 0 order by sum(period) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.possessions where season = 2026 select team, period, period_percentile keep period_percentile >= 90 order by period_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.possessions select team, season, period highlight season = 2026 order by period desc limit 10
ofA threshold that is another row rather than a number
from nba.possessions where period >= max(period) of season 2026 select team, period order by period desc limit 10
group byFolds the rows sharing these keys into one
from nba.possessions select team, count(*), sum(period) group by team order by sum(period) desc limit 10
thenFolds the answer a second time
from nba.possessions select team, opponent, count(*) group by team, opponent having count(*) > 10 then select team, count(*) as Opps group by team order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.possessions select team, opponent, sum(period) group by team, opponent pivot by opponent limit 25
first / lastOnly part of each career, before anything else runs
from nba.possessions first 3 seasons select team, sum(period) group by team order by sum(period) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.possessions select team, sum(period) group by team order by sum(period) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.possessions select team, avg(period) group by team order by avg(period) desc limit 10
min(…)The smallest value in each group
from nba.possessions select team, min(period) group by team order by min(period) desc limit 10
max(…)The largest value in each group
from nba.possessions select team, max(period) group by team order by max(period) desc limit 10
count(…)How many rows a group swallowed
from nba.possessions select team, count(period) group by team order by count(period) desc limit 10
distinct(…)How many different values a group holds
from nba.possessions select team, distinct(game_date) group by team order by distinct(game_date) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.possessions where season = 2026 select team, only(game_date) group by team order by only(game_date) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.possessions select team, latest(team) group by team order by count(*) desc limit 10
top(…)The value on the group's biggest row
from nba.possessions select team, top(team) group by team order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.possessions select team, mean(period) group by team order by mean(period) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.possessions select team, median(period) group by team order by median(period) desc limit 10
mode(…)The commonest value in the group
from nba.possessions select team, mode(team) group by team order by count(*) desc limit 10
year(…)Reads a date as the year it falls in
from nba.possessions select team, year(game_date), sum(period) group by team, year(game_date) order by year(game_date) asc limit 20
quarter(…)Reads a date as the quarter it falls in
from nba.possessions select team, quarter(game_date), sum(period) group by team, quarter(game_date) order by quarter(game_date) asc limit 20
month(…)Reads a date as the month it falls in
from nba.possessions select team, month(game_date), sum(period) group by team, month(game_date) order by month(game_date) asc limit 20
week(…)Reads a date as the week it falls in
from nba.possessions select team, week(game_date), sum(period) group by team, week(game_date) order by week(game_date) asc limit 20
as_of(…)The stat as it stood, season to date
from nba.possessions where season = 2026 select team, month(game_date), as_of(period) group by team, month(game_date) order by month(game_date) asc limit 25
<stat>_percentileWhere a row sits in its population, 0-100
from nba.possessions where season = 2026 select team, period, period_percentile order by period_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.possessions select team, sum(period), percentile(sum(period)) group by team order by sum(period) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.possessions where season = 2026 select team, period, standing(period) order by period desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.possessions where season = 2026 select team, period, points, composite(period, points) order by composite(period, points) desc limit 10
ratio(…)One column divided by another
from nba.possessions select team, count(*), ratio(sum(period), count(*)) group by team order by ratio(sum(period), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.possessions where season = 2026 select team, period, points, calc(standing(period) - standing(points)) order by calc(standing(period) - standing(points)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.possessions select team, period, format(period, > 0 -> "on the board", <= 0 -> "nothing yet") order by period desc limit 10
pairDraws two columns of the answer in one
from nba.possessions where season = 2026 select team, period, period_percentile pair period with period_percentile order by period desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.possessions where season = 2026 select team, period, points, length_seconds, composite(period, points, length_seconds) as Score hint composite(period, points, length_seconds) as "Per + Pts + Length" order by composite(period, points, length_seconds) desc limit 10
nba.draft Draft picksEvery pick since the 1996 draft, with what the pick became.
from nba.draft select draft_year, overall, player, position, team, organization, career_games, career_pts order by overall asc limit 100
player-pick)nba_draft NBA Stats, hoopRdraft_year overall player position team organization career_games career_ptsoverall ascseasonseasons picksdraft_yearplayer id and null career columns; his name is still on the row.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
the position column |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
draft_year
|
Year | integermeasure |
The year of the draft. |
overall
lower is better
|
Pick | integermeasure |
His overall pick number. |
round
lower is better
|
Rd | integermeasure |
The round he was taken in. |
round_pick
lower is better
|
In Rd | integermeasure |
His slot within that round. |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
position
completes position
|
Pos | stringdimension |
The position he started at. |
organization
|
From | stringdimension |
Where he was drafted from. |
organization_type
|
Type | stringdimension |
Whether that was a college, a club abroad, or a high school. College/University, Other Team/Club, High School |
country
completes country
|
Ctry | stringdimension |
The country he is listed as from. |
height_inches
|
Ht | integermeasure |
Height in inches. |
weight_lb
|
Wt | integermeasure |
Weight in pounds. |
seasons_played
|
Seasons | integermeasure |
How many NBA seasons he went on to play. How many NBA seasons he went on to play |
career_games
|
Career GP | integermeasure |
Games he went on to play. |
career_pts
|
Career Pts | integermeasure |
Points he went on to score. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.draft select draft_year, overall, player, position, team, organization, career_games, career_pts order by overall asc limit 100
selectThe columns the answer carries
from nba.draft select draft_year, overall, player, position, team, organization, career_games, career_pts order by overall asc limit 100
asRenames a column's heading and nothing else
from nba.draft select draft_year, overall, draft_year as Year order by draft_year desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.draft where season = $year select draft_year, overall, player order by draft_year desc limit 10
limitHow many rows come back
from nba.draft select draft_year, overall, player, position, team, organization, career_games, career_pts order by overall asc limit 100
order byWhich end of the answer comes first
from nba.draft select draft_year, overall, player order by draft_year desc limit 10
#A comment, to the end of the line
# Draft picks — Every pick since the 1996 draft, with what the pick became. from nba.draft select draft_year, overall, player, position, team, organization, career_games, career_pts order by overall asc limit 100
whereChooses the rows the question is about
from nba.draft where season = 2026 select player, draft_year order by draft_year desc limit 10
andContinues whichever filter clause came last
from nba.draft where season = 2026 and draft_year > 0 select player, draft_year order by draft_year desc limit 10
havingFilters the groups a fold made
from nba.draft select player, sum(draft_year) group by player having sum(draft_year) > 0 order by sum(draft_year) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.draft where season = 2026 select player, draft_year, draft_year_percentile keep draft_year_percentile >= 90 order by draft_year_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.draft select player, season, draft_year highlight season = 2026 order by draft_year desc limit 10
ofA threshold that is another row rather than a number
from nba.draft where draft_year >= max(draft_year) of position PG select player, draft_year order by draft_year desc limit 10
group byFolds the rows sharing these keys into one
from nba.draft select player, count(*), sum(draft_year) group by player order by sum(draft_year) desc limit 10
thenFolds the answer a second time
from nba.draft select player, team, count(*) group by player, team having count(*) > 10 then select player, count(*) as Teams group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.draft select player, team, sum(draft_year) group by player, team pivot by team limit 25
first / lastOnly part of each career, before anything else runs
from nba.draft first 3 seasons select player, sum(draft_year) group by player order by sum(draft_year) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.draft select player, sum(draft_year) group by player order by sum(draft_year) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.draft select player, avg(draft_year) group by player order by avg(draft_year) desc limit 10
min(…)The smallest value in each group
from nba.draft select player, min(draft_year) group by player order by min(draft_year) desc limit 10
max(…)The largest value in each group
from nba.draft select player, max(draft_year) group by player order by max(draft_year) desc limit 10
count(…)How many rows a group swallowed
from nba.draft select player, count(draft_year) group by player order by count(draft_year) desc limit 10
distinct(…)How many different values a group holds
from nba.draft select player, distinct(team) group by player order by distinct(team) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.draft where season = 2026 select player, only(team) group by player order by only(team) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.draft select player, latest(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.draft select player, mean(draft_year) group by player order by mean(draft_year) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.draft select player, median(draft_year) group by player order by median(draft_year) desc limit 10
mode(…)The commonest value in the group
from nba.draft select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.draft where season = 2026 select player, draft_year, draft_year_percentile order by draft_year_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.draft select player, sum(draft_year), percentile(sum(draft_year)) group by player order by sum(draft_year) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.draft where season = 2026 select player, draft_year, standing(draft_year) order by draft_year desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.draft where season = 2026 select player, draft_year, overall, composite(draft_year, overall) order by composite(draft_year, overall) desc limit 10
ratio(…)One column divided by another
from nba.draft select player, count(*), ratio(sum(draft_year), count(*)) group by player order by ratio(sum(draft_year), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.draft where season = 2026 select player, draft_year, overall, calc(standing(draft_year) - standing(overall)) order by calc(standing(draft_year) - standing(overall)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.draft select player, draft_year, format(draft_year, > 0 -> "on the board", <= 0 -> "nothing yet") order by draft_year desc limit 10
pairDraws two columns of the answer in one
from nba.draft where season = 2026 select player, draft_year, draft_year_percentile pair draft_year with draft_year_percentile order by draft_year desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.draft where season = 2026 select player, draft_year, overall, round, composite(draft_year, overall, round) as Score hint composite(draft_year, overall, round) as "Year + Pick + Rd" order by composite(draft_year, overall, round) desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to pickyear(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.payroll PayrollOne row per player per season with cap context already worked out — share of the cap, share of the team's payroll, and where he sits on his own roster.
from nba.payroll select player, team, season, cap_hit, pct_of_cap, roster_rank order by cap_hit desc limit 200
player-season)nba_player_contract_seasons Spotracnba_team_season_cap Spotracnba_league_season_cap Spotracplayer team season cap_hit pct_of_cap roster_rankcap_hit descseasonseasonswhere dead_money = false for players actually on the roster.| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
The payroll source carries no position — query nba.players for that |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
contract_type
|
Type | stringdimension |
How the contract came about — a rookie scale, a max, a minimum, an extension. |
dead_money
|
Dead | booleandimension |
Whether the charge is for a player no longer on the roster. |
cap_hit
|
Cap hit | integermeasure |
What he counted against the salary cap. Dollars against the cap this season |
base_salary
|
Base | integermeasure |
The salary itself, before bonuses and cap mechanics. |
pct_of_cap
|
% of cap | numbermeasure |
His cap hit as a share of the league cap — a salary with the era divided out. |
pct_of_payroll
|
% of payroll | numbermeasure |
His cap hit as a share of what his club was paying in total, dead money included. |
pct_of_active_payroll
|
% of active | numbermeasure |
His cap hit as a share of what his club was paying the players still on its roster, dead money excluded. |
roster_rank
|
Roster # | integermeasure |
Where his cap hit sat on his own roster, 1 being the highest paid. Ranked over his club's whole roster, not just the rows this query returned |
team_payroll
|
Team payroll | integermeasure |
Everything the club was paying that season. |
active_payroll
|
Active payroll | integermeasure |
What the club was paying players still on the roster. What the club is paying its current roster, dead money excluded |
salary_cap
|
Cap | integermeasure |
The league salary cap that season — the number every share below divides by. |
first_apron
|
1st apron | integermeasure |
The first apron that season, the spending line that costs a club its exceptions. |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
fromThe one table a query reads
from nba.payroll select player, team, season, cap_hit, pct_of_cap, roster_rank order by cap_hit desc limit 200
selectThe columns the answer carries
from nba.payroll select player, team, season, cap_hit, pct_of_cap, roster_rank order by cap_hit desc limit 200
asRenames a column's heading and nothing else
from nba.payroll select player, team, cap_hit as Cap hit order by cap_hit desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.payroll where season = $year select player, team, season order by cap_hit desc limit 10
limitHow many rows come back
from nba.payroll select player, team, season, cap_hit, pct_of_cap, roster_rank order by cap_hit desc limit 200
order byWhich end of the answer comes first
from nba.payroll select player, team, season, cap_hit order by cap_hit desc limit 10
#A comment, to the end of the line
# Payroll — One row per player per season with cap context already worked out — share of the cap, share of the team's payroll, and where he sits on his own roster. from nba.payroll select player, team, season, cap_hit, pct_of_cap, roster_rank order by cap_hit desc limit 200
whereChooses the rows the question is about
from nba.payroll where season = 2026 select player, cap_hit order by cap_hit desc limit 10
andContinues whichever filter clause came last
from nba.payroll where season = 2026 and cap_hit > 0 select player, cap_hit order by cap_hit desc limit 10
havingFilters the groups a fold made
from nba.payroll select player, sum(cap_hit) group by player having sum(cap_hit) > 0 order by sum(cap_hit) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.payroll where season = 2026 select player, cap_hit, cap_hit_percentile keep cap_hit_percentile >= 90 order by cap_hit_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.payroll select player, season, cap_hit highlight season = 2026 order by cap_hit desc limit 10
ofA threshold that is another row rather than a number
from nba.payroll where cap_hit >= max(cap_hit) of season 2026 select player, cap_hit order by cap_hit desc limit 10
group byFolds the rows sharing these keys into one
from nba.payroll select player, count(*), sum(cap_hit) group by player order by sum(cap_hit) desc limit 10
thenFolds the answer a second time
from nba.payroll select player, season, count(*) group by player, season having count(*) > 10 then select player, count(*) as Seasons group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.payroll select player, season, sum(cap_hit) group by player, season pivot by season limit 25
first / lastOnly part of each career, before anything else runs
from nba.payroll first 3 seasons select player, sum(cap_hit) group by player order by sum(cap_hit) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.payroll select player, sum(cap_hit) group by player order by sum(cap_hit) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.payroll select player, avg(cap_hit) group by player order by avg(cap_hit) desc limit 10
min(…)The smallest value in each group
from nba.payroll select player, min(cap_hit) group by player order by min(cap_hit) desc limit 10
max(…)The largest value in each group
from nba.payroll select player, max(cap_hit) group by player order by max(cap_hit) desc limit 10
count(…)How many rows a group swallowed
from nba.payroll select player, count(cap_hit) group by player order by count(cap_hit) desc limit 10
distinct(…)How many different values a group holds
from nba.payroll select player, distinct(season) group by player order by distinct(season) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.payroll where season = 2026 select player, only(season) group by player order by only(season) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.payroll select player, latest(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.payroll select player, mean(cap_hit) group by player order by mean(cap_hit) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.payroll select player, median(cap_hit) group by player order by median(cap_hit) desc limit 10
mode(…)The commonest value in the group
from nba.payroll select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.payroll where season = 2026 select player, cap_hit, cap_hit_percentile order by cap_hit_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.payroll select player, sum(cap_hit), percentile(sum(cap_hit)) group by player order by sum(cap_hit) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.payroll where season = 2026 select player, cap_hit, standing(cap_hit) order by cap_hit desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.payroll where season = 2026 select player, cap_hit, base_salary, composite(cap_hit, base_salary) order by composite(cap_hit, base_salary) desc limit 10
ratio(…)One column divided by another
from nba.payroll select player, count(*), ratio(sum(cap_hit), count(*)) group by player order by ratio(sum(cap_hit), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.payroll where season = 2026 select player, cap_hit, base_salary, calc(standing(cap_hit) - standing(base_salary)) order by calc(standing(cap_hit) - standing(base_salary)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.payroll select player, cap_hit, format(cap_hit, > 0 -> "on the board", <= 0 -> "nothing yet") order by cap_hit desc limit 10
pairDraws two columns of the answer in one
from nba.payroll where season = 2026 select player, cap_hit, cap_hit_percentile pair cap_hit with cap_hit_percentile order by cap_hit desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.payroll where season = 2026 select player, cap_hit, base_salary, pct_of_cap, composite(cap_hit, base_salary, pct_of_cap) as Score hint composite(cap_hit, base_salary, pct_of_cap) as "Cap hit + Base + % of cap" order by composite(cap_hit, base_salary, pct_of_cap) desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to pickyear(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.player_seasons Player seasonsOne row per player per season: regular-season rates, playoff rates, and cap context, joined.
from nba.player_seasons select player, team, games, mpg, pts_pg, ts_pct, pie order by pie desc limit 200
player-season)nba_player_games NBA Stats, hoopRnba_player_games NBA Stats, hoopRnba_player_contract_seasons Spotracnba_team_season_cap Spotracnba_league_season_cap Spotracplayer team games mpg pts_pg ts_pct piepie descseasonseasons| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
Neither source carries a position at this grain — query nba.player_games for that |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. The Team of most of the games in each group |
last_team
completes team
|
Last team | stringdimension |
The club he was with most recently. Team from the most recent game in each group that has one |
games
|
GP | integermeasure |
Games he played in. NBA.com Regular-season games he played in |
mpg
|
MPG | numbermeasure |
Minutes per game. NBA.com The mean of the game MIN values in each group, each weighted the same |
pts_pg
|
PPG | numbermeasure |
Points per game. NBA.com The mean of the game PTS values in each group, each weighted the same |
reb_pg
|
RPG | numbermeasure |
Rebounds per game. NBA.com The mean of the game REB values in each group, each weighted the same |
ast_pg
|
APG | numbermeasure |
Assists per game. NBA.com The mean of the game AST values in each group, each weighted the same |
stl_pg
|
SPG | numbermeasure |
Steals per game. NBA.com The mean of the game STL values in each group, each weighted the same |
blk_pg
|
BPG | numbermeasure |
Blocks per game. NBA.com The mean of the game BLK values in each group, each weighted the same |
tov_pg
lower is better
|
TOV | numbermeasure |
Turnovers per game. NBA.com The mean of the game TOV values in each group, each weighted the same |
fg3_pct
|
3P% | numbermeasure |
Share of three-pointers that went in. NBA.com 3P% across the games in each group, as total threes made over total attempts |
efg_pct
|
eFG% | numbermeasure |
Effective field goal percentage — shooting percentage with a three counted as a basket and a half, because it is worth that. NBA.com eFG% across the games in each group, as total field goals made with threes counted one and a half, over total attempts |
ts_pct
|
TS% | numbermeasure |
True shooting percentage — points per scoring possession, counting twos, threes and free throws together. The single fairest measure of how efficiently a player scores. NBA.com TS% across the games in each group, as total points over total scoring possessions |
usg_pct
|
USG% | numbermeasure |
Usage rate — the share of the club's possessions finished while on the floor, by shooting, drawing a foul or turning it over. NBA.com USG% across the games in each group, as weighted by minutes played |
reb_pct
|
REB% | numbermeasure |
Share of the available rebounds taken while on the floor. NBA.com REB% across the games in each group, as weighted by minutes played |
ast_pct
|
AST% | numbermeasure |
Share of the baskets assisted while on the floor. NBA.com AST% across the games in each group, as weighted by minutes played |
off_rating
|
ORtg | numbermeasure |
Points scored per 100 possessions while on the floor. NBA.com ORtg across the games in each group, as weighted by minutes played |
def_rating
lower is better
|
DRtg | numbermeasure |
Points allowed per 100 possessions while on the floor. NBA.com DRtg across the games in each group, as weighted by minutes played |
net_rating
|
NetRtg | numbermeasure |
Offensive rating less defensive rating. NBA.com NetRtg across the games in each group, as weighted by minutes played |
pie
|
PIE | numbermeasure |
Player impact estimate — a share of everything statistical that happened in the game, as one percentage. NBA.com PIE across the games in each group, as weighted by minutes played |
pie_even
|
PIE (even) | numbermeasure |
Player impact estimate, with every game counted the same rather than weighted by minutes. NBA.com The mean of the game PIE values in each group, each weighted the same — not weighted by minutes played Every game counts the same — a short appearance weighs as much as a start |
playoff_games
|
PO GP | integermeasure |
Playoff games he played in. NBA.com Playoff games he played in — null if his team did not qualify |
playoff_mpg
|
PO MPG | numbermeasure |
Minutes per playoff game. NBA.com The mean of the game MIN values in each group, each weighted the same |
playoff_pts_pg
|
PO PPG | numbermeasure |
Points per playoff game. NBA.com The mean of the game PTS values in each group, each weighted the same |
playoff_ts_pct
|
PO TS% | numbermeasure |
True shooting percentage in the playoffs — points per scoring possession, twos, threes and free throws together. NBA.com TS% across the games in each group, as total points over total scoring possessions |
playoff_pie
|
PO PIE | numbermeasure |
Player impact estimate in the playoffs. NBA.com PIE across the games in each group, as weighted by minutes played |
cap_hit
|
Cap hit | integermeasure |
What he counted against the salary cap. What he counted against the cap this season, across every club that paid him |
pct_of_cap
|
% of cap | numbermeasure |
His cap hit as a share of the league cap — a salary with the era divided out. The highest season % of cap in each group His largest single-club share, in a season he spent at more than one |
pct_of_payroll
|
% of payroll | numbermeasure |
His cap hit as a share of what his club was paying in total, dead money included. The highest season % of payroll in each group His largest single-club share, in a season he spent at more than one |
pct_of_active_payroll
|
% of active | numbermeasure |
His cap hit as a share of what his club was paying the players still on its roster, dead money excluded. The highest season % of active in each group His largest single-club share, in a season he spent at more than one |
roster_rank
|
Roster # | integermeasure |
Where his cap hit sat on his own roster, 1 being the highest paid. The lowest season Roster # in each group Ranked over his club's whole roster, not just the rows this query returned |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
fromThe one table a query reads
from nba.player_seasons select player, team, games, mpg, pts_pg, ts_pct, pie order by pie desc limit 200
selectThe columns the answer carries
from nba.player_seasons select player, team, games, mpg, pts_pg, ts_pct, pie order by pie desc limit 200
asRenames a column's heading and nothing else
from nba.player_seasons select player, team, games as GP order by games desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.player_seasons where season = $year select player, team, games order by games desc limit 10
limitHow many rows come back
from nba.player_seasons select player, team, games, mpg, pts_pg, ts_pct, pie order by pie desc limit 200
order byWhich end of the answer comes first
from nba.player_seasons select player, team, games order by games desc limit 10
#A comment, to the end of the line
# Player seasons — One row per player per season: regular-season rates, playoff rates, and cap context, joined. from nba.player_seasons select player, team, games, mpg, pts_pg, ts_pct, pie order by pie desc limit 200
whereChooses the rows the question is about
from nba.player_seasons where season = 2026 select player, games order by games desc limit 10
andContinues whichever filter clause came last
from nba.player_seasons where season = 2026 and games > 0 select player, games order by games desc limit 10
havingFilters the groups a fold made
from nba.player_seasons select player, sum(games) group by player having sum(games) > 0 order by sum(games) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.player_seasons where season = 2026 select player, games, games_percentile keep games_percentile >= 90 order by games_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.player_seasons select player, season, games highlight season = 2026 order by games desc limit 10
ofA threshold that is another row rather than a number
from nba.player_seasons where games >= max(games) of season 2026 select player, games order by games desc limit 10
group byFolds the rows sharing these keys into one
from nba.player_seasons select player, count(*), sum(games) group by player order by sum(games) desc limit 10
thenFolds the answer a second time
from nba.player_seasons select player, team, count(*) group by player, team having count(*) > 10 then select player, count(*) as Teams group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.player_seasons select player, team, sum(games) group by player, team pivot by team limit 25
first / lastOnly part of each career, before anything else runs
from nba.player_seasons first 3 seasons select player, sum(games) group by player order by sum(games) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.player_seasons select player, sum(games) group by player order by sum(games) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.player_seasons select player, avg(games) group by player order by avg(games) desc limit 10
min(…)The smallest value in each group
from nba.player_seasons select player, min(games) group by player order by min(games) desc limit 10
max(…)The largest value in each group
from nba.player_seasons select player, max(games) group by player order by max(games) desc limit 10
count(…)How many rows a group swallowed
from nba.player_seasons select player, count(games) group by player order by count(games) desc limit 10
distinct(…)How many different values a group holds
from nba.player_seasons select player, distinct(team) group by player order by distinct(team) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.player_seasons where season = 2026 select player, only(team) group by player order by only(team) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.player_seasons select player, latest(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.player_seasons select player, mean(games) group by player order by mean(games) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.player_seasons select player, median(games) group by player order by median(games) desc limit 10
mode(…)The commonest value in the group
from nba.player_seasons select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.player_seasons where season = 2026 select player, games, games_percentile order by games_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.player_seasons select player, sum(games), percentile(sum(games)) group by player order by sum(games) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.player_seasons where season = 2026 select player, games, standing(games) order by games desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.player_seasons where season = 2026 select player, games, mpg, composite(games, mpg) order by composite(games, mpg) desc limit 10
ratio(…)One column divided by another
from nba.player_seasons select player, count(*), ratio(sum(games), count(*)) group by player order by ratio(sum(games), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.player_seasons where season = 2026 select player, games, mpg, calc(standing(games) - standing(mpg)) order by calc(standing(games) - standing(mpg)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.player_seasons select player, games, format(games, > 0 -> "on the board", <= 0 -> "nothing yet") order by games desc limit 10
pairDraws two columns of the answer in one
from nba.player_seasons where season = 2026 select player, games, games_percentile pair games with games_percentile order by games desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.player_seasons where season = 2026 select player, games, mpg, pts_pg, composite(games, mpg, pts_pg) as Score hint composite(games, mpg, pts_pg) as "GP + MPG + PPG" order by composite(games, mpg, pts_pg) desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to pickyear(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.player_team_seasons Player-team seasonsOne row per player per season per club that paid him: cap hit, what he produced, and what the club won.
from nba.player_team_seasons select player, team, season, cap_hit, pct_of_cap, games, win_share order by cap_hit desc limit 200
player-season)nba_player_contract_seasons Spotracnba_team_season_cap Spotracnba_league_season_cap Spotracnba_player_games NBA Stats, hoopRplayer team season cap_hit pct_of_cap games win_sharecap_hit descseasonseasons| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
Neither source carries a position at this grain — query nba.player_games for that |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
cap_hit
|
Paid | integermeasure |
What he counted against the salary cap. What he counted against the cap at this club this season |
pct_of_cap
|
Cap % | numbermeasure |
His cap hit as a share of the league cap — a salary with the era divided out. That cap hit as a share of the league cap that season — the inflation-adjusted figure |
roster_rank
|
Roster # | integermeasure |
Where his cap hit sat on his own roster, 1 being the highest paid. The lowest season Roster # in each group Ranked over his club's whole roster, not just the rows this query returned |
games
|
GP | integermeasure |
Games he played in. NBA.com Regular-season games he played for this club — empty in a season he missed entirely |
minutes
|
MIN | numbermeasure |
Minutes he was on the floor. NBA.com MIN added up across the games in each group |
production
|
Prod | integermeasure |
Points, rebounds, assists, steals and blocks less turnovers, as one count. Prod added up across the games in each group A box-score total, not a rating — it weights a rebound like a point |
pts_pg
|
PPG | numbermeasure |
Points per game. NBA.com The mean of the game PTS values in each group, each weighted the same |
ts_pct
|
TS% | numbermeasure |
True shooting percentage — points per scoring possession, counting twos, threes and free throws together. The single fairest measure of how efficiently a player scores. NBA.com TS% across the games in each group, as total points over total scoring possessions |
team_production
|
Club prod | integermeasure |
The production of the club's whole roster. Prod added up across the games in each group A box-score total, not a rating — it weights a rebound like a point |
team_wins
|
Club W | integermeasure |
The club's regular-season wins. NBA.com W added up across the games in each group A game with no margin recorded counts for neither side |
mvps
|
MVPs | integermeasure |
MVP awards won. MVP added up across the seasons in each group |
titles
|
Titles | integermeasure |
Championships won. Title added up across the seasons in each group |
win_share
|
Est. WS | numbermeasure |
An estimate of how many of his club's wins were his. His share of his club's production, applied to his club's wins and scaled by 0.82 A box-score proxy, not Basketball-Reference win shares — it credits a rebound like a point and knows nothing about defence |
rank
computed
lower is better
|
# | integermeasure |
Where the row placed in this result under your |
pctile
computed
|
%ile | integermeasure |
Where the row sits within the rows this query returned, 0 to 100 — |
gp_per_season GP/Seasonbuilt from sum(games) count(*)
Games played per season under contract.
Games played per season on the books — availability, over a tenure
from nba.player_team_seasons select player, gp_per_season group by player order by gp_per_season desc limit 10
cap_per_ws $/WSbuilt from sum(cap_hit) sum(win_share)
Dollars of cap hit per estimated win share.
Nominal dollars — a 2014 win share and a 2025 one cost different money, so adj_cap_per_ws compares eras and this does not
from nba.player_team_seasons select player, cap_per_ws group by player order by cap_per_ws desc limit 10
adj_cap_per_ws Adj. Cap%/WSbuilt from avg(pct_of_cap) sum(win_share)
Share of the cap per estimated win share, which is the same question with inflation removed.
from nba.player_team_seasons select player, adj_cap_per_ws group by player order by adj_cap_per_ws desc limit 10
fromThe one table a query reads
from nba.player_team_seasons select player, team, season, cap_hit, pct_of_cap, games, win_share order by cap_hit desc limit 200
selectThe columns the answer carries
from nba.player_team_seasons select player, team, season, cap_hit, pct_of_cap, games, win_share order by cap_hit desc limit 200
asRenames a column's heading and nothing else
from nba.player_team_seasons select player, team, cap_hit as Paid order by cap_hit desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.player_team_seasons where season = $year select player, team, season order by cap_hit desc limit 10
limitHow many rows come back
from nba.player_team_seasons select player, team, season, cap_hit, pct_of_cap, games, win_share order by cap_hit desc limit 200
order byWhich end of the answer comes first
from nba.player_team_seasons select player, team, season, cap_hit order by cap_hit desc limit 10
#A comment, to the end of the line
# Player-team seasons — One row per player per season per club that paid him: cap hit, what he produced, and what the club won. from nba.player_team_seasons select player, team, season, cap_hit, pct_of_cap, games, win_share order by cap_hit desc limit 200
whereChooses the rows the question is about
from nba.player_team_seasons where season = 2026 select player, cap_hit order by cap_hit desc limit 10
andContinues whichever filter clause came last
from nba.player_team_seasons where season = 2026 and cap_hit > 0 select player, cap_hit order by cap_hit desc limit 10
havingFilters the groups a fold made
from nba.player_team_seasons select player, sum(cap_hit) group by player having sum(cap_hit) > 0 order by sum(cap_hit) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.player_team_seasons where season = 2026 select player, cap_hit, cap_hit_percentile keep cap_hit_percentile >= 90 order by cap_hit_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.player_team_seasons select player, season, cap_hit highlight season = 2026 order by cap_hit desc limit 10
ofA threshold that is another row rather than a number
from nba.player_team_seasons where cap_hit >= max(cap_hit) of season 2026 select player, cap_hit order by cap_hit desc limit 10
group byFolds the rows sharing these keys into one
from nba.player_team_seasons select player, count(*), sum(cap_hit) group by player order by sum(cap_hit) desc limit 10
thenFolds the answer a second time
from nba.player_team_seasons select player, season, count(*) group by player, season having count(*) > 10 then select player, count(*) as Seasons group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.player_team_seasons select player, season, sum(cap_hit) group by player, season pivot by season limit 25
first / lastOnly part of each career, before anything else runs
from nba.player_team_seasons first 3 seasons select player, sum(cap_hit) group by player order by sum(cap_hit) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.player_team_seasons select player, sum(cap_hit) group by player order by sum(cap_hit) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.player_team_seasons select player, avg(cap_hit) group by player order by avg(cap_hit) desc limit 10
min(…)The smallest value in each group
from nba.player_team_seasons select player, min(cap_hit) group by player order by min(cap_hit) desc limit 10
max(…)The largest value in each group
from nba.player_team_seasons select player, max(cap_hit) group by player order by max(cap_hit) desc limit 10
count(…)How many rows a group swallowed
from nba.player_team_seasons select player, count(cap_hit) group by player order by count(cap_hit) desc limit 10
distinct(…)How many different values a group holds
from nba.player_team_seasons select player, distinct(season) group by player order by distinct(season) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.player_team_seasons where season = 2026 select player, only(season) group by player order by only(season) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.player_team_seasons select player, latest(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.player_team_seasons select player, mean(cap_hit) group by player order by mean(cap_hit) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.player_team_seasons select player, median(cap_hit) group by player order by median(cap_hit) desc limit 10
mode(…)The commonest value in the group
from nba.player_team_seasons select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.player_team_seasons where season = 2026 select player, cap_hit, cap_hit_percentile order by cap_hit_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.player_team_seasons select player, sum(cap_hit), percentile(sum(cap_hit)) group by player order by sum(cap_hit) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.player_team_seasons where season = 2026 select player, cap_hit, standing(cap_hit) order by cap_hit desc limit 10
composite(…)One 0-100 score standing for several stats at once
from nba.player_team_seasons where season = 2026 select player, cap_hit, pct_of_cap, composite(cap_hit, pct_of_cap) order by composite(cap_hit, pct_of_cap) desc limit 10
ratio(…)One column divided by another
from nba.player_team_seasons select player, count(*), ratio(sum(cap_hit), count(*)) group by player order by ratio(sum(cap_hit), count(*)) desc limit 10
calc(…)Arithmetic over any columns the table can build
from nba.player_team_seasons where season = 2026 select player, cap_hit, pct_of_cap, calc(standing(cap_hit) - standing(pct_of_cap)) order by calc(standing(cap_hit) - standing(pct_of_cap)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.player_team_seasons select player, cap_hit, format(cap_hit, > 0 -> "on the board", <= 0 -> "nothing yet") order by cap_hit desc limit 10
pairDraws two columns of the answer in one
from nba.player_team_seasons where season = 2026 select player, cap_hit, cap_hit_percentile pair cap_hit with cap_hit_percentile order by cap_hit desc limit 10
hintShows a sentence on a heading when the pointer rests on it
from nba.player_team_seasons where season = 2026 select player, cap_hit, pct_of_cap, roster_rank, composite(cap_hit, pct_of_cap, roster_rank) as Score hint composite(cap_hit, pct_of_cap, roster_rank) as "Paid + Cap % + Roster #" order by composite(cap_hit, pct_of_cap, roster_rank) desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to pickyear(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongnba.mvps MVPsThe regular-season MVP for each season, and the club he won it with.
from nba.mvps select season, player, team order by season desc limit 100
player-season)nba_mvp_awards topspinseason player teamseason descseasonseasons| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
the player column |
position |
An award list carries no positions — query nba.player_games for that |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
player
completes player
|
Player | stringdimension |
The player. |
team
completes team
|
Team | stringdimension |
The club. |
mvp
|
MVP | integermeasure |
An MVP award, as a 1 to be counted. Always 1 — a column to fold, so awards can be counted |
fromThe one table a query reads
from nba.mvps select season, player, team order by season desc limit 100
selectThe columns the answer carries
from nba.mvps select season, player, team order by season desc limit 100
asRenames a column's heading and nothing else
from nba.mvps select season, player, mvp as MVP order by mvp desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.mvps where season = $year select season, player, team order by mvp desc limit 10
limitHow many rows come back
from nba.mvps select season, player, team order by season desc limit 100
order byWhich end of the answer comes first
from nba.mvps select season, player, team, mvp order by mvp desc limit 10
#A comment, to the end of the line
# MVPs — The regular-season MVP for each season, and the club he won it with. from nba.mvps select season, player, team order by season desc limit 100
whereChooses the rows the question is about
from nba.mvps where season = 2026 select player, mvp order by mvp desc limit 10
andContinues whichever filter clause came last
from nba.mvps where season = 2026 and mvp > 0 select player, mvp order by mvp desc limit 10
havingFilters the groups a fold made
from nba.mvps select player, sum(mvp) group by player having sum(mvp) > 0 order by sum(mvp) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.mvps where season = 2026 select player, mvp, mvp_percentile keep mvp_percentile >= 90 order by mvp_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.mvps select player, season, mvp highlight season = 2026 order by mvp desc limit 10
ofA threshold that is another row rather than a number
from nba.mvps where mvp >= max(mvp) of season 2026 select player, mvp order by mvp desc limit 10
group byFolds the rows sharing these keys into one
from nba.mvps select player, count(*), sum(mvp) group by player order by sum(mvp) desc limit 10
thenFolds the answer a second time
from nba.mvps select player, season, count(*) group by player, season having count(*) > 10 then select player, count(*) as Seasons group by player order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.mvps select player, season, sum(mvp) group by player, season pivot by season limit 25
first / lastOnly part of each career, before anything else runs
from nba.mvps first 3 seasons select player, sum(mvp) group by player order by sum(mvp) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.mvps select player, sum(mvp) group by player order by sum(mvp) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.mvps select player, avg(mvp) group by player order by avg(mvp) desc limit 10
min(…)The smallest value in each group
from nba.mvps select player, min(mvp) group by player order by min(mvp) desc limit 10
max(…)The largest value in each group
from nba.mvps select player, max(mvp) group by player order by max(mvp) desc limit 10
count(…)How many rows a group swallowed
from nba.mvps select player, count(mvp) group by player order by count(mvp) desc limit 10
distinct(…)How many different values a group holds
from nba.mvps select player, distinct(season) group by player order by distinct(season) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.mvps where season = 2026 select player, only(season) group by player order by only(season) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.mvps select player, latest(player) group by player order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.mvps select player, mean(mvp) group by player order by mean(mvp) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.mvps select player, median(mvp) group by player order by median(mvp) desc limit 10
mode(…)The commonest value in the group
from nba.mvps select player, mode(player) group by player order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.mvps where season = 2026 select player, mvp, mvp_percentile order by mvp_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.mvps select player, sum(mvp), percentile(sum(mvp)) group by player order by sum(mvp) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.mvps where season = 2026 select player, mvp, standing(mvp) order by mvp desc limit 10
ratio(…)One column divided by another
from nba.mvps select player, count(*), ratio(sum(mvp), count(*)) group by player order by ratio(sum(mvp), count(*)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.mvps select player, mvp, format(mvp, > 0 -> "on the board", <= 0 -> "nothing yet") order by mvp desc limit 10
pairDraws two columns of the answer in one
from nba.mvps where season = 2026 select player, mvp, mvp_percentile pair mvp with mvp_percentile order by mvp desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to pickyear(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongcomposite(…) — a score needs two stats this table can rank, and it has fewercalc(…) — this table has fewer than two numbers to do arithmetic betweenhint — the example hints a score, and this table has fewer than two stats to scorenba.titles ChampionshipsThe club that won the Finals in each season.
from nba.titles select season, team order by season desc limit 100
team-season)nba_championships topspinseason teamseason descseasonseasons| Name | Bound to |
|---|---|
league |
always nba |
team |
the team column |
player |
A title belongs to a club — query nba.player_team_seasons for who was on it |
position |
A title belongs to a club, and a club has no position |
season |
the season column |
| Name | Heading | Type | What it is |
|---|---|---|---|
season
completes season
|
Season | seasondimension |
The season, by the year it started — 2024 is the 2024-25 season. |
team
completes team
|
Team | stringdimension |
The club. |
title
|
Title | integermeasure |
A championship, as a 1 to be counted. Always 1 — a column to fold, so titles can be counted |
selectThe columns the answer carries
from nba.titles select season, team order by season desc limit 100
asRenames a column's heading and nothing else
from nba.titles select season, team, title as Title order by title desc limit 10
letA value written once and referred to as $name
let year = 2026 from nba.titles where season = $year select season, team order by title desc limit 10
order byWhich end of the answer comes first
from nba.titles select season, team, title order by title desc limit 10
#A comment, to the end of the line
# Championships — The club that won the Finals in each season. from nba.titles select season, team order by season desc limit 100
whereChooses the rows the question is about
from nba.titles where season = 2026 select team, title order by title desc limit 10
andContinues whichever filter clause came last
from nba.titles where season = 2026 and title > 0 select team, title order by title desc limit 10
havingFilters the groups a fold made
from nba.titles select team, sum(title) group by team having sum(title) > 0 order by sum(title) desc limit 10
keepwhere, moved one layer out — after the ranking
from nba.titles where season = 2026 select team, title, title_percentile keep title_percentile >= 90 order by title_percentile desc limit 10
highlightPoints at rows instead of choosing them
from nba.titles select team, season, title highlight season = 2026 order by title desc limit 10
ofA threshold that is another row rather than a number
from nba.titles where title >= max(title) of season 2026 select team, title order by title desc limit 10
group byFolds the rows sharing these keys into one
from nba.titles select team, count(*), sum(title) group by team order by sum(title) desc limit 10
thenFolds the answer a second time
from nba.titles select team, season, count(*) group by team, season having count(*) > 10 then select team, count(*) as Seasons group by team order by count(*) desc limit 10
pivot byReads the answer as a matrix
from nba.titles select team, season, sum(title) group by team, season pivot by season limit 25
first / lastOnly part of each career, before anything else runs
from nba.titles first 3 seasons select team, sum(title) group by team order by sum(title) desc limit 10
sum(…)Adds a stat up across the rows in each group
from nba.titles select team, sum(title) group by team order by sum(title) desc limit 10
avg(…)The mean of a stat, with rates rebuilt rather than averaged
from nba.titles select team, avg(title) group by team order by avg(title) desc limit 10
min(…)The smallest value in each group
from nba.titles select team, min(title) group by team order by min(title) desc limit 10
max(…)The largest value in each group
from nba.titles select team, max(title) group by team order by max(title) desc limit 10
count(…)How many rows a group swallowed
from nba.titles select team, count(title) group by team order by count(title) desc limit 10
distinct(…)How many different values a group holds
from nba.titles select team, distinct(season) group by team order by distinct(season) desc limit 10
only(…)The one value in the group, and an error if there are two
from nba.titles where season = 2026 select team, only(season) group by team order by only(season) desc limit 10
latest(…)The newest row's value, rather than a number
from nba.titles select team, latest(team) group by team order by count(*) desc limit 10
mean(…)The plain arithmetic mean, whatever the column says about itself
from nba.titles select team, mean(title) group by team order by mean(title) desc limit 10
median(…)The middle value in the group — half above it, half below
from nba.titles select team, median(title) group by team order by median(title) desc limit 10
mode(…)The commonest value in the group
from nba.titles select team, mode(team) group by team order by count(*) desc limit 10
<stat>_percentileWhere a row sits in its population, 0-100
from nba.titles where season = 2026 select team, title, title_percentile order by title_percentile desc limit 10
percentile(…)Where a folded group ranks among the other groups
from nba.titles select team, sum(title), percentile(sum(title)) group by team order by sum(title) desc limit 10
standing(…)The same window, read as a place — 1 being best
from nba.titles where season = 2026 select team, title, standing(title) order by title desc limit 10
ratio(…)One column divided by another
from nba.titles select team, count(*), ratio(sum(title), count(*)) group by team order by ratio(sum(title), count(*)) desc limit 10
format(…)Prints a column's values as words, changing nothing else
from nba.titles select team, title, format(title, > 0 -> "on the board", <= 0 -> "nothing yet") order by title desc limit 10
pairDraws two columns of the answer in one
from nba.titles where season = 2026 select team, title, title_percentile pair title with title_percentile order by title desc limit 10
top(…) — this table does not say which of its rows is the biggest, so there is no top one to pickyear(…) — this table has no date column to read a period offquarter(…) — this table has no date column to read a period offmonth(…) — this table has no date column to read a period offweek(…) — this table has no date column to read a period offas_of(…) — this table has no time axis to accumulate alongcomposite(…) — a score needs two stats this table can rank, and it has fewercalc(…) — this table has fewer than two numbers to do arithmetic betweenhint — the example hints a score, and this table has fewer than two stats to score