Major League Baseball mlb

Seasons
1871–2026
from mlb reads
mlb.hitters
Tables
20 tables
Positions
C Catcher · 1B First base · 2B Second base · 3B Third base · SS Shortstop · LF Left field · CF Center field · RF Right field · SP Starting pitcher · RP Relief pitcher

mlb.hitters Hitter seasons

One row per hitter per season, from FanGraphs' batting leaderboards.

from mlb.hitters
select player, team, season, pa, avg, ops, wrc_plus, war
order by war desc
limit 100
One row is
one player's season (player-season)
Built from
one table, read straight
Reads
mlb_hitter_seasons FanGraphs, baseballr
Shows by default
player team season pa avg ops wrc_plus war
Ordered by
war desc
Rows
100 by default, 5000 at most
Ranks within
season
Careers counted in
seasons

Before you trust the numbers

  • Every hitter is stored, not just regulars. Add where qualified = true for a leaderboard population.
  • A season split across clubs has no team, so filtering by team drops those rows.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position FanGraphs batting lines carry no position — filter positions on mlb.fielders instead
season the season column
Columns 28
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
FanGraphs · baseballr
team completes team Team string
dimension

The club.

Null when the season was split across clubs

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
qualified Qualified boolean
dimension

Whether he had enough playing time for the rate leaderboards — 3.1 plate appearances or 1 inning per team game. MLB.com

On FanGraphs' qualified leaderboard — the population a league rank is against

What it takes
  • folds: count(qualified) distinct(qualified) only(qualified) latest(qualified) mode(qualified)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
pa PA integer
measure

Plate appearances — every trip to the plate, walks and sacrifices included. MLB.com

What it takes
  • folds: sum(pa) avg(pa) min(pa) max(pa) count(pa) distinct(pa) only(pa) latest(pa) mean(pa) median(pa) mode(pa)
  • ranks: pa_percentile
  • accumulates: as_of(pa)
  • can be a benchmark
FanGraphs · baseballr
ab AB integer
measure

At-bats — plate appearances less walks, hit-by-pitches and sacrifices. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
FanGraphs · baseballr
hits H integer
measure

Hits. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
FanGraphs · baseballr
doubles 2B integer
measure

Doubles. MLB.com

What it takes
  • folds: sum(doubles) avg(doubles) min(doubles) max(doubles) count(doubles) distinct(doubles) only(doubles) latest(doubles) mean(doubles) median(doubles) mode(doubles)
  • ranks: doubles_percentile
  • accumulates: as_of(doubles)
  • can be a benchmark
FanGraphs · baseballr
triples 3B integer
measure

Triples. MLB.com

What it takes
  • folds: sum(triples) avg(triples) min(triples) max(triples) count(triples) distinct(triples) only(triples) latest(triples) mean(triples) median(triples) mode(triples)
  • ranks: triples_percentile
  • accumulates: as_of(triples)
  • can be a benchmark
FanGraphs · baseballr
hr HR integer
measure

Home runs hit. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · baseballr
runs R integer
measure

Runs scored. MLB.com

What it takes
  • folds: sum(runs) avg(runs) min(runs) max(runs) count(runs) distinct(runs) only(runs) latest(runs) mean(runs) median(runs) mode(runs)
  • ranks: runs_percentile
  • accumulates: as_of(runs)
  • can be a benchmark
FanGraphs · baseballr
rbi RBI integer
measure

Runs batted in. MLB.com

What it takes
  • folds: sum(rbi) avg(rbi) min(rbi) max(rbi) count(rbi) distinct(rbi) only(rbi) latest(rbi) mean(rbi) median(rbi) mode(rbi)
  • ranks: rbi_percentile
  • accumulates: as_of(rbi)
  • can be a benchmark
FanGraphs · baseballr
bb BB integer
measure

Walks drawn. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · baseballr
so lower is better SO integer
measure

Times struck out at the plate. MLB.com

What it takes
  • folds: sum(so) avg(so) min(so) max(so) count(so) distinct(so) only(so) latest(so) mean(so) median(so) mode(so)
  • ranks: so_percentile
  • accumulates: as_of(so)
  • can be a benchmark
FanGraphs · baseballr
sb SB integer
measure

Bases stolen. MLB.com

What it takes
  • folds: sum(sb) avg(sb) min(sb) max(sb) count(sb) distinct(sb) only(sb) latest(sb) mean(sb) median(sb) mode(sb)
  • ranks: sb_percentile
  • accumulates: as_of(sb)
  • can be a benchmark
FanGraphs · baseballr
avg AVG number
measure

Batting average — hits per at-bat. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
FanGraphs · baseballr
obp OBP number
measure

On-base percentage — how often a plate appearance ended with a runner on. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
FanGraphs · baseballr
slg SLG number
measure

Slugging percentage — total bases per at-bat, so it weighs extra-base hits. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
FanGraphs · baseballr
ops OPS number
measure

On-base plus slugging: the two rates added, the quickest one-number read on a hitter. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
FanGraphs · baseballr
iso ISO number
measure

Isolated power — slugging less batting average, so it counts only the extra bases. MLB.com

What it takes
  • folds: sum(iso) avg(iso) min(iso) max(iso) count(iso) distinct(iso) only(iso) latest(iso) mean(iso) median(iso) mode(iso)
  • ranks: iso_percentile
  • accumulates: as_of(iso)
  • can be a benchmark
FanGraphs · baseballr
babip BABIP number
measure

Batting average on balls in play, which strips out strikeouts and home runs. Swings a lot on luck. MLB.com

What it takes
  • folds: sum(babip) avg(babip) min(babip) max(babip) count(babip) distinct(babip) only(babip) latest(babip) mean(babip) median(babip) mode(babip)
  • ranks: babip_percentile
  • accumulates: as_of(babip)
  • can be a benchmark
FanGraphs · baseballr
woba wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
FanGraphs · baseballr
wrc_plus wRC+ integer
measure

Runs created, adjusted for park and league and set on a scale where 100 is average and 150 is half again better. MLB.com

What it takes
  • folds: sum(wrc_plus) avg(wrc_plus) min(wrc_plus) max(wrc_plus) count(wrc_plus) distinct(wrc_plus) only(wrc_plus) latest(wrc_plus) mean(wrc_plus) median(wrc_plus) mode(wrc_plus)
  • ranks: wrc_plus_percentile
  • accumulates: as_of(wrc_plus)
  • can be a benchmark
FanGraphs · baseballr
war WAR number
measure

Wins above replacement — batting, running and fielding together, as wins over a freely available player. FanGraphs

What it takes
  • folds: sum(war) avg(war) min(war) max(war) count(war) distinct(war) only(war) latest(war) mean(war) median(war) mode(war)
  • ranks: war_percentile
  • accumulates: as_of(war)
  • can be a benchmark
FanGraphs · baseballr
barrel_pct Barrel% number
measure

Share of batted balls hit at the exit velocity and launch angle that have historically produced a .500 average — the best contact there is. MLB.com

Share of batted balls barrelled, as a whole percent (12.17 = 12.17%)

Statcast era only — no tracking before 2015

Barrel% starts in 2015

What it takes
  • folds: sum(barrel_pct) avg(barrel_pct) min(barrel_pct) max(barrel_pct) count(barrel_pct) distinct(barrel_pct) only(barrel_pct) latest(barrel_pct) mean(barrel_pct) median(barrel_pct) mode(barrel_pct)
  • ranks: barrel_pct_percentile
  • accumulates: as_of(barrel_pct)
  • can be a benchmark
FanGraphs · Baseball Savant · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.hitters
select player, team, season, pa, avg, ops, wrc_plus, war
order by war desc
limit 100

select

The columns the answer carries

from mlb.hitters
select player, team, season, pa, avg, ops, wrc_plus, war
order by war desc
limit 100

as

Renames a column's heading and nothing else

from mlb.hitters
select player, team, pa as PA
order by pa desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.hitters
where season = $year
select player, team, season
order by pa desc
limit 10

limit

How many rows come back

from mlb.hitters
select player, team, season, pa, avg, ops, wrc_plus, war
order by war desc
limit 100

order by

Which end of the answer comes first

from mlb.hitters
select player, team, season, pa
order by pa desc
limit 10

#

A comment, to the end of the line

# Hitter seasons — One row per hitter per season, from FanGraphs' batting leaderboards.
from mlb.hitters
select player, team, season, pa, avg, ops, wrc_plus, war
order by war desc
limit 100

where

Chooses the rows the question is about

from mlb.hitters
where season = 2026
select player, pa
order by pa desc
limit 10

and

Continues whichever filter clause came last

from mlb.hitters
where season = 2026 and pa > 0
select player, pa
order by pa desc
limit 10

having

Filters the groups a fold made

from mlb.hitters
select player, sum(pa)
group by player
having sum(pa) > 0
order by sum(pa) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.hitters
where season = 2026
select player, pa, pa_percentile
keep pa_percentile >= 90
order by pa_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.hitters
select player, season, pa
highlight season = 2026
order by pa desc
limit 10

of

A threshold that is another row rather than a number

from mlb.hitters
where pa >= max(pa) of season 2026
select player, pa
order by pa desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.hitters
select player, count(*), sum(pa)
group by player
order by sum(pa) desc
limit 10

then

Folds the answer a second time

from mlb.hitters
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 by

Reads the answer as a matrix

from mlb.hitters
select player, season, sum(pa)
group by player, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.hitters
first 3 seasons
select player, sum(pa)
group by player
order by sum(pa) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.hitters
select player, sum(pa)
group by player
order by sum(pa) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.hitters
select player, avg(pa)
group by player
order by avg(pa) desc
limit 10

min(…)

The smallest value in each group

from mlb.hitters
select player, min(pa)
group by player
order by min(pa) desc
limit 10

max(…)

The largest value in each group

from mlb.hitters
select player, max(pa)
group by player
order by max(pa) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.hitters
select player, count(pa)
group by player
order by count(pa) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.hitters
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 mlb.hitters
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 mlb.hitters
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 mlb.hitters
select player, mean(pa)
group by player
order by mean(pa) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.hitters
select player, median(pa)
group by player
order by median(pa) desc
limit 10

mode(…)

The commonest value in the group

from mlb.hitters
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.hitters
where season = 2026
select player, pa, pa_percentile
order by pa_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.hitters
select player, sum(pa), percentile(sum(pa))
group by player
order by sum(pa) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.hitters
where season = 2026
select player, pa, standing(pa)
order by pa desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.hitters
where season = 2026
select player, games, pa, composite(games, pa)
order by composite(games, pa) desc
limit 10

ratio(…)

One column divided by another

from mlb.hitters
select player, count(*), ratio(sum(pa), count(*))
group by player
order by ratio(sum(pa), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.hitters
where season = 2026
select player, games, pa, calc(standing(games) - standing(pa))
order by calc(standing(games) - standing(pa)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.hitters
select player, pa, format(pa, > 0 -> "on the board", <= 0 -> "nothing yet")
order by pa desc
limit 10

pair

Draws two columns of the answer in one

from mlb.hitters
where season = 2026
select player, pa, pa_percentile
pair pa with pa_percentile
order by pa desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.hitters
where season = 2026
select player, games, pa, ab, composite(games, pa, ab) as Score
hint composite(games, pa, ab) as "G + PA + AB"
order by composite(games, pa, ab) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.pitchers Pitcher seasons

One row per pitcher per season, from FanGraphs' pitching leaderboards.

from mlb.pitchers
select player, team, season, ip, era, fip, war
order by war desc
limit 100
One row is
one player's season (player-season)
Built from
one table, read straight
Reads
mlb_pitcher_seasons FanGraphs, baseballr
Shows by default
player team season ip era fip war
Ordered by
war desc
Rows
100 by default, 5000 at most
Ranks within
season
Careers counted in
seasons
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position the role column
season the season column
Columns 22
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
FanGraphs · baseballr
team completes team Team string
dimension

The club.

Null when the season was split across clubs

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
qualified Qualified boolean
dimension

Whether he had enough playing time for the rate leaderboards — 3.1 plate appearances or 1 inning per team game. MLB.com

On FanGraphs' qualified leaderboard — the population a league rank is against

What it takes
  • folds: count(qualified) distinct(qualified) only(qualified) latest(qualified) mode(qualified)
FanGraphs · baseballr
role completes position Role string
dimension

Whether he was working as a starter or out of the bullpen.

SP when over half his appearances were starts, otherwise RP

Derived from games started — no role column exists upstream

What it takes
  • folds: count(role) distinct(role) only(role) latest(role) mode(role)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
starts GS integer
measure

Games he started. MLB.com

What it takes
  • folds: sum(starts) avg(starts) min(starts) max(starts) count(starts) distinct(starts) only(starts) latest(starts) mean(starts) median(starts) mode(starts)
  • ranks: starts_percentile
  • accumulates: as_of(starts)
  • can be a benchmark
FanGraphs · baseballr
ip IP number
measure

Innings pitched. The decimal is thirds of an inning: 6.2 is six and two outs. MLB.com

What it takes
  • folds: sum(ip) avg(ip) min(ip) max(ip) count(ip) distinct(ip) only(ip) latest(ip) mean(ip) median(ip) mode(ip)
  • ranks: ip_percentile
  • accumulates: as_of(ip)
  • can be a benchmark
FanGraphs · baseballr
er lower is better ER integer
measure

Earned runs allowed — the ones not caused by an error. MLB.com

What it takes
  • folds: sum(er) avg(er) min(er) max(er) count(er) distinct(er) only(er) latest(er) mean(er) median(er) mode(er)
  • ranks: er_percentile
  • accumulates: as_of(er)
  • can be a benchmark
FanGraphs · baseballr
k SO integer
measure

Strikeouts recorded. MLB.com

What it takes
  • folds: sum(k) avg(k) min(k) max(k) count(k) distinct(k) only(k) latest(k) mean(k) median(k) mode(k)
  • ranks: k_percentile
  • accumulates: as_of(k)
  • can be a benchmark
FanGraphs · baseballr
bb lower is better BB integer
measure

Walks he issued. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · baseballr
hr lower is better HR integer
measure

Home runs he gave up. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · baseballr
saves SV integer
measure

Saves. MLB.com

What it takes
  • folds: sum(saves) avg(saves) min(saves) max(saves) count(saves) distinct(saves) only(saves) latest(saves) mean(saves) median(saves) mode(saves)
  • ranks: saves_percentile
  • accumulates: as_of(saves)
  • can be a benchmark
FanGraphs · baseballr
era lower is better ERA number
measure

Earned run average — earned runs per nine innings, the number a pitcher is quoted by. MLB.com

What it takes
  • folds: sum(era) avg(era) min(era) max(era) count(era) distinct(era) only(era) latest(era) mean(era) median(era) mode(era)
  • ranks: era_percentile
  • accumulates: as_of(era)
  • can be a benchmark
FanGraphs · baseballr
whip lower is better WHIP number
measure

Walks and hits per inning pitched — how many runners the pitching put on. MLB.com

What it takes
  • folds: sum(whip) avg(whip) min(whip) max(whip) count(whip) distinct(whip) only(whip) latest(whip) mean(whip) median(whip) mode(whip)
  • ranks: whip_percentile
  • accumulates: as_of(whip)
  • can be a benchmark
FanGraphs · baseballr
fip lower is better FIP number
measure

Fielding independent pitching: what the ERA would be if only strikeouts, walks and home runs counted, put on the ERA scale. MLB.com

What it takes
  • folds: sum(fip) avg(fip) min(fip) max(fip) count(fip) distinct(fip) only(fip) latest(fip) mean(fip) median(fip) mode(fip)
  • ranks: fip_percentile
  • accumulates: as_of(fip)
  • can be a benchmark
FanGraphs · baseballr
xfip lower is better xFIP number
measure

FIP with his home-run rate replaced by the league's, on the theory that a pitcher controls fly balls but not which ones leave. MLB.com

What it takes
  • folds: sum(xfip) avg(xfip) min(xfip) max(xfip) count(xfip) distinct(xfip) only(xfip) latest(xfip) mean(xfip) median(xfip) mode(xfip)
  • ranks: xfip_percentile
  • accumulates: as_of(xfip)
  • can be a benchmark
FanGraphs · baseballr
k_9 K/9 number
measure

Strikeouts per nine innings. MLB.com

Strikeouts per nine innings, computed from the season line

What it takes
  • folds: sum(k_9) avg(k_9) min(k_9) max(k_9) count(k_9) distinct(k_9) only(k_9) latest(k_9) mean(k_9) median(k_9) mode(k_9)
  • ranks: k_9_percentile
  • accumulates: as_of(k_9)
  • can be a benchmark
FanGraphs · baseballr
bb_9 lower is better BB/9 number
measure

Walks per nine innings. MLB.com

What it takes
  • folds: sum(bb_9) avg(bb_9) min(bb_9) max(bb_9) count(bb_9) distinct(bb_9) only(bb_9) latest(bb_9) mean(bb_9) median(bb_9) mode(bb_9)
  • ranks: bb_9_percentile
  • accumulates: as_of(bb_9)
  • can be a benchmark
FanGraphs · baseballr
war WAR number
measure

Wins above replacement — batting, running and fielding together, as wins over a freely available player. FanGraphs

What it takes
  • folds: sum(war) avg(war) min(war) max(war) count(war) distinct(war) only(war) latest(war) mean(war) median(war) mode(war)
  • ranks: war_percentile
  • accumulates: as_of(war)
  • can be a benchmark
FanGraphs · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · baseballr
Scores this table names 1

pitching_score Pitching (0-100)

built from era fip war

One 0-100 score standing for a pitcher's whole season at once.

Where this season sits across ERA, FIP and WAR at once, 0-100 — 100 is the good end

from mlb.pitchers
where season = 2026
select player, pitching_score
order by pitching_score desc
limit 10
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.pitchers
select player, team, season, ip, era, fip, war
order by war desc
limit 100

select

The columns the answer carries

from mlb.pitchers
select player, team, season, ip, era, fip, war
order by war desc
limit 100

as

Renames a column's heading and nothing else

from mlb.pitchers
select player, team, ip as IP
order by ip desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.pitchers
where season = $year
select player, team, season
order by ip desc
limit 10

limit

How many rows come back

from mlb.pitchers
select player, team, season, ip, era, fip, war
order by war desc
limit 100

order by

Which end of the answer comes first

from mlb.pitchers
select player, team, season, ip
order by ip desc
limit 10

#

A comment, to the end of the line

# Pitcher seasons — One row per pitcher per season, from FanGraphs' pitching leaderboards.
from mlb.pitchers
select player, team, season, ip, era, fip, war
order by war desc
limit 100

where

Chooses the rows the question is about

from mlb.pitchers
where season = 2026
select player, ip
order by ip desc
limit 10

and

Continues whichever filter clause came last

from mlb.pitchers
where season = 2026 and ip > 0
select player, ip
order by ip desc
limit 10

having

Filters the groups a fold made

from mlb.pitchers
select player, sum(ip)
group by player
having sum(ip) > 0
order by sum(ip) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.pitchers
where season = 2026
select player, ip, ip_percentile
keep ip_percentile >= 90
order by ip_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.pitchers
select player, season, ip
highlight season = 2026
order by ip desc
limit 10

of

A threshold that is another row rather than a number

from mlb.pitchers
where ip >= max(ip) of role SP
select player, ip
order by ip desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.pitchers
select player, count(*), sum(ip)
group by player
order by sum(ip) desc
limit 10

then

Folds the answer a second time

from mlb.pitchers
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 by

Reads the answer as a matrix

from mlb.pitchers
select player, season, sum(ip)
group by player, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.pitchers
first 3 seasons
select player, sum(ip)
group by player
order by sum(ip) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.pitchers
select player, sum(ip)
group by player
order by sum(ip) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.pitchers
select player, avg(ip)
group by player
order by avg(ip) desc
limit 10

min(…)

The smallest value in each group

from mlb.pitchers
select player, min(ip)
group by player
order by min(ip) desc
limit 10

max(…)

The largest value in each group

from mlb.pitchers
select player, max(ip)
group by player
order by max(ip) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.pitchers
select player, count(ip)
group by player
order by count(ip) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.pitchers
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 mlb.pitchers
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 mlb.pitchers
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 mlb.pitchers
select player, mean(ip)
group by player
order by mean(ip) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.pitchers
select player, median(ip)
group by player
order by median(ip) desc
limit 10

mode(…)

The commonest value in the group

from mlb.pitchers
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.pitchers
where season = 2026
select player, ip, ip_percentile
order by ip_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.pitchers
select player, sum(ip), percentile(sum(ip))
group by player
order by sum(ip) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.pitchers
where season = 2026
select player, ip, standing(ip)
order by ip desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.pitchers
where season = 2026
select player, games, starts, composite(games, starts)
order by composite(games, starts) desc
limit 10

ratio(…)

One column divided by another

from mlb.pitchers
select player, count(*), ratio(sum(ip), count(*))
group by player
order by ratio(sum(ip), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.pitchers
where season = 2026
select player, games, starts, calc(standing(games) - standing(starts))
order by calc(standing(games) - standing(starts)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.pitchers
select player, ip, format(ip, > 0 -> "on the board", <= 0 -> "nothing yet")
order by ip desc
limit 10

pair

Draws two columns of the answer in one

from mlb.pitchers
where season = 2026
select player, ip, ip_percentile
pair ip with ip_percentile
order by ip desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.pitchers
where season = 2026
select player, games, starts, ip, composite(games, starts, ip) as Score
hint composite(games, starts, ip) as "G + GS + IP"
order by composite(games, starts, ip) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.pitcher_games Pitcher games

One row per pitcher per game: the batting line the hitters facing him put up.

from mlb.pitcher_games
select game_date, player, team, bf, avg, ops, k_pct
order by game_date desc
limit 200
One row is
one player's game (player-game)
Built from
one table, read straight
Reads
mlb_pitcher_games Baseball Savant, baseballr
Shows by default
game_date player team bf avg ops k_pct
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons games
Newest row
game_date

Before you trust the numbers

  • Regular season only. Rolled up from pitch-level Statcast, which begins in 2000; the expected columns begin in 2015.
  • Every rate here is the *hitters'* — avg is the average he allowed, and the low end is the good one.
  • No innings and so no ERA: Statcast records how a plate appearance ended, not outs recorded. Query mlb.player_pitching_days for his own line.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW.
  • A club's whole defensive line is the sum of these — see mlb.team_defense_games, which is the same aggregate keyed by the club.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position Statcast records how a plate appearance ended, not who started the game — query mlb.player_pitching_days for SP/RP
season the season column
Columns 27
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The date the game counts for, which is not the calendar date of a suspension

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
Baseball Savant · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
Baseball Savant · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
Baseball Savant · baseballr
team completes team Team string
dimension

The club.

The club he pitched for that day, so a trade is two dates rather than a null

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
Baseball Savant · baseballr
bf BF integer
measure

Batters faced — the denominator a pitcher's rates divide by. MLB.com

What it takes
  • folds: sum(bf) avg(bf) min(bf) max(bf) count(bf) distinct(bf) only(bf) latest(bf) mean(bf) median(bf) mode(bf)
  • ranks: bf_percentile
  • accumulates: as_of(bf)
  • can be a benchmark
Baseball Savant · baseballr
ab AB integer
measure

At-bats against him. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
Baseball Savant · baseballr
hits lower is better H integer
measure

Hits he gave up. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
Baseball Savant · baseballr
doubles lower is better 2B integer
measure

Doubles he gave up. MLB.com

What it takes
  • folds: sum(doubles) avg(doubles) min(doubles) max(doubles) count(doubles) distinct(doubles) only(doubles) latest(doubles) mean(doubles) median(doubles) mode(doubles)
  • ranks: doubles_percentile
  • accumulates: as_of(doubles)
  • can be a benchmark
Baseball Savant · baseballr
triples lower is better 3B integer
measure

Triples he gave up. MLB.com

What it takes
  • folds: sum(triples) avg(triples) min(triples) max(triples) count(triples) distinct(triples) only(triples) latest(triples) mean(triples) median(triples) mode(triples)
  • ranks: triples_percentile
  • accumulates: as_of(triples)
  • can be a benchmark
Baseball Savant · baseballr
hr lower is better HR integer
measure

Home runs he gave up. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
Baseball Savant · baseballr
bb lower is better BB integer
measure

Walks he issued. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
Baseball Savant · baseballr
k SO integer
measure

Strikeouts recorded. MLB.com

What it takes
  • folds: sum(k) avg(k) min(k) max(k) count(k) distinct(k) only(k) latest(k) mean(k) median(k) mode(k)
  • ranks: k_percentile
  • accumulates: as_of(k)
  • can be a benchmark
Baseball Savant · baseballr
hbp lower is better HBP integer
measure

Batters he hit. MLB.com

What it takes
  • folds: sum(hbp) avg(hbp) min(hbp) max(hbp) count(hbp) distinct(hbp) only(hbp) latest(hbp) mean(hbp) median(hbp) mode(hbp)
  • ranks: hbp_percentile
  • accumulates: as_of(hbp)
  • can be a benchmark
Baseball Savant · baseballr
tb lower is better TB integer
measure

Total bases he gave up. MLB.com

What it takes
  • folds: sum(tb) avg(tb) min(tb) max(tb) count(tb) distinct(tb) only(tb) latest(tb) mean(tb) median(tb) mode(tb)
  • ranks: tb_percentile
  • accumulates: as_of(tb)
  • can be a benchmark
Baseball Savant · baseballr
pitches P integer
measure

Pitches he threw. MLB.com

What it takes
  • folds: sum(pitches) avg(pitches) min(pitches) max(pitches) count(pitches) distinct(pitches) only(pitches) latest(pitches) mean(pitches) median(pitches) mode(pitches)
  • ranks: pitches_percentile
  • accumulates: as_of(pitches)
  • can be a benchmark
Baseball Savant · baseballr
avg lower is better AVG number
measure

What the hitters facing him batted. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
Baseball Savant · baseballr
obp lower is better OBP number
measure

How often the hitters facing him reached. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
Baseball Savant · baseballr
slg lower is better SLG number
measure

What the hitters facing him slugged. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
Baseball Savant · baseballr
ops lower is better OPS number
measure

The OPS the hitters facing him put up. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
Baseball Savant · baseballr
woba lower is better wOBA number
measure

The wOBA the hitters facing him put up. MLB.com

Statcast era only — the wOBA weights come from the tracking feed

wOBA starts in 2015

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
Baseball Savant · baseballr
xwoba lower is better xwOBA number
measure

What the contact he allowed was worth as a wOBA, from exit velocity and launch angle alone — before a fielder touched it. MLB.com

Statcast era only — expected wOBA is fitted on tracked contact

xwOBA starts in 2015

What it takes
  • folds: sum(xwoba) avg(xwoba) min(xwoba) max(xwoba) count(xwoba) distinct(xwoba) only(xwoba) latest(xwoba) mean(xwoba) median(xwoba) mode(xwoba)
  • ranks: xwoba_percentile
  • accumulates: as_of(xwoba)
  • can be a benchmark
Baseball Savant · baseballr
xba lower is better xBA number
measure

What the contact against him was worth as a batting average, before anyone fielded it. MLB.com

Statcast era only — expected batting average is fitted on tracked contact

xBA starts in 2015

What it takes
  • folds: sum(xba) avg(xba) min(xba) max(xba) count(xba) distinct(xba) only(xba) latest(xba) mean(xba) median(xba) mode(xba)
  • ranks: xba_percentile
  • accumulates: as_of(xba)
  • can be a benchmark
Baseball Savant · baseballr
k_pct K% number
measure

Share of the batters he faced that he struck out.

What it takes
  • folds: sum(k_pct) avg(k_pct) min(k_pct) max(k_pct) count(k_pct) distinct(k_pct) only(k_pct) latest(k_pct) mean(k_pct) median(k_pct) mode(k_pct)
  • ranks: k_pct_percentile
  • accumulates: as_of(k_pct)
  • can be a benchmark
Baseball Savant · baseballr
bb_pct lower is better BB% number
measure

Share of the batters he faced that he walked.

What it takes
  • folds: sum(bb_pct) avg(bb_pct) min(bb_pct) max(bb_pct) count(bb_pct) distinct(bb_pct) only(bb_pct) latest(bb_pct) mean(bb_pct) median(bb_pct) mode(bb_pct)
  • ranks: bb_pct_percentile
  • accumulates: as_of(bb_pct)
  • can be a benchmark
Baseball Savant · baseballr
csw_pct CSW% number
measure

Called strikes plus swinging strikes, over pitches — the one rate that counts both ways a pitch beats a hitter. FanGraphs

What it takes
  • folds: sum(csw_pct) avg(csw_pct) min(csw_pct) max(csw_pct) count(csw_pct) distinct(csw_pct) only(csw_pct) latest(csw_pct) mean(csw_pct) median(csw_pct) mode(csw_pct)
  • ranks: csw_pct_percentile
  • accumulates: as_of(csw_pct)
  • can be a benchmark
Baseball Savant · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

Baseball Savant · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

Baseball Savant · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.pitcher_games
select game_date, player, team, bf, avg, ops, k_pct
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.pitcher_games
select game_date, player, team, bf, avg, ops, k_pct
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.pitcher_games
select game_date, player, bf as BF
order by bf desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.pitcher_games
where season = $year
select game_date, player, team
order by bf desc
limit 10

limit

How many rows come back

from mlb.pitcher_games
select game_date, player, team, bf, avg, ops, k_pct
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.pitcher_games
select game_date, player, team, bf
order by bf desc
limit 10

#

A comment, to the end of the line

# Pitcher games — One row per pitcher per game: the batting line the hitters facing him put up.
from mlb.pitcher_games
select game_date, player, team, bf, avg, ops, k_pct
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.pitcher_games
where season = 2026
select player, bf
order by bf desc
limit 10

and

Continues whichever filter clause came last

from mlb.pitcher_games
where season = 2026 and bf > 0
select player, bf
order by bf desc
limit 10

having

Filters the groups a fold made

from mlb.pitcher_games
select player, sum(bf)
group by player
having sum(bf) > 0
order by sum(bf) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.pitcher_games
where season = 2026
select player, bf, bf_percentile
keep bf_percentile >= 90
order by bf_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.pitcher_games
select player, season, bf
highlight season = 2026
order by bf desc
limit 10

of

A threshold that is another row rather than a number

from mlb.pitcher_games
where bf >= max(bf) of season 2026
select player, bf
order by bf desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.pitcher_games
select player, count(*), sum(bf)
group by player
order by sum(bf) desc
limit 10

then

Folds the answer a second time

from mlb.pitcher_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 by

Reads the answer as a matrix

from mlb.pitcher_games
select player, team, sum(bf)
group by player, team
pivot by team
limit 25

first / last

Only part of each career, before anything else runs

from mlb.pitcher_games
first 3 game_dates
select player, sum(bf)
group by player
order by sum(bf) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.pitcher_games
select player, sum(bf)
group by player
order by sum(bf) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.pitcher_games
select player, avg(bf)
group by player
order by avg(bf) desc
limit 10

min(…)

The smallest value in each group

from mlb.pitcher_games
select player, min(bf)
group by player
order by min(bf) desc
limit 10

max(…)

The largest value in each group

from mlb.pitcher_games
select player, max(bf)
group by player
order by max(bf) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.pitcher_games
select player, count(bf)
group by player
order by count(bf) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.pitcher_games
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 mlb.pitcher_games
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 mlb.pitcher_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 mlb.pitcher_games
select player, mean(bf)
group by player
order by mean(bf) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.pitcher_games
select player, median(bf)
group by player
order by median(bf) desc
limit 10

mode(…)

The commonest value in the group

from mlb.pitcher_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 mlb.pitcher_games
select player, year(game_date), sum(bf)
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 mlb.pitcher_games
select player, quarter(game_date), sum(bf)
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 mlb.pitcher_games
select player, month(game_date), sum(bf)
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 mlb.pitcher_games
select player, week(game_date), sum(bf)
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 mlb.pitcher_games
where season = 2026
select player, month(game_date), as_of(bf)
group by player, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.pitcher_games
where season = 2026
select player, bf, bf_percentile
order by bf_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.pitcher_games
select player, sum(bf), percentile(sum(bf))
group by player
order by sum(bf) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.pitcher_games
where season = 2026
select player, bf, standing(bf)
order by bf desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.pitcher_games
where season = 2026
select player, bf, ab, composite(bf, ab)
order by composite(bf, ab) desc
limit 10

ratio(…)

One column divided by another

from mlb.pitcher_games
select player, count(*), ratio(sum(bf), count(*))
group by player
order by ratio(sum(bf), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.pitcher_games
where season = 2026
select player, bf, ab, calc(standing(bf) - standing(ab))
order by calc(standing(bf) - standing(ab)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.pitcher_games
select player, bf, format(bf, > 0 -> "on the board", <= 0 -> "nothing yet")
order by bf desc
limit 10

pair

Draws two columns of the answer in one

from mlb.pitcher_games
where season = 2026
select player, bf, bf_percentile
pair bf with bf_percentile
order by bf desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.pitcher_games
where season = 2026
select player, bf, ab, hits, composite(bf, ab, hits) as Score
hint composite(bf, ab, hits) as "BF + AB + H"
order by composite(bf, ab, hits) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.fielders Fielder seasons

One row per fielder per season, with run values summed across every position played.

from mlb.fielders
select player, team, season, position, innings, drs, oaa
order by drs desc
limit 100
One row is
one player's season (player-season)
Built from
one table, read straight
Reads
mlb_fielder_seasons FanGraphs, baseballr
Shows by default
player team season position innings drs oaa
Ordered by
drs desc
Rows
100 by default, 5000 at most
Ranks within
season
Careers counted in
seasons

Before you trust the numbers

  • Run values are summed across positions, which is how a season DRS total is normally quoted.
  • Rate stats like UZR/150 are deliberately absent — they do not survive that summing.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position the position column
season the season column
Columns 11
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
FanGraphs · baseballr
team completes team Team string
dimension

The club.

Null when the season was split across clubs

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
position completes position Pos string
dimension

The fielding position, by its scorer's name. MLB.com

Position with the most innings this season

What it takes
  • folds: count(position) distinct(position) only(position) latest(position) mode(position)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
innings Inn number
measure

Innings spent in the field. MLB.com

What it takes
  • folds: sum(innings) avg(innings) min(innings) max(innings) count(innings) distinct(innings) only(innings) latest(innings) mean(innings) median(innings) mode(innings)
  • ranks: innings_percentile
  • accumulates: as_of(innings)
  • can be a benchmark
FanGraphs · baseballr
drs DRS integer
measure

Defensive runs saved — runs the fielding was worth against an average fielder at the same position, from charted play. MLB.com

Defensive Runs Saved begins in 2002

DRS starts in 2002

What it takes
  • folds: sum(drs) avg(drs) min(drs) max(drs) count(drs) distinct(drs) only(drs) latest(drs) mean(drs) median(drs) mode(drs)
  • ranks: drs_percentile
  • accumulates: as_of(drs)
  • can be a benchmark
FanGraphs · Sports Info Solutions · baseballr
oaa OAA integer
measure

Outs above average — plays he made against what a fielder of average speed and positioning would have, measured from tracking. MLB.com

Statcast Outs Above Average begins in 2016

OAA starts in 2016

What it takes
  • folds: sum(oaa) avg(oaa) min(oaa) max(oaa) count(oaa) distinct(oaa) only(oaa) latest(oaa) mean(oaa) median(oaa) mode(oaa)
  • ranks: oaa_percentile
  • accumulates: as_of(oaa)
  • can be a benchmark
FanGraphs · Baseball Savant · baseballr
uzr UZR number
measure

Ultimate zone rating — the same question as DRS asked of zone data instead. MLB.com

What it takes
  • folds: sum(uzr) avg(uzr) min(uzr) max(uzr) count(uzr) distinct(uzr) only(uzr) latest(uzr) mean(uzr) median(uzr) mode(uzr)
  • ranks: uzr_percentile
  • accumulates: as_of(uzr)
  • can be a benchmark
FanGraphs · baseballr
defense Def number
measure

FanGraphs Def: his fielding runs plus the adjustment for how hard his position is. FanGraphs

What it takes
  • folds: sum(defense) avg(defense) min(defense) max(defense) count(defense) distinct(defense) only(defense) latest(defense) mean(defense) median(defense) mode(defense)
  • ranks: defense_percentile
  • accumulates: as_of(defense)
  • can be a benchmark
FanGraphs · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.fielders
select player, team, season, position, innings, drs, oaa
order by drs desc
limit 100

select

The columns the answer carries

from mlb.fielders
select player, team, season, position, innings, drs, oaa
order by drs desc
limit 100

as

Renames a column's heading and nothing else

from mlb.fielders
select player, team, innings as Inn
order by innings desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.fielders
where season = $year
select player, team, season
order by innings desc
limit 10

limit

How many rows come back

from mlb.fielders
select player, team, season, position, innings, drs, oaa
order by drs desc
limit 100

order by

Which end of the answer comes first

from mlb.fielders
select player, team, season, innings
order by innings desc
limit 10

#

A comment, to the end of the line

# Fielder seasons — One row per fielder per season, with run values summed across every position played.
from mlb.fielders
select player, team, season, position, innings, drs, oaa
order by drs desc
limit 100

where

Chooses the rows the question is about

from mlb.fielders
where season = 2026
select player, innings
order by innings desc
limit 10

and

Continues whichever filter clause came last

from mlb.fielders
where season = 2026 and innings > 0
select player, innings
order by innings desc
limit 10

having

Filters the groups a fold made

from mlb.fielders
select player, sum(innings)
group by player
having sum(innings) > 0
order by sum(innings) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.fielders
where season = 2026
select player, innings, innings_percentile
keep innings_percentile >= 90
order by innings_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.fielders
select player, season, innings
highlight season = 2026
order by innings desc
limit 10

of

A threshold that is another row rather than a number

from mlb.fielders
where innings >= max(innings) of position C
select player, innings
order by innings desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.fielders
select player, count(*), sum(innings)
group by player
order by sum(innings) desc
limit 10

then

Folds the answer a second time

from mlb.fielders
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 by

Reads the answer as a matrix

from mlb.fielders
select player, season, sum(innings)
group by player, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.fielders
first 3 seasons
select player, sum(innings)
group by player
order by sum(innings) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.fielders
select player, sum(innings)
group by player
order by sum(innings) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.fielders
select player, avg(innings)
group by player
order by avg(innings) desc
limit 10

min(…)

The smallest value in each group

from mlb.fielders
select player, min(innings)
group by player
order by min(innings) desc
limit 10

max(…)

The largest value in each group

from mlb.fielders
select player, max(innings)
group by player
order by max(innings) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.fielders
select player, count(innings)
group by player
order by count(innings) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.fielders
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 mlb.fielders
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 mlb.fielders
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 mlb.fielders
select player, mean(innings)
group by player
order by mean(innings) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.fielders
select player, median(innings)
group by player
order by median(innings) desc
limit 10

mode(…)

The commonest value in the group

from mlb.fielders
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.fielders
where season = 2026
select player, innings, innings_percentile
order by innings_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.fielders
select player, sum(innings), percentile(sum(innings))
group by player
order by sum(innings) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.fielders
where season = 2026
select player, innings, standing(innings)
order by innings desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.fielders
where season = 2026
select player, games, innings, composite(games, innings)
order by composite(games, innings) desc
limit 10

ratio(…)

One column divided by another

from mlb.fielders
select player, count(*), ratio(sum(innings), count(*))
group by player
order by ratio(sum(innings), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.fielders
where season = 2026
select player, games, innings, calc(standing(games) - standing(innings))
order by calc(standing(games) - standing(innings)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.fielders
select player, innings, format(innings, > 0 -> "on the board", <= 0 -> "nothing yet")
order by innings desc
limit 10

pair

Draws two columns of the answer in one

from mlb.fielders
where season = 2026
select player, innings, innings_percentile
pair innings with innings_percentile
order by innings desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.fielders
where season = 2026
select player, games, innings, drs, composite(games, innings, drs) as Score
hint composite(games, innings, drs) as "G + Inn + DRS"
order by composite(games, innings, drs) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.player_month_pitching Pitcher months

One row per pitcher per calendar month, from the Stats API's monthly splits — the finest grain ERA exists at.

from mlb.player_month_pitching
select player, team, season, month, ip, era, whip, k_9
order by month asc
limit 100
One row is
one player's month (player-month)
Built from
one table, read straight
Reads
mlb_player_month_pitching MLB Stats API, baseballr
Shows by default
player team season month ip era whip k_9
Ordered by
month asc
Rows
100 by default, 5000 at most
Ranks within
season month
Careers counted in
seasons months

Before you trust the numbers

  • Monthly splits are served from 2015 onward; earlier seasons have none.
  • A month's ERA is rebuilt from its earned runs and innings, never averaged across pitchers.
  • Hits and runs were added in 2026 — months loaded before that read WHIP and RA/9 as null until the next sync.
  • A bullpen is where role = RP. starts = 0 is the stricter reading and drops a reliever's whole month the first time he opens a game.
Dimensions 6
NameBound to
league always mlb
team the team column
player the player column
position the role column
season the season column
monththis sport only the month column
Columns 20
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
MLB Stats API · baseballr
month Month period
dimension

Calendar month the row covers, as YYYY-MM.

Calendar month as YYYY-MM, March through October

What it takes
  • folds: count(month) distinct(month) only(month) latest(month) mode(month)
MLB Stats API · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
MLB Stats API · baseballr
team completes team Team string
dimension

The club.

Whoever he threw the most pitches for that month; a mid-month trade lands on one of them

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
MLB Stats API · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
MLB Stats API · baseballr
starts GS integer
measure

Games he started. MLB.com

What it takes
  • folds: sum(starts) avg(starts) min(starts) max(starts) count(starts) distinct(starts) only(starts) latest(starts) mean(starts) median(starts) mode(starts)
  • ranks: starts_percentile
  • accumulates: as_of(starts)
  • can be a benchmark
MLB Stats API · baseballr
role completes position Role string
dimension

Whether he was working as a starter or out of the bullpen.

SP when over half his appearances that month were starts, otherwise RP

Derived from games started — a month is short, so a swingman's starts and relief outings share one row

What it takes
  • folds: count(role) distinct(role) only(role) latest(role) mode(role)
MLB Stats API · baseballr
ip IP number
measure

Innings pitched. The decimal is thirds of an inning: 6.2 is six and two outs. MLB.com

What it takes
  • folds: sum(ip) avg(ip) min(ip) max(ip) count(ip) distinct(ip) only(ip) latest(ip) mean(ip) median(ip) mode(ip)
  • ranks: ip_percentile
  • accumulates: as_of(ip)
  • can be a benchmark
MLB Stats API · baseballr
er lower is better ER integer
measure

Earned runs allowed — the ones not caused by an error. MLB.com

What it takes
  • folds: sum(er) avg(er) min(er) max(er) count(er) distinct(er) only(er) latest(er) mean(er) median(er) mode(er)
  • ranks: er_percentile
  • accumulates: as_of(er)
  • can be a benchmark
MLB Stats API · baseballr
r lower is better R integer
measure

Runs allowed, earned or not. MLB.com

What it takes
  • folds: sum(r) avg(r) min(r) max(r) count(r) distinct(r) only(r) latest(r) mean(r) median(r) mode(r)
  • ranks: r_percentile
  • accumulates: as_of(r)
  • can be a benchmark
MLB Stats API · baseballr
hits lower is better H integer
measure

Hits he gave up. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
MLB Stats API · baseballr
k SO integer
measure

Strikeouts recorded. MLB.com

What it takes
  • folds: sum(k) avg(k) min(k) max(k) count(k) distinct(k) only(k) latest(k) mean(k) median(k) mode(k)
  • ranks: k_percentile
  • accumulates: as_of(k)
  • can be a benchmark
MLB Stats API · baseballr
bb lower is better BB integer
measure

Walks he issued. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
MLB Stats API · baseballr
hr lower is better HR integer
measure

Home runs he gave up. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
MLB Stats API · baseballr
era lower is better ERA number
measure

Earned run average — earned runs per nine innings, the number a pitcher is quoted by. MLB.com

Earned runs per nine innings, over the month

What it takes
  • folds: sum(era) avg(era) min(era) max(era) count(era) distinct(era) only(era) latest(era) mean(era) median(era) mode(era)
  • ranks: era_percentile
  • accumulates: as_of(era)
  • can be a benchmark
MLB Stats API · baseballr
ra_9 lower is better RA/9 number
measure

Runs allowed per nine innings, earned or not — ERA with the scorer's judgement taken out. MLB.com

What it takes
  • folds: sum(ra_9) avg(ra_9) min(ra_9) max(ra_9) count(ra_9) distinct(ra_9) only(ra_9) latest(ra_9) mean(ra_9) median(ra_9) mode(ra_9)
  • ranks: ra_9_percentile
  • accumulates: as_of(ra_9)
  • can be a benchmark
MLB Stats API · baseballr
whip lower is better WHIP number
measure

Walks and hits per inning pitched — how many runners the pitching put on. MLB.com

What it takes
  • folds: sum(whip) avg(whip) min(whip) max(whip) count(whip) distinct(whip) only(whip) latest(whip) mean(whip) median(whip) mode(whip)
  • ranks: whip_percentile
  • accumulates: as_of(whip)
  • can be a benchmark
MLB Stats API · baseballr
k_9 K/9 number
measure

Strikeouts per nine innings. MLB.com

What it takes
  • folds: sum(k_9) avg(k_9) min(k_9) max(k_9) count(k_9) distinct(k_9) only(k_9) latest(k_9) mean(k_9) median(k_9) mode(k_9)
  • ranks: k_9_percentile
  • accumulates: as_of(k_9)
  • can be a benchmark
MLB Stats API · baseballr
bb_9 lower is better BB/9 number
measure

Walks per nine innings. MLB.com

What it takes
  • folds: sum(bb_9) avg(bb_9) min(bb_9) max(bb_9) count(bb_9) distinct(bb_9) only(bb_9) latest(bb_9) mean(bb_9) median(bb_9) mode(bb_9)
  • ranks: bb_9_percentile
  • accumulates: as_of(bb_9)
  • can be a benchmark
MLB Stats API · baseballr
hr_9 lower is better HR/9 number
measure

Home runs allowed per nine innings. MLB.com

What it takes
  • folds: sum(hr_9) avg(hr_9) min(hr_9) max(hr_9) count(hr_9) distinct(hr_9) only(hr_9) latest(hr_9) mean(hr_9) median(hr_9) mode(hr_9)
  • ranks: hr_9_percentile
  • accumulates: as_of(hr_9)
  • can be a benchmark
MLB Stats API · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.player_month_pitching
select player, team, season, month, ip, era, whip, k_9
order by month asc
limit 100

select

The columns the answer carries

from mlb.player_month_pitching
select player, team, season, month, ip, era, whip, k_9
order by month asc
limit 100

as

Renames a column's heading and nothing else

from mlb.player_month_pitching
select player, team, ip as IP
order by ip desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.player_month_pitching
where season = $year
select player, team, season
order by ip desc
limit 10

limit

How many rows come back

from mlb.player_month_pitching
select player, team, season, month, ip, era, whip, k_9
order by month asc
limit 100

order by

Which end of the answer comes first

from mlb.player_month_pitching
select player, team, season, ip
order by ip desc
limit 10

#

A comment, to the end of the line

# Pitcher months — One row per pitcher per calendar month, from the Stats API's monthly splits — the finest grain ERA exists at.
from mlb.player_month_pitching
select player, team, season, month, ip, era, whip, k_9
order by month asc
limit 100

where

Chooses the rows the question is about

from mlb.player_month_pitching
where season = 2026
select player, ip
order by ip desc
limit 10

and

Continues whichever filter clause came last

from mlb.player_month_pitching
where season = 2026 and ip > 0
select player, ip
order by ip desc
limit 10

having

Filters the groups a fold made

from mlb.player_month_pitching
select player, sum(ip)
group by player
having sum(ip) > 0
order by sum(ip) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, ip, ip_percentile
keep ip_percentile >= 90
order by ip_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.player_month_pitching
select player, season, ip
highlight season = 2026
order by ip desc
limit 10

of

A threshold that is another row rather than a number

from mlb.player_month_pitching
where ip >= max(ip) of season 2026
select player, ip
order by ip desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.player_month_pitching
select player, count(*), sum(ip)
group by player
order by sum(ip) desc
limit 10

then

Folds the answer a second time

from mlb.player_month_pitching
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 by

Reads the answer as a matrix

from mlb.player_month_pitching
select player, season, sum(ip)
group by player, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.player_month_pitching
first 3 seasons
select player, sum(ip)
group by player
order by sum(ip) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.player_month_pitching
select player, sum(ip)
group by player
order by sum(ip) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.player_month_pitching
select player, avg(ip)
group by player
order by avg(ip) desc
limit 10

min(…)

The smallest value in each group

from mlb.player_month_pitching
select player, min(ip)
group by player
order by min(ip) desc
limit 10

max(…)

The largest value in each group

from mlb.player_month_pitching
select player, max(ip)
group by player
order by max(ip) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.player_month_pitching
select player, count(ip)
group by player
order by count(ip) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.player_month_pitching
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 mlb.player_month_pitching
where season = 2026 and month = 2026-06
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 mlb.player_month_pitching
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 mlb.player_month_pitching
select player, mean(ip)
group by player
order by mean(ip) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.player_month_pitching
select player, median(ip)
group by player
order by median(ip) desc
limit 10

mode(…)

The commonest value in the group

from mlb.player_month_pitching
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, ip, ip_percentile
order by ip_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.player_month_pitching
select player, sum(ip), percentile(sum(ip))
group by player
order by sum(ip) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, ip, standing(ip)
order by ip desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, games, starts, composite(games, starts)
order by composite(games, starts) desc
limit 10

ratio(…)

One column divided by another

from mlb.player_month_pitching
select player, count(*), ratio(sum(ip), count(*))
group by player
order by ratio(sum(ip), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, games, starts, calc(standing(games) - standing(starts))
order by calc(standing(games) - standing(starts)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.player_month_pitching
select player, ip, format(ip, > 0 -> "on the board", <= 0 -> "nothing yet")
order by ip desc
limit 10

pair

Draws two columns of the answer in one

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, ip, ip_percentile
pair ip with ip_percentile
order by ip desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.player_month_pitching
where season = 2026 and month = 2026-06
select player, games, starts, ip, composite(games, starts, ip) as Score
hint composite(games, starts, ip) as "G + GS + IP"
order by composite(games, starts, ip) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.team_seasons Team seasons

One row per club per season: record and how far October went.

from mlb.team_seasons
select team, season, wins, losses, win_pct, playoff_round
order by wins desc
limit 60
One row is
one team's season (team-season)
Built from
one table, read straight
Reads
mlb_team_seasons MLB Stats API, baseballr
Shows by default
team season wins losses win_pct playoff_round
Ordered by
wins desc
Rows
60 by default, 3000 at most
Ranks within
season
Careers counted in
seasons

Before you trust the numbers

  • playoff_round is the furthest round reached, not a round-by-round record.
Dimensions 5
NameBound to
league always mlb
team the team column
player This dataset is one row per club — query mlb.hitters for players
position Positions belong to players, and this dataset has no players
season the season column
Columns 8
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
MLB Stats API · baseballr
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
MLB Stats API · baseballr
circuit AL/NL string
dimension

American or National League.

American or National League — league is taken by the sport itself

What it takes
  • folds: count(circuit) distinct(circuit) only(circuit) latest(circuit) mode(circuit)
MLB Stats API · baseballr
wins W integer
measure

Wins. MLB.com

What it takes
  • folds: sum(wins) avg(wins) min(wins) max(wins) count(wins) distinct(wins) only(wins) latest(wins) mean(wins) median(wins) mode(wins)
  • ranks: wins_percentile
  • accumulates: as_of(wins)
  • can be a benchmark
MLB Stats API · baseballr
losses lower is better L integer
measure

Losses. MLB.com

What it takes
  • folds: sum(losses) avg(losses) min(losses) max(losses) count(losses) distinct(losses) only(losses) latest(losses) mean(losses) median(losses) mode(losses)
  • ranks: losses_percentile
  • accumulates: as_of(losses)
  • can be a benchmark
MLB Stats API · baseballr
win_pct W% number
measure

Share of games won. MLB.com

What it takes
  • folds: sum(win_pct) avg(win_pct) min(win_pct) max(win_pct) count(win_pct) distinct(win_pct) only(win_pct) latest(win_pct) mean(win_pct) median(win_pct) mode(win_pct)
  • ranks: win_pct_percentile
  • accumulates: as_of(win_pct)
  • can be a benchmark
MLB Stats API · baseballr
playoff_round Finish string
dimension

How far the club got that October, from missing out to winning it.

missed, wc, lds, lcs, ws or champion — blank until that October is played

Derived from the postseason games themselves, so it is blank for a season whose October has not been played

What it takes
  • folds: count(playoff_round) distinct(playoff_round) only(playoff_round) latest(playoff_round) mode(playoff_round)
MLB Stats API · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

MLB Stats API · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.team_seasons
select team, season, wins, losses, win_pct, playoff_round
order by wins desc
limit 60

select

The columns the answer carries

from mlb.team_seasons
select team, season, wins, losses, win_pct, playoff_round
order by wins desc
limit 60

as

Renames a column's heading and nothing else

from mlb.team_seasons
select team, season, wins as W
order by wins desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_seasons
where season = $year
select team, season, wins
order by wins desc
limit 10

limit

How many rows come back

from mlb.team_seasons
select team, season, wins, losses, win_pct, playoff_round
order by wins desc
limit 60

order by

Which end of the answer comes first

from mlb.team_seasons
select team, season, wins
order by wins desc
limit 10

#

A comment, to the end of the line

# Team seasons — One row per club per season: record and how far October went.
from mlb.team_seasons
select team, season, wins, losses, win_pct, playoff_round
order by wins desc
limit 60

where

Chooses the rows the question is about

from mlb.team_seasons
where season = 2026
select team, wins
order by wins desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_seasons
where season = 2026 and wins > 0
select team, wins
order by wins desc
limit 10

having

Filters the groups a fold made

from mlb.team_seasons
select team, sum(wins)
group by team
having sum(wins) > 0
order by sum(wins) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_seasons
where season = 2026
select team, wins, wins_percentile
keep wins_percentile >= 90
order by wins_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_seasons
select team, season, wins
highlight season = 2026
order by wins desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_seasons
where wins >= max(wins) of season 2026
select team, wins
order by wins desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_seasons
select team, count(*), sum(wins)
group by team
order by sum(wins) desc
limit 10

then

Folds the answer a second time

from mlb.team_seasons
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 by

Reads the answer as a matrix

from mlb.team_seasons
select team, season, sum(wins)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
select team, avg(wins)
group by team
order by avg(wins) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_seasons
select team, min(wins)
group by team
order by min(wins) desc
limit 10

max(…)

The largest value in each group

from mlb.team_seasons
select team, max(wins)
group by team
order by max(wins) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_seasons
select team, count(wins)
group by team
order by count(wins) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
select team, median(wins)
group by team
order by median(wins) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_seasons
select team, mode(team)
group by team
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
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 mlb.team_seasons
select team, wins, format(wins, > 0 -> "on the board", <= 0 -> "nothing yet")
order by wins desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_seasons
where season = 2026
select team, wins, wins_percentile
pair wins with wins_percentile
order by wins desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_seasons
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

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.team_season_lines Team season lines

One row per club per season: batting, pitching, fielding and record together — the dataset a club's own two sides can be ranked against each other in.

from mlb.team_season_lines
select team, season, wins, losses, wrc_plus, era, fip, drs
order by wins desc
limit 60
One row is
one team's season (team-season)
Built from
one table, read straight
Reads
mlb_team_season_lines FanGraphs, MLB Stats API, baseballr
Shows by default
team season wins losses wrc_plus era fip drs
Ordered by
wins desc
Rows
60 by default, 3000 at most
Ranks within
season
Careers counted in
seasons

Before you trust the numbers

  • Batting, pitching, the record and the October finish cover 2000 on; DRS covers 2002 on; the official fielding counts are loaded from 2015 on.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW, even though the batting and pitching lines come off FanGraphs' boards.
  • The pitching side is the renamed one where the two collide: hr is the club's home runs and hr_allowed is its staff's.
  • DRS is the club's own from the team board, not the sum of its fielders' seasons — a player traded mid-year has no club on a FanGraphs season line and would be dropped from such a sum.
  • Across seasons wRC+, wOBA, OPS, OBP, SLG and FIP fold by playing time, which is an approximation: their constants are refit every year.
Dimensions 5
NameBound to
league always mlb
team the team column
player This dataset is one row per club — query mlb.hitters for players
position The club's season is summed over every position — query mlb.fielders for a position's own line
season the season column
Columns 48
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · MLB Stats API · baseballr
circuit AL/NL string
dimension

American or National League.

American or National League — league is taken by the sport itself

What it takes
  • folds: count(circuit) distinct(circuit) only(circuit) latest(circuit) mode(circuit)
FanGraphs · MLB Stats API · baseballr
division Division string
dimension

The division the club plays in, AL East through NL West.

The current alignment, not the one in force that season — dim_team holds one division per club

What it takes
  • folds: count(division) distinct(division) only(division) latest(division) mode(division)
FanGraphs · MLB Stats API · baseballr
playoff_round Finish string
dimension

How far the club got that October, from missing out to winning it.

missed, wc, lds, lcs, ws or champion — blank until that October is played

Derived from the postseason games themselves, so it is blank for a season whose October has not been played

What it takes
  • folds: count(playoff_round) distinct(playoff_round) only(playoff_round) latest(playoff_round) mode(playoff_round)
FanGraphs · MLB Stats API · baseballr
wins W integer
measure

Wins. MLB.com

What it takes
  • folds: sum(wins) avg(wins) min(wins) max(wins) count(wins) distinct(wins) only(wins) latest(wins) mean(wins) median(wins) mode(wins)
  • ranks: wins_percentile
  • accumulates: as_of(wins)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
losses lower is better L integer
measure

Losses. MLB.com

What it takes
  • folds: sum(losses) avg(losses) min(losses) max(losses) count(losses) distinct(losses) only(losses) latest(losses) mean(losses) median(losses) mode(losses)
  • ranks: losses_percentile
  • accumulates: as_of(losses)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
win_pct W% number
measure

Share of games won. MLB.com

What it takes
  • folds: sum(win_pct) avg(win_pct) min(win_pct) max(win_pct) count(win_pct) distinct(win_pct) only(win_pct) latest(win_pct) mean(win_pct) median(win_pct) mode(win_pct)
  • ranks: win_pct_percentile
  • accumulates: as_of(win_pct)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
run_diff RD integer
measure

Runs scored less runs allowed — the best one-number read on how good a club actually was. MLB.com

What it takes
  • folds: sum(run_diff) avg(run_diff) min(run_diff) max(run_diff) count(run_diff) distinct(run_diff) only(run_diff) latest(run_diff) mean(run_diff) median(run_diff) mode(run_diff)
  • ranks: run_diff_percentile
  • accumulates: as_of(run_diff)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
pa PA integer
measure

Plate appearances — every trip to the plate, walks and sacrifices included. MLB.com

What it takes
  • folds: sum(pa) avg(pa) min(pa) max(pa) count(pa) distinct(pa) only(pa) latest(pa) mean(pa) median(pa) mode(pa)
  • ranks: pa_percentile
  • accumulates: as_of(pa)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
ab AB integer
measure

At-bats — plate appearances less walks, hit-by-pitches and sacrifices. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
hits H integer
measure

Hits. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
hr HR integer
measure

Home runs hit. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
runs R integer
measure

Runs scored. MLB.com

What it takes
  • folds: sum(runs) avg(runs) min(runs) max(runs) count(runs) distinct(runs) only(runs) latest(runs) mean(runs) median(runs) mode(runs)
  • ranks: runs_percentile
  • accumulates: as_of(runs)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
bb BB integer
measure

Walks drawn. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
so lower is better SO integer
measure

Times struck out at the plate. MLB.com

What it takes
  • folds: sum(so) avg(so) min(so) max(so) count(so) distinct(so) only(so) latest(so) mean(so) median(so) mode(so)
  • ranks: so_percentile
  • accumulates: as_of(so)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
avg AVG number
measure

Batting average — hits per at-bat. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
obp OBP number
measure

On-base percentage — how often a plate appearance ended with a runner on. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
slg SLG number
measure

Slugging percentage — total bases per at-bat, so it weighs extra-base hits. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
ops OPS number
measure

On-base plus slugging: the two rates added, the quickest one-number read on a hitter. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
woba wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
wrc_plus wRC+ integer
measure

Runs created, adjusted for park and league and set on a scale where 100 is average and 150 is half again better. MLB.com

What it takes
  • folds: sum(wrc_plus) avg(wrc_plus) min(wrc_plus) max(wrc_plus) count(wrc_plus) distinct(wrc_plus) only(wrc_plus) latest(wrc_plus) mean(wrc_plus) median(wrc_plus) mode(wrc_plus)
  • ranks: wrc_plus_percentile
  • accumulates: as_of(wrc_plus)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
batting_war bWAR number
measure

Wins above replacement from the position players alone. FanGraphs

Position-player WAR — the team batting board's own total, with no pitching in it

What it takes
  • folds: sum(batting_war) avg(batting_war) min(batting_war) max(batting_war) count(batting_war) distinct(batting_war) only(batting_war) latest(batting_war) mean(batting_war) median(batting_war) mode(batting_war)
  • ranks: batting_war_percentile
  • accumulates: as_of(batting_war)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
ip IP number
measure

Innings pitched. The decimal is thirds of an inning: 6.2 is six and two outs. MLB.com

What it takes
  • folds: sum(ip) avg(ip) min(ip) max(ip) count(ip) distinct(ip) only(ip) latest(ip) mean(ip) median(ip) mode(ip)
  • ranks: ip_percentile
  • accumulates: as_of(ip)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
bf BF integer
measure

Batters faced — the denominator a pitcher's rates divide by. MLB.com

What it takes
  • folds: sum(bf) avg(bf) min(bf) max(bf) count(bf) distinct(bf) only(bf) latest(bf) mean(bf) median(bf) mode(bf)
  • ranks: bf_percentile
  • accumulates: as_of(bf)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
hits_allowed lower is better H allowed integer
measure

Hits the club's pitching gave up. MLB.com

What it takes
  • folds: sum(hits_allowed) avg(hits_allowed) min(hits_allowed) max(hits_allowed) count(hits_allowed) distinct(hits_allowed) only(hits_allowed) latest(hits_allowed) mean(hits_allowed) median(hits_allowed) mode(hits_allowed)
  • ranks: hits_allowed_percentile
  • accumulates: as_of(hits_allowed)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
runs_allowed lower is better R allowed integer
measure

Runs the club allowed. MLB.com

What it takes
  • folds: sum(runs_allowed) avg(runs_allowed) min(runs_allowed) max(runs_allowed) count(runs_allowed) distinct(runs_allowed) only(runs_allowed) latest(runs_allowed) mean(runs_allowed) median(runs_allowed) mode(runs_allowed)
  • ranks: runs_allowed_percentile
  • accumulates: as_of(runs_allowed)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
er lower is better ER integer
measure

Earned runs allowed — the ones not caused by an error. MLB.com

What it takes
  • folds: sum(er) avg(er) min(er) max(er) count(er) distinct(er) only(er) latest(er) mean(er) median(er) mode(er)
  • ranks: er_percentile
  • accumulates: as_of(er)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
hr_allowed lower is better HR allowed integer
measure

Home runs the club's pitching gave up. MLB.com

What it takes
  • folds: sum(hr_allowed) avg(hr_allowed) min(hr_allowed) max(hr_allowed) count(hr_allowed) distinct(hr_allowed) only(hr_allowed) latest(hr_allowed) mean(hr_allowed) median(hr_allowed) mode(hr_allowed)
  • ranks: hr_allowed_percentile
  • accumulates: as_of(hr_allowed)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
bb_allowed lower is better BB allowed integer
measure

Walks the club's pitching gave up. MLB.com

What it takes
  • folds: sum(bb_allowed) avg(bb_allowed) min(bb_allowed) max(bb_allowed) count(bb_allowed) distinct(bb_allowed) only(bb_allowed) latest(bb_allowed) mean(bb_allowed) median(bb_allowed) mode(bb_allowed)
  • ranks: bb_allowed_percentile
  • accumulates: as_of(bb_allowed)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
k SO thrown integer
measure

Strikeouts recorded. MLB.com

What it takes
  • folds: sum(k) avg(k) min(k) max(k) count(k) distinct(k) only(k) latest(k) mean(k) median(k) mode(k)
  • ranks: k_percentile
  • accumulates: as_of(k)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
hbp_allowed lower is better HBP allowed integer
measure

Batters the club's pitching hit. MLB.com

What it takes
  • folds: sum(hbp_allowed) avg(hbp_allowed) min(hbp_allowed) max(hbp_allowed) count(hbp_allowed) distinct(hbp_allowed) only(hbp_allowed) latest(hbp_allowed) mean(hbp_allowed) median(hbp_allowed) mode(hbp_allowed)
  • ranks: hbp_allowed_percentile
  • accumulates: as_of(hbp_allowed)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
saves SV integer
measure

Saves. MLB.com

What it takes
  • folds: sum(saves) avg(saves) min(saves) max(saves) count(saves) distinct(saves) only(saves) latest(saves) mean(saves) median(saves) mode(saves)
  • ranks: saves_percentile
  • accumulates: as_of(saves)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
era lower is better ERA number
measure

Earned run average — earned runs per nine innings, the number a pitcher is quoted by. MLB.com

What it takes
  • folds: sum(era) avg(era) min(era) max(era) count(era) distinct(era) only(era) latest(era) mean(era) median(era) mode(era)
  • ranks: era_percentile
  • accumulates: as_of(era)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
whip lower is better WHIP number
measure

Walks and hits per inning pitched — how many runners the pitching put on. MLB.com

What it takes
  • folds: sum(whip) avg(whip) min(whip) max(whip) count(whip) distinct(whip) only(whip) latest(whip) mean(whip) median(whip) mode(whip)
  • ranks: whip_percentile
  • accumulates: as_of(whip)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
fip lower is better FIP number
measure

Fielding independent pitching: what the ERA would be if only strikeouts, walks and home runs counted, put on the ERA scale. MLB.com

What it takes
  • folds: sum(fip) avg(fip) min(fip) max(fip) count(fip) distinct(fip) only(fip) latest(fip) mean(fip) median(fip) mode(fip)
  • ranks: fip_percentile
  • accumulates: as_of(fip)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
fielding_pct FPCT number
measure

Share of chances handled cleanly. MLB.com

Official totals are loaded from 2015 on — earlier seasons are answerable by the source but are not backfilled

FPCT starts in 2015

What it takes
  • folds: sum(fielding_pct) avg(fielding_pct) min(fielding_pct) max(fielding_pct) count(fielding_pct) distinct(fielding_pct) only(fielding_pct) latest(fielding_pct) mean(fielding_pct) median(fielding_pct) mode(fielding_pct)
  • ranks: fielding_pct_percentile
  • accumulates: as_of(fielding_pct)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
errors lower is better E integer
measure

Errors, as the official scorer ruled them. MLB.com

Official totals are loaded from 2015 on

E starts in 2015

What it takes
  • folds: sum(errors) avg(errors) min(errors) max(errors) count(errors) distinct(errors) only(errors) latest(errors) mean(errors) median(errors) mode(errors)
  • ranks: errors_percentile
  • accumulates: as_of(errors)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
chances TC integer
measure

Total chances — putouts, assists and errors: every ball there was a play on. MLB.com

Official totals are loaded from 2015 on

TC starts in 2015

What it takes
  • folds: sum(chances) avg(chances) min(chances) max(chances) count(chances) distinct(chances) only(chances) latest(chances) mean(chances) median(chances) mode(chances)
  • ranks: chances_percentile
  • accumulates: as_of(chances)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
po PO integer
measure

Putouts — outs recorded without help. MLB.com

PO starts in 2015

What it takes
  • folds: sum(po) avg(po) min(po) max(po) count(po) distinct(po) only(po) latest(po) mean(po) median(po) mode(po)
  • ranks: po_percentile
  • accumulates: as_of(po)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
assists A integer
measure

Assists — throws that got somebody else the out. MLB.com

A starts in 2015

What it takes
  • folds: sum(assists) avg(assists) min(assists) max(assists) count(assists) distinct(assists) only(assists) latest(assists) mean(assists) median(assists) mode(assists)
  • ranks: assists_percentile
  • accumulates: as_of(assists)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
throwing_errors lower is better TE integer
measure

Errors on the throw.

Errors on the throw rather than on the catch

TE starts in 2015

What it takes
  • folds: sum(throwing_errors) avg(throwing_errors) min(throwing_errors) max(throwing_errors) count(throwing_errors) distinct(throwing_errors) only(throwing_errors) latest(throwing_errors) mean(throwing_errors) median(throwing_errors) mode(throwing_errors)
  • ranks: throwing_errors_percentile
  • accumulates: as_of(throwing_errors)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
double_plays DP integer
measure

Double plays turned. MLB.com

DP starts in 2015

What it takes
  • folds: sum(double_plays) avg(double_plays) min(double_plays) max(double_plays) count(double_plays) distinct(double_plays) only(double_plays) latest(double_plays) mean(double_plays) median(double_plays) mode(double_plays)
  • ranks: double_plays_percentile
  • accumulates: as_of(double_plays)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
error_rate lower is better E% number
measure

Share of chances that became errors.

Share of chances that became errors — fielding percentage read the other way

E% starts in 2015

What it takes
  • folds: sum(error_rate) avg(error_rate) min(error_rate) max(error_rate) count(error_rate) distinct(error_rate) only(error_rate) latest(error_rate) mean(error_rate) median(error_rate) mode(error_rate)
  • ranks: error_rate_percentile
  • accumulates: as_of(error_rate)
  • can be a benchmark
FanGraphs · MLB Stats API · baseballr
drs DRS integer
measure

Defensive runs saved — runs the fielding was worth against an average fielder at the same position, from charted play. MLB.com

Defensive Runs Saved, for the club as a whole — not the sum of its players' seasons, which drops anyone traded mid-year

Defensive Runs Saved begins in 2002

DRS starts in 2002

What it takes
  • folds: sum(drs) avg(drs) min(drs) max(drs) count(drs) distinct(drs) only(drs) latest(drs) mean(drs) median(drs) mode(drs)
  • ranks: drs_percentile
  • accumulates: as_of(drs)
  • can be a benchmark
FanGraphs · MLB Stats API · Sports Info Solutions · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · MLB Stats API · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · MLB Stats API · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.team_season_lines
select team, season, wins, losses, wrc_plus, era, fip, drs
order by wins desc
limit 60

select

The columns the answer carries

from mlb.team_season_lines
select team, season, wins, losses, wrc_plus, era, fip, drs
order by wins desc
limit 60

as

Renames a column's heading and nothing else

from mlb.team_season_lines
select team, season, wins as W
order by wins desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_season_lines
where season = $year
select team, season, wins
order by wins desc
limit 10

limit

How many rows come back

from mlb.team_season_lines
select team, season, wins, losses, wrc_plus, era, fip, drs
order by wins desc
limit 60

order by

Which end of the answer comes first

from mlb.team_season_lines
select team, season, wins
order by wins desc
limit 10

#

A comment, to the end of the line

# Team season lines — One row per club per season: batting, pitching, fielding and record together — the dataset a club's own two sides can be ranked against each other in.
from mlb.team_season_lines
select team, season, wins, losses, wrc_plus, era, fip, drs
order by wins desc
limit 60

where

Chooses the rows the question is about

from mlb.team_season_lines
where season = 2026
select team, wins
order by wins desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_season_lines
where season = 2026 and wins > 0
select team, wins
order by wins desc
limit 10

having

Filters the groups a fold made

from mlb.team_season_lines
select team, sum(wins)
group by team
having sum(wins) > 0
order by sum(wins) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_season_lines
where season = 2026
select team, wins, wins_percentile
keep wins_percentile >= 90
order by wins_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_season_lines
select team, season, wins
highlight season = 2026
order by wins desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_season_lines
where wins >= max(wins) of season 2026
select team, wins
order by wins desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_season_lines
select team, count(*), sum(wins)
group by team
order by sum(wins) desc
limit 10

then

Folds the answer a second time

from mlb.team_season_lines
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 by

Reads the answer as a matrix

from mlb.team_season_lines
select team, season, sum(wins)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
select team, avg(wins)
group by team
order by avg(wins) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_season_lines
select team, min(wins)
group by team
order by min(wins) desc
limit 10

max(…)

The largest value in each group

from mlb.team_season_lines
select team, max(wins)
group by team
order by max(wins) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_season_lines
select team, count(wins)
group by team
order by count(wins) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
select team, median(wins)
group by team
order by median(wins) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_season_lines
select team, mode(team)
group by team
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
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 mlb.team_season_lines
select team, wins, format(wins, > 0 -> "on the board", <= 0 -> "nothing yet")
order by wins desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_season_lines
where season = 2026
select team, wins, wins_percentile
pair wins with wins_percentile
order by wins desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_season_lines
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

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.team_games Team games

One row per club per game: who they played, runs scored, runs allowed and the result.

from mlb.team_games
select game_date, team, opponent, home, runs_scored, runs_allowed, result
order by game_date desc
limit 200
One row is
one team's game (team-game)
Built from
one table, read straight
Reads
mlb_team_games MLB Stats API, baseballr
Shows by default
game_date team opponent home runs_scored runs_allowed result
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons games
Newest row
game_date

Before you trust the numbers

  • Regular season only, and only games with a final score — a postponement carries no runs and is left out.
  • Scores come from the MLB schedule feed, the only exact source; runs derived from Statcast events land 2-3% low.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW.
  • The schedule feed is seeded from 2000 on — earlier seasons have no games here, not games with missing scores.
  • The starters come from the pitches rather than the schedule feed, so a game played today has null starters until the next Statcast load; 2005, 2006 and 2010 are each missing a handful of dates.
  • starter is the one this club sent out and opp_starter is the one it batted against — so a club's record behind its own lefties and its record against everyone else's are the same question from the two sides.
Dimensions 5
NameBound to
league always mlb
team the team column
player This dataset is one row per club per game — query mlb.hitters for players
position Positions belong to players, and this dataset has no players
season the season column
Columns 14
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The date the game counts for, which is not the calendar date of a suspension

Date starts in 2000

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
MLB Stats API · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

Season starts in 2000

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
MLB Stats API · baseballr
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
MLB Stats API · baseballr
opponent completes team Opp string
dimension

The other club in this game.

What it takes
  • folds: count(opponent) distinct(opponent) only(opponent) latest(opponent) mode(opponent)
MLB Stats API · baseballr
home Home boolean
dimension

Whether this club was the home side.

What it takes
  • folds: count(home) distinct(home) only(home) latest(home) mode(home)
MLB Stats API · baseballr
runs_scored R integer
measure

Runs the club scored. MLB.com

R starts in 2000

What it takes
  • folds: sum(runs_scored) avg(runs_scored) min(runs_scored) max(runs_scored) count(runs_scored) distinct(runs_scored) only(runs_scored) latest(runs_scored) mean(runs_scored) median(runs_scored) mode(runs_scored)
  • ranks: runs_scored_percentile
  • accumulates: as_of(runs_scored)
  • can be a benchmark
MLB Stats API · baseballr
runs_allowed lower is better RA integer
measure

Runs the club allowed. MLB.com

The opponent's final score — what this club's pitching and defense gave up

RA starts in 2000

What it takes
  • folds: sum(runs_allowed) avg(runs_allowed) min(runs_allowed) max(runs_allowed) count(runs_allowed) distinct(runs_allowed) only(runs_allowed) latest(runs_allowed) mean(runs_allowed) median(runs_allowed) mode(runs_allowed)
  • ranks: runs_allowed_percentile
  • accumulates: as_of(runs_allowed)
  • can be a benchmark
MLB Stats API · baseballr
run_diff Diff integer
measure

Runs scored less runs allowed — the best one-number read on how good a club actually was. MLB.com

Diff starts in 2000

What it takes
  • folds: sum(run_diff) avg(run_diff) min(run_diff) max(run_diff) count(run_diff) distinct(run_diff) only(run_diff) latest(run_diff) mean(run_diff) median(run_diff) mode(run_diff)
  • ranks: run_diff_percentile
  • accumulates: as_of(run_diff)
  • can be a benchmark
MLB Stats API · baseballr
result W/L string
dimension

How the game ended for this club: a win, a loss or a tie.

W, L or T — a called-level suspended game is the only way to get a T

W/L starts in 2000

What it takes
  • folds: count(result) distinct(result) only(result) latest(result) mode(result)
MLB Stats API · baseballr
starter completes player SP string
dimension

The pitcher this club started — the one who threw to the other side's first batter. MLB.com

The pitcher this club started

SP starts in 2000

What it takes
  • folds: count(starter) distinct(starter) only(starter) latest(starter) mode(starter)
MLB Stats API · baseballr
starter_throws SP hand string
dimension

Which hand this club's starter threw with that day.

L or R — the hand this club's starter threw with

SP hand starts in 2000

What it takes
  • folds: count(starter_throws) distinct(starter_throws) only(starter_throws) latest(starter_throws) mode(starter_throws)
MLB Stats API · baseballr
opp_starter completes player Opp SP string
dimension

The pitcher the other club started, and so the one this club had to bat against. MLB.com

The pitcher the other club started — the one this club had to bat against

Opp SP starts in 2000

What it takes
  • folds: count(opp_starter) distinct(opp_starter) only(opp_starter) latest(opp_starter) mode(opp_starter)
MLB Stats API · baseballr
opp_starter_throws Opp SP hand string
dimension

Which hand the opposing starter threw with that day.

L or R — the hand the opposing starter threw with

Opp SP hand starts in 2000

What it takes
  • folds: count(opp_starter_throws) distinct(opp_starter_throws) only(opp_starter_throws) latest(opp_starter_throws) mode(opp_starter_throws)
MLB Stats API · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

MLB Stats API · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.team_games
select game_date, team, opponent, home, runs_scored, runs_allowed, result
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.team_games
select game_date, team, opponent, home, runs_scored, runs_allowed, result
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.team_games
select game_date, team, runs_scored as R
order by runs_scored desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_games
where season = $year
select game_date, team, opponent
order by runs_scored desc
limit 10

limit

How many rows come back

from mlb.team_games
select game_date, team, opponent, home, runs_scored, runs_allowed, result
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.team_games
select game_date, team, opponent, runs_scored
order by runs_scored desc
limit 10

#

A comment, to the end of the line

# Team games — One row per club per game: who they played, runs scored, runs allowed and the result.
from mlb.team_games
select game_date, team, opponent, home, runs_scored, runs_allowed, result
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.team_games
where season = 2026
select team, runs_scored
order by runs_scored desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_games
where season = 2026 and runs_scored > 0
select team, runs_scored
order by runs_scored desc
limit 10

having

Filters the groups a fold made

from mlb.team_games
select team, sum(runs_scored)
group by team
having sum(runs_scored) > 0
order by sum(runs_scored) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_games
where season = 2026
select team, runs_scored, runs_scored_percentile
keep runs_scored_percentile >= 90
order by runs_scored_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_games
select team, season, runs_scored
highlight season = 2026
order by runs_scored desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_games
where runs_scored >= max(runs_scored) of season 2026
select team, runs_scored
order by runs_scored desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_games
select team, count(*), sum(runs_scored)
group by team
order by sum(runs_scored) desc
limit 10

then

Folds the answer a second time

from mlb.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 by

Reads the answer as a matrix

from mlb.team_games
select team, opponent, sum(runs_scored)
group by team, opponent
pivot by opponent
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_games
first 3 game_dates
select team, sum(runs_scored)
group by team
order by sum(runs_scored) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.team_games
select team, sum(runs_scored)
group by team
order by sum(runs_scored) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.team_games
select team, avg(runs_scored)
group by team
order by avg(runs_scored) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_games
select team, min(runs_scored)
group by team
order by min(runs_scored) desc
limit 10

max(…)

The largest value in each group

from mlb.team_games
select team, max(runs_scored)
group by team
order by max(runs_scored) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_games
select team, count(runs_scored)
group by team
order by count(runs_scored) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.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 mlb.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 mlb.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 mlb.team_games
select team, mean(runs_scored)
group by team
order by mean(runs_scored) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.team_games
select team, median(runs_scored)
group by team
order by median(runs_scored) desc
limit 10

mode(…)

The commonest value in the group

from mlb.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 mlb.team_games
select team, year(game_date), sum(runs_scored)
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 mlb.team_games
select team, quarter(game_date), sum(runs_scored)
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 mlb.team_games
select team, month(game_date), sum(runs_scored)
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 mlb.team_games
select team, week(game_date), sum(runs_scored)
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 mlb.team_games
where season = 2026
select team, month(game_date), as_of(runs_scored)
group by team, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_games
where season = 2026
select team, runs_scored, runs_scored_percentile
order by runs_scored_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.team_games
select team, sum(runs_scored), percentile(sum(runs_scored))
group by team
order by sum(runs_scored) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.team_games
where season = 2026
select team, runs_scored, standing(runs_scored)
order by runs_scored desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.team_games
where season = 2026
select team, runs_scored, runs_allowed, composite(runs_scored, runs_allowed)
order by composite(runs_scored, runs_allowed) desc
limit 10

ratio(…)

One column divided by another

from mlb.team_games
select team, count(*), ratio(sum(runs_scored), count(*))
group by team
order by ratio(sum(runs_scored), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.team_games
where season = 2026
select team, runs_scored, runs_allowed, calc(standing(runs_scored) - standing(runs_allowed))
order by calc(standing(runs_scored) - standing(runs_allowed)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.team_games
select team, runs_scored, format(runs_scored, > 0 -> "on the board", <= 0 -> "nothing yet")
order by runs_scored desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_games
where season = 2026
select team, runs_scored, runs_scored_percentile
pair runs_scored with runs_scored_percentile
order by runs_scored desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_games
where season = 2026
select team, runs_scored, runs_allowed, run_diff, composite(runs_scored, runs_allowed, run_diff) as Score
hint composite(runs_scored, runs_allowed, run_diff) as "R + RA + Diff"
order by composite(runs_scored, runs_allowed, run_diff) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.team_batting_games Team batting games

One row per club per game: the club's batting line, with rates that fold exactly over a span.

from mlb.team_batting_games
select game_date, team, pa, hits, hr, obp, slg, ops
order by game_date desc
limit 200
One row is
one team's game (team-game)
Built from
one table, read straight
Reads
mlb_team_batting_games Baseball Savant, baseballr
Shows by default
game_date team pa hits hr obp slg ops
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons games
Newest row
game_date

Before you trust the numbers

  • Regular season only. Rolled up from pitch-level Statcast, which begins in 2000.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW.
  • Rates fold as summed numerators over summed denominators, so a span of games is weighted by playing time rather than by number of games.
Dimensions 5
NameBound to
league always mlb
team the team column
player This dataset is one row per club per game — query mlb.hitters for players
position Positions belong to players, and this dataset has no players
season the season column
Columns 25
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The date the game counts for, which is not the calendar date of a suspension

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
Baseball Savant · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
Baseball Savant · baseballr
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
Baseball Savant · baseballr
batters Batters integer
measure

How many different hitters the club sent to the plate.

What it takes
  • folds: sum(batters) avg(batters) min(batters) max(batters) count(batters) distinct(batters) only(batters) latest(batters) mean(batters) median(batters) mode(batters)
  • ranks: batters_percentile
  • accumulates: as_of(batters)
  • can be a benchmark
Baseball Savant · baseballr
pa PA integer
measure

Plate appearances — every trip to the plate, walks and sacrifices included. MLB.com

What it takes
  • folds: sum(pa) avg(pa) min(pa) max(pa) count(pa) distinct(pa) only(pa) latest(pa) mean(pa) median(pa) mode(pa)
  • ranks: pa_percentile
  • accumulates: as_of(pa)
  • can be a benchmark
Baseball Savant · baseballr
ab AB integer
measure

At-bats — plate appearances less walks, hit-by-pitches and sacrifices. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
Baseball Savant · baseballr
hits H integer
measure

Hits. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
Baseball Savant · baseballr
doubles 2B integer
measure

Doubles. MLB.com

What it takes
  • folds: sum(doubles) avg(doubles) min(doubles) max(doubles) count(doubles) distinct(doubles) only(doubles) latest(doubles) mean(doubles) median(doubles) mode(doubles)
  • ranks: doubles_percentile
  • accumulates: as_of(doubles)
  • can be a benchmark
Baseball Savant · baseballr
triples 3B integer
measure

Triples. MLB.com

What it takes
  • folds: sum(triples) avg(triples) min(triples) max(triples) count(triples) distinct(triples) only(triples) latest(triples) mean(triples) median(triples) mode(triples)
  • ranks: triples_percentile
  • accumulates: as_of(triples)
  • can be a benchmark
Baseball Savant · baseballr
hr HR integer
measure

Home runs hit. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
Baseball Savant · baseballr
bb BB integer
measure

Walks drawn. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
Baseball Savant · baseballr
so lower is better SO integer
measure

Times struck out at the plate. MLB.com

What it takes
  • folds: sum(so) avg(so) min(so) max(so) count(so) distinct(so) only(so) latest(so) mean(so) median(so) mode(so)
  • ranks: so_percentile
  • accumulates: as_of(so)
  • can be a benchmark
Baseball Savant · baseballr
hbp HBP integer
measure

Times hit by a pitch. MLB.com

What it takes
  • folds: sum(hbp) avg(hbp) min(hbp) max(hbp) count(hbp) distinct(hbp) only(hbp) latest(hbp) mean(hbp) median(hbp) mode(hbp)
  • ranks: hbp_percentile
  • accumulates: as_of(hbp)
  • can be a benchmark
Baseball Savant · baseballr
sf SF integer
measure

Sacrifice flies. MLB.com

What it takes
  • folds: sum(sf) avg(sf) min(sf) max(sf) count(sf) distinct(sf) only(sf) latest(sf) mean(sf) median(sf) mode(sf)
  • ranks: sf_percentile
  • accumulates: as_of(sf)
  • can be a benchmark
Baseball Savant · baseballr
rbi RBI integer
measure

Runs batted in. MLB.com

What it takes
  • folds: sum(rbi) avg(rbi) min(rbi) max(rbi) count(rbi) distinct(rbi) only(rbi) latest(rbi) mean(rbi) median(rbi) mode(rbi)
  • ranks: rbi_percentile
  • accumulates: as_of(rbi)
  • can be a benchmark
Baseball Savant · baseballr
tb TB integer
measure

Total bases — a single counts one, a home run four. MLB.com

What it takes
  • folds: sum(tb) avg(tb) min(tb) max(tb) count(tb) distinct(tb) only(tb) latest(tb) mean(tb) median(tb) mode(tb)
  • ranks: tb_percentile
  • accumulates: as_of(tb)
  • can be a benchmark
Baseball Savant · baseballr
avg AVG number
measure

Batting average — hits per at-bat. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
Baseball Savant · baseballr
obp OBP number
measure

On-base percentage — how often a plate appearance ended with a runner on. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
Baseball Savant · baseballr
slg SLG number
measure

Slugging percentage — total bases per at-bat, so it weighs extra-base hits. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
Baseball Savant · baseballr
ops OPS number
measure

On-base plus slugging: the two rates added, the quickest one-number read on a hitter. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
Baseball Savant · baseballr
woba wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

Statcast era only — the wOBA weights come from the tracking feed

wOBA starts in 2015

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
Baseball Savant · baseballr
xba xBA number
measure

What the contact was worth as a batting average, before anyone fielded it. MLB.com

Over tracked batted balls with home runs *in*, unlike mlb.team_defense_games.xba_on_bip, which leaves them out because it is half of hits saved

xBA starts in 2015

What it takes
  • folds: sum(xba) avg(xba) min(xba) max(xba) count(xba) distinct(xba) only(xba) latest(xba) mean(xba) median(xba) mode(xba)
  • ranks: xba_percentile
  • accumulates: as_of(xba)
  • can be a benchmark
Baseball Savant · baseballr
xwoba xwOBA number
measure

What the contact was worth as a wOBA, from exit velocity and launch angle alone — the fielders and the park taken out. MLB.com

What this club's contact was worth on its own terms, before a fielder or a bounce touched it

Statcast era only — expected wOBA is fitted on tracked contact

xwOBA starts in 2015

What it takes
  • folds: sum(xwoba) avg(xwoba) min(xwoba) max(xwoba) count(xwoba) distinct(xwoba) only(xwoba) latest(xwoba) mean(xwoba) median(xwoba) mode(xwoba)
  • ranks: xwoba_percentile
  • accumulates: as_of(xwoba)
  • can be a benchmark
Baseball Savant · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

Baseball Savant · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

Baseball Savant · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.team_batting_games
select game_date, team, pa, hits, hr, obp, slg, ops
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.team_batting_games
select game_date, team, pa, hits, hr, obp, slg, ops
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.team_batting_games
select game_date, team, pa as PA
order by pa desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_batting_games
where season = $year
select game_date, team, pa
order by pa desc
limit 10

limit

How many rows come back

from mlb.team_batting_games
select game_date, team, pa, hits, hr, obp, slg, ops
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.team_batting_games
select game_date, team, pa
order by pa desc
limit 10

#

A comment, to the end of the line

# Team batting games — One row per club per game: the club's batting line, with rates that fold exactly over a span.
from mlb.team_batting_games
select game_date, team, pa, hits, hr, obp, slg, ops
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.team_batting_games
where season = 2026
select team, pa
order by pa desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_batting_games
where season = 2026 and pa > 0
select team, pa
order by pa desc
limit 10

having

Filters the groups a fold made

from mlb.team_batting_games
select team, sum(pa)
group by team
having sum(pa) > 0
order by sum(pa) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_batting_games
where season = 2026
select team, pa, pa_percentile
keep pa_percentile >= 90
order by pa_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_batting_games
select team, season, pa
highlight season = 2026
order by pa desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_batting_games
where pa >= max(pa) of season 2026
select team, pa
order by pa desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_batting_games
select team, count(*), sum(pa)
group by team
order by sum(pa) desc
limit 10

then

Folds the answer a second time

from mlb.team_batting_games
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 by

Reads the answer as a matrix

from mlb.team_batting_games
select team, season, sum(pa)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_batting_games
first 3 game_dates
select team, sum(pa)
group by team
order by sum(pa) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.team_batting_games
select team, sum(pa)
group by team
order by sum(pa) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.team_batting_games
select team, avg(pa)
group by team
order by avg(pa) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_batting_games
select team, min(pa)
group by team
order by min(pa) desc
limit 10

max(…)

The largest value in each group

from mlb.team_batting_games
select team, max(pa)
group by team
order by max(pa) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_batting_games
select team, count(pa)
group by team
order by count(pa) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_batting_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 mlb.team_batting_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 mlb.team_batting_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 mlb.team_batting_games
select team, mean(pa)
group by team
order by mean(pa) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.team_batting_games
select team, median(pa)
group by team
order by median(pa) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_batting_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 mlb.team_batting_games
select team, year(game_date), sum(pa)
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 mlb.team_batting_games
select team, quarter(game_date), sum(pa)
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 mlb.team_batting_games
select team, month(game_date), sum(pa)
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 mlb.team_batting_games
select team, week(game_date), sum(pa)
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 mlb.team_batting_games
where season = 2026
select team, month(game_date), as_of(pa)
group by team, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_batting_games
where season = 2026
select team, pa, pa_percentile
order by pa_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.team_batting_games
select team, sum(pa), percentile(sum(pa))
group by team
order by sum(pa) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.team_batting_games
where season = 2026
select team, pa, standing(pa)
order by pa desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.team_batting_games
where season = 2026
select team, batters, pa, composite(batters, pa)
order by composite(batters, pa) desc
limit 10

ratio(…)

One column divided by another

from mlb.team_batting_games
select team, count(*), ratio(sum(pa), count(*))
group by team
order by ratio(sum(pa), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.team_batting_games
where season = 2026
select team, batters, pa, calc(standing(batters) - standing(pa))
order by calc(standing(batters) - standing(pa)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.team_batting_games
select team, pa, format(pa, > 0 -> "on the board", <= 0 -> "nothing yet")
order by pa desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_batting_games
where season = 2026
select team, pa, pa_percentile
pair pa with pa_percentile
order by pa desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_batting_games
where season = 2026
select team, batters, pa, ab, composite(batters, pa, ab) as Score
hint composite(batters, pa, ab) as "Batters + PA + AB"
order by composite(batters, pa, ab) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.team_defense_games Team defense games

One row per club per game: what its pitchers did and what its fielders did with what they were given.

from mlb.team_defense_games
select game_date, team, bf, k_pct, bb_pct, der, hits_saved
order by game_date desc
limit 200
One row is
one team's game (team-game)
Built from
one table, read straight
Reads
mlb_team_defense_games Baseball Savant, baseballr
Shows by default
game_date team bf k_pct bb_pct der hits_saved
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons games
Newest row
game_date

Before you trust the numbers

  • Regular season only. Rolled up from pitch-level Statcast, which begins in 2000.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW.
  • The club in the field is taken as the other club batting in that game, which is exact: every game has two.
  • Rates fold as summed numerators over summed denominators, so a month is weighted by batters faced rather than by number of games.
Dimensions 5
NameBound to
league always mlb
team the team column
player This dataset is one row per club per game — query mlb.pitchers for individual pitchers
position Positions belong to players, and this dataset has no players
season the season column
Columns 28
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The date the game counts for, which is not the calendar date of a suspension

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
Baseball Savant · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
Baseball Savant · baseballr
team completes team Team string
dimension

The club in the field.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
Baseball Savant · baseballr
bf BF integer
measure

Batters faced — the denominator a pitcher's rates divide by. MLB.com

Batters faced — the denominator every rate below divides by

What it takes
  • folds: sum(bf) avg(bf) min(bf) max(bf) count(bf) distinct(bf) only(bf) latest(bf) mean(bf) median(bf) mode(bf)
  • ranks: bf_percentile
  • accumulates: as_of(bf)
  • can be a benchmark
Baseball Savant · baseballr
pitches P integer
measure

Pitches this club threw. MLB.com

What it takes
  • folds: sum(pitches) avg(pitches) min(pitches) max(pitches) count(pitches) distinct(pitches) only(pitches) latest(pitches) mean(pitches) median(pitches) mode(pitches)
  • ranks: pitches_percentile
  • accumulates: as_of(pitches)
  • can be a benchmark
Baseball Savant · baseballr
k SO integer
measure

Strikeouts this club's pitching recorded. MLB.com

What it takes
  • folds: sum(k) avg(k) min(k) max(k) count(k) distinct(k) only(k) latest(k) mean(k) median(k) mode(k)
  • ranks: k_percentile
  • accumulates: as_of(k)
  • can be a benchmark
Baseball Savant · baseballr
bb lower is better BB integer
measure

Walks this club's pitching issued. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
Baseball Savant · baseballr
hr lower is better HR integer
measure

Home runs this club's pitching gave up. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
Baseball Savant · baseballr
hits lower is better H integer
measure

Hits this defense allowed. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
Baseball Savant · baseballr
k_pct K% number
measure

Share of the batters faced who struck out.

What it takes
  • folds: sum(k_pct) avg(k_pct) min(k_pct) max(k_pct) count(k_pct) distinct(k_pct) only(k_pct) latest(k_pct) mean(k_pct) median(k_pct) mode(k_pct)
  • ranks: k_pct_percentile
  • accumulates: as_of(k_pct)
  • can be a benchmark
Baseball Savant · baseballr
bb_pct lower is better BB% number
measure

Share of the batters faced who walked.

What it takes
  • folds: sum(bb_pct) avg(bb_pct) min(bb_pct) max(bb_pct) count(bb_pct) distinct(bb_pct) only(bb_pct) latest(bb_pct) mean(bb_pct) median(bb_pct) mode(bb_pct)
  • ranks: bb_pct_percentile
  • accumulates: as_of(bb_pct)
  • can be a benchmark
Baseball Savant · baseballr
k_bb_pct K-BB% number
measure

Strikeout rate less walk rate — the share of batters beaten without a ball in play. FanGraphs

Strikeouts less walks, over batters faced — the staff's own rate, with no ball in play and so no fielder in it

What it takes
  • folds: sum(k_bb_pct) avg(k_bb_pct) min(k_bb_pct) max(k_bb_pct) count(k_bb_pct) distinct(k_bb_pct) only(k_bb_pct) latest(k_bb_pct) mean(k_bb_pct) median(k_bb_pct) mode(k_bb_pct)
  • ranks: k_bb_pct_percentile
  • accumulates: as_of(k_bb_pct)
  • can be a benchmark
Baseball Savant · baseballr
csw_pct CSW% number
measure

Called strikes plus swinging strikes, over pitches — the one rate that counts both ways a pitch beats a hitter. FanGraphs

What it takes
  • folds: sum(csw_pct) avg(csw_pct) min(csw_pct) max(csw_pct) count(csw_pct) distinct(csw_pct) only(csw_pct) latest(csw_pct) mean(csw_pct) median(csw_pct) mode(csw_pct)
  • ranks: csw_pct_percentile
  • accumulates: as_of(csw_pct)
  • can be a benchmark
Baseball Savant · baseballr
avg_against lower is better AVG number
measure

What opposing hitters batted against this club. MLB.com

What it takes
  • folds: sum(avg_against) avg(avg_against) min(avg_against) max(avg_against) count(avg_against) distinct(avg_against) only(avg_against) latest(avg_against) mean(avg_against) median(avg_against) mode(avg_against)
  • ranks: avg_against_percentile
  • accumulates: as_of(avg_against)
  • can be a benchmark
Baseball Savant · baseballr
obp_against lower is better OBP number
measure

How often opposing hitters reached against this club. MLB.com

What it takes
  • folds: sum(obp_against) avg(obp_against) min(obp_against) max(obp_against) count(obp_against) distinct(obp_against) only(obp_against) latest(obp_against) mean(obp_against) median(obp_against) mode(obp_against)
  • ranks: obp_against_percentile
  • accumulates: as_of(obp_against)
  • can be a benchmark
Baseball Savant · baseballr
slg_against lower is better SLG number
measure

What opposing hitters slugged against this club. MLB.com

What it takes
  • folds: sum(slg_against) avg(slg_against) min(slg_against) max(slg_against) count(slg_against) distinct(slg_against) only(slg_against) latest(slg_against) mean(slg_against) median(slg_against) mode(slg_against)
  • ranks: slg_against_percentile
  • accumulates: as_of(slg_against)
  • can be a benchmark
Baseball Savant · baseballr
woba lower is better wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

Statcast era only — the wOBA weights come from the tracking feed

wOBA starts in 2015

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
Baseball Savant · baseballr
xwoba lower is better xwOBA number
measure

What the contact was worth as a wOBA, from exit velocity and launch angle alone — the fielders and the park taken out. MLB.com

What the contact allowed was worth on its own terms, before a fielder or a bounce touched it

Statcast era only — expected wOBA is fitted on tracked contact

xwOBA starts in 2015

What it takes
  • folds: sum(xwoba) avg(xwoba) min(xwoba) max(xwoba) count(xwoba) distinct(xwoba) only(xwoba) latest(xwoba) mean(xwoba) median(xwoba) mode(xwoba)
  • ranks: xwoba_percentile
  • accumulates: as_of(xwoba)
  • can be a benchmark
Baseball Savant · baseballr
bip BIP integer
measure

Fieldable batted balls — home runs are left out, since no defense converts those.

What it takes
  • folds: sum(bip) avg(bip) min(bip) max(bip) count(bip) distinct(bip) only(bip) latest(bip) mean(bip) median(bip) mode(bip)
  • ranks: bip_percentile
  • accumulates: as_of(bip)
  • can be a benchmark
Baseball Savant · baseballr
der DER number
measure

Defensive efficiency — the share of fieldable balls the defense turned into outs. MLB.com

Defensive efficiency: the share of fieldable batted balls turned into outs. A ball reached on is a ball not converted, so an error counts against it

What it takes
  • folds: sum(der) avg(der) min(der) max(der) count(der) distinct(der) only(der) latest(der) mean(der) median(der) mode(der)
  • ranks: der_percentile
  • accumulates: as_of(der)
  • can be a benchmark
Baseball Savant · baseballr
hits_saved Hits Saved number
measure

Hits an average defense would have allowed here, less the hits allowed.

Expected hits on the tracked balls in play, less the hits actually allowed on them — conversion measured against how hard the balls were

Compares clubs to each other, not to zero: expected BA is fitted with home runs in and this counts them out, so the thirty clubs of 2024 sum to +1,247 rather than 0. A percentile is unmoved by an offset every club shares.

Hits Saved starts in 2015

What it takes
  • folds: sum(hits_saved) avg(hits_saved) min(hits_saved) max(hits_saved) count(hits_saved) distinct(hits_saved) only(hits_saved) latest(hits_saved) mean(hits_saved) median(hits_saved) mode(hits_saved)
  • ranks: hits_saved_percentile
  • accumulates: as_of(hits_saved)
  • can be a benchmark
Baseball Savant · baseballr
roe lower is better ROE integer
measure

Batters who reached because a fielder missed. MLB.com

Not the same as errors: Statcast records how a plate appearance ended, so a throwing error on a runner is not here — 1,112 of these in 2024 against roughly 2,300 official errors

What it takes
  • folds: sum(roe) avg(roe) min(roe) max(roe) count(roe) distinct(roe) only(roe) latest(roe) mean(roe) median(roe) mode(roe)
  • ranks: roe_percentile
  • accumulates: as_of(roe)
  • can be a benchmark
Baseball Savant · baseballr
roe_rate lower is better ROE% number
measure

Share of batters faced who reached on an error.

What it takes
  • folds: sum(roe_rate) avg(roe_rate) min(roe_rate) max(roe_rate) count(roe_rate) distinct(roe_rate) only(roe_rate) latest(roe_rate) mean(roe_rate) median(roe_rate) mode(roe_rate)
  • ranks: roe_rate_percentile
  • accumulates: as_of(roe_rate)
  • can be a benchmark
Baseball Savant · baseballr
double_plays DP integer
measure

Double plays turned. MLB.com

Double plays turned — ground-ball and line-drive both

What it takes
  • folds: sum(double_plays) avg(double_plays) min(double_plays) max(double_plays) count(double_plays) distinct(double_plays) only(double_plays) latest(double_plays) mean(double_plays) median(double_plays) mode(double_plays)
  • ranks: double_plays_percentile
  • accumulates: as_of(double_plays)
  • can be a benchmark
Baseball Savant · baseballr
xba_on_bip lower is better xBA/BIP number
measure

What an average defense would have allowed on the same contact. MLB.com

xBA/BIP starts in 2015

What it takes
  • folds: sum(xba_on_bip) avg(xba_on_bip) min(xba_on_bip) max(xba_on_bip) count(xba_on_bip) distinct(xba_on_bip) only(xba_on_bip) latest(xba_on_bip) mean(xba_on_bip) median(xba_on_bip) mode(xba_on_bip)
  • ranks: xba_on_bip_percentile
  • accumulates: as_of(xba_on_bip)
  • can be a benchmark
Baseball Savant · baseballr
ba_on_bip lower is better BA/BIP number
measure

What hitters batted on the balls this defense actually had a play on.

BA/BIP starts in 2015

What it takes
  • folds: sum(ba_on_bip) avg(ba_on_bip) min(ba_on_bip) max(ba_on_bip) count(ba_on_bip) distinct(ba_on_bip) only(ba_on_bip) latest(ba_on_bip) mean(ba_on_bip) median(ba_on_bip) mode(ba_on_bip)
  • ranks: ba_on_bip_percentile
  • accumulates: as_of(ba_on_bip)
  • can be a benchmark
Baseball Savant · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

Baseball Savant · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

Baseball Savant · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.team_defense_games
select game_date, team, bf, k_pct, bb_pct, der, hits_saved
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.team_defense_games
select game_date, team, bf, k_pct, bb_pct, der, hits_saved
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.team_defense_games
select game_date, team, bf as BF
order by bf desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_defense_games
where season = $year
select game_date, team, bf
order by bf desc
limit 10

limit

How many rows come back

from mlb.team_defense_games
select game_date, team, bf, k_pct, bb_pct, der, hits_saved
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.team_defense_games
select game_date, team, bf
order by bf desc
limit 10

#

A comment, to the end of the line

# Team defense games — One row per club per game: what its pitchers did and what its fielders did with what they were given.
from mlb.team_defense_games
select game_date, team, bf, k_pct, bb_pct, der, hits_saved
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.team_defense_games
where season = 2026
select team, bf
order by bf desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_defense_games
where season = 2026 and bf > 0
select team, bf
order by bf desc
limit 10

having

Filters the groups a fold made

from mlb.team_defense_games
select team, sum(bf)
group by team
having sum(bf) > 0
order by sum(bf) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_defense_games
where season = 2026
select team, bf, bf_percentile
keep bf_percentile >= 90
order by bf_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_defense_games
select team, season, bf
highlight season = 2026
order by bf desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_defense_games
where bf >= max(bf) of season 2026
select team, bf
order by bf desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_defense_games
select team, count(*), sum(bf)
group by team
order by sum(bf) desc
limit 10

then

Folds the answer a second time

from mlb.team_defense_games
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 by

Reads the answer as a matrix

from mlb.team_defense_games
select team, season, sum(bf)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_defense_games
first 3 game_dates
select team, sum(bf)
group by team
order by sum(bf) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.team_defense_games
select team, sum(bf)
group by team
order by sum(bf) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.team_defense_games
select team, avg(bf)
group by team
order by avg(bf) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_defense_games
select team, min(bf)
group by team
order by min(bf) desc
limit 10

max(…)

The largest value in each group

from mlb.team_defense_games
select team, max(bf)
group by team
order by max(bf) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_defense_games
select team, count(bf)
group by team
order by count(bf) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_defense_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 mlb.team_defense_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 mlb.team_defense_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 mlb.team_defense_games
select team, mean(bf)
group by team
order by mean(bf) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.team_defense_games
select team, median(bf)
group by team
order by median(bf) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_defense_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 mlb.team_defense_games
select team, year(game_date), sum(bf)
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 mlb.team_defense_games
select team, quarter(game_date), sum(bf)
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 mlb.team_defense_games
select team, month(game_date), sum(bf)
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 mlb.team_defense_games
select team, week(game_date), sum(bf)
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 mlb.team_defense_games
where season = 2026
select team, month(game_date), as_of(bf)
group by team, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_defense_games
where season = 2026
select team, bf, bf_percentile
order by bf_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.team_defense_games
select team, sum(bf), percentile(sum(bf))
group by team
order by sum(bf) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.team_defense_games
where season = 2026
select team, bf, standing(bf)
order by bf desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.team_defense_games
where season = 2026
select team, bf, pitches, composite(bf, pitches)
order by composite(bf, pitches) desc
limit 10

ratio(…)

One column divided by another

from mlb.team_defense_games
select team, count(*), ratio(sum(bf), count(*))
group by team
order by ratio(sum(bf), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.team_defense_games
where season = 2026
select team, bf, pitches, calc(standing(bf) - standing(pitches))
order by calc(standing(bf) - standing(pitches)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.team_defense_games
select team, bf, format(bf, > 0 -> "on the board", <= 0 -> "nothing yet")
order by bf desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_defense_games
where season = 2026
select team, bf, bf_percentile
pair bf with bf_percentile
order by bf desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_defense_games
where season = 2026
select team, bf, pitches, k, composite(bf, pitches, k) as Score
hint composite(bf, pitches, k) as "BF + P + SO"
order by composite(bf, pitches, k) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.team_fielding_months Team fielding months

One row per club per calendar month: official errors, chances and fielding percentage — the scorer's record rather than the tracker's.

from mlb.team_fielding_months
select team, season, month, chances, errors, fielding_pct
order by month asc
limit 200
One row is
one team's month (team-month)
Built from
one table, read straight
Reads
mlb_team_fielding_months MLB Stats API, baseballr
Shows by default
team season month chances errors fielding_pct
Ordered by
month asc
Rows
200 by default, 5000 at most
Ranks within
season month
Careers counted in
seasons months

Before you trust the numbers

  • Regular season only. Loaded from 2015 onward — earlier seasons are answerable by the source but are not backfilled.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW.
  • A month's fielding percentage is rebuilt from its chances and errors, never averaged across months.
  • An error is a scorer's judgement, which is why it is here and not on mlb.team_defense_games — Statcast has no event for a play that should have been made.
Dimensions 6
NameBound to
league always mlb
team the team column
player This dataset is one row per club per month — query mlb.fielders for individual fielders
position The club's month is summed over every position — query mlb.fielders for a position's own line
season the season column
monththis sport only the month column
Columns 18
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
MLB Stats API · baseballr
month Month period
dimension

Calendar month the row covers, as YYYY-MM.

Calendar month as YYYY-MM, March through October

What it takes
  • folds: count(month) distinct(month) only(month) latest(month) mode(month)
MLB Stats API · baseballr
team completes team Team string
dimension

The club in the field.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
MLB Stats API · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
MLB Stats API · baseballr
innings Inn number
measure

Innings spent in the field. MLB.com

Defensive innings — the denominator range factor divides by

What it takes
  • folds: sum(innings) avg(innings) min(innings) max(innings) count(innings) distinct(innings) only(innings) latest(innings) mean(innings) median(innings) mode(innings)
  • ranks: innings_percentile
  • accumulates: as_of(innings)
  • can be a benchmark
MLB Stats API · baseballr
chances TC integer
measure

Total chances — putouts, assists and errors: every ball there was a play on. MLB.com

Total chances — putouts plus assists plus errors, and the denominator every rate below divides by

What it takes
  • folds: sum(chances) avg(chances) min(chances) max(chances) count(chances) distinct(chances) only(chances) latest(chances) mean(chances) median(chances) mode(chances)
  • ranks: chances_percentile
  • accumulates: as_of(chances)
  • can be a benchmark
MLB Stats API · baseballr
po PO integer
measure

Putouts — outs recorded without help. MLB.com

What it takes
  • folds: sum(po) avg(po) min(po) max(po) count(po) distinct(po) only(po) latest(po) mean(po) median(po) mode(po)
  • ranks: po_percentile
  • accumulates: as_of(po)
  • can be a benchmark
MLB Stats API · baseballr
assists A integer
measure

Assists — throws that got somebody else the out. MLB.com

What it takes
  • folds: sum(assists) avg(assists) min(assists) max(assists) count(assists) distinct(assists) only(assists) latest(assists) mean(assists) median(assists) mode(assists)
  • ranks: assists_percentile
  • accumulates: as_of(assists)
  • can be a benchmark
MLB Stats API · baseballr
errors lower is better E integer
measure

Errors, as the official scorer ruled them. MLB.com

Not the same as mlb.team_defense_games.roe, which counts plate appearances that ended on a misplay — a throwing error on a runner is here and not there

What it takes
  • folds: sum(errors) avg(errors) min(errors) max(errors) count(errors) distinct(errors) only(errors) latest(errors) mean(errors) median(errors) mode(errors)
  • ranks: errors_percentile
  • accumulates: as_of(errors)
  • can be a benchmark
MLB Stats API · baseballr
throwing_errors lower is better TE integer
measure

Errors on the throw.

Errors on the throw rather than on the catch

What it takes
  • folds: sum(throwing_errors) avg(throwing_errors) min(throwing_errors) max(throwing_errors) count(throwing_errors) distinct(throwing_errors) only(throwing_errors) latest(throwing_errors) mean(throwing_errors) median(throwing_errors) mode(throwing_errors)
  • ranks: throwing_errors_percentile
  • accumulates: as_of(throwing_errors)
  • can be a benchmark
MLB Stats API · baseballr
fielding_errors lower is better FE integer
measure

Errors on the catch or the pick rather than on the throw.

Errors that were not throws — the remainder, which is hands rather than decision

Null for a month where the split served no throwing-error count

What it takes
  • folds: sum(fielding_errors) avg(fielding_errors) min(fielding_errors) max(fielding_errors) count(fielding_errors) distinct(fielding_errors) only(fielding_errors) latest(fielding_errors) mean(fielding_errors) median(fielding_errors) mode(fielding_errors)
  • ranks: fielding_errors_percentile
  • accumulates: as_of(fielding_errors)
  • can be a benchmark
MLB Stats API · baseballr
fielding_pct FPCT number
measure

Share of chances handled cleanly. MLB.com

Share of chances handled cleanly — the scorer's record of what was made

What it takes
  • folds: sum(fielding_pct) avg(fielding_pct) min(fielding_pct) max(fielding_pct) count(fielding_pct) distinct(fielding_pct) only(fielding_pct) latest(fielding_pct) mean(fielding_pct) median(fielding_pct) mode(fielding_pct)
  • ranks: fielding_pct_percentile
  • accumulates: as_of(fielding_pct)
  • can be a benchmark
MLB Stats API · baseballr
error_rate lower is better E% number
measure

Share of chances that became errors.

Share of chances that became errors — fielding percentage read the other way

What it takes
  • folds: sum(error_rate) avg(error_rate) min(error_rate) max(error_rate) count(error_rate) distinct(error_rate) only(error_rate) latest(error_rate) mean(error_rate) median(error_rate) mode(error_rate)
  • ranks: error_rate_percentile
  • accumulates: as_of(error_rate)
  • can be a benchmark
MLB Stats API · baseballr
range_factor RF/9 number
measure

Chances per nine innings — how much ground the defense was asked to cover. MLB.com

What it takes
  • folds: sum(range_factor) avg(range_factor) min(range_factor) max(range_factor) count(range_factor) distinct(range_factor) only(range_factor) latest(range_factor) mean(range_factor) median(range_factor) mode(range_factor)
  • ranks: range_factor_percentile
  • accumulates: as_of(range_factor)
  • can be a benchmark
MLB Stats API · baseballr
double_plays DP integer
measure

Double plays turned. MLB.com

What it takes
  • folds: sum(double_plays) avg(double_plays) min(double_plays) max(double_plays) count(double_plays) distinct(double_plays) only(double_plays) latest(double_plays) mean(double_plays) median(double_plays) mode(double_plays)
  • ranks: double_plays_percentile
  • accumulates: as_of(double_plays)
  • can be a benchmark
MLB Stats API · baseballr
triple_plays TP integer
measure

Triple plays turned. MLB.com

What it takes
  • folds: sum(triple_plays) avg(triple_plays) min(triple_plays) max(triple_plays) count(triple_plays) distinct(triple_plays) only(triple_plays) latest(triple_plays) mean(triple_plays) median(triple_plays) mode(triple_plays)
  • ranks: triple_plays_percentile
  • accumulates: as_of(triple_plays)
  • can be a benchmark
MLB Stats API · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

MLB Stats API · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

MLB Stats API · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.team_fielding_months
select team, season, month, chances, errors, fielding_pct
order by month asc
limit 200

select

The columns the answer carries

from mlb.team_fielding_months
select team, season, month, chances, errors, fielding_pct
order by month asc
limit 200

as

Renames a column's heading and nothing else

from mlb.team_fielding_months
select team, season, chances as TC
order by chances desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_fielding_months
where season = $year
select team, season, month
order by chances desc
limit 10

limit

How many rows come back

from mlb.team_fielding_months
select team, season, month, chances, errors, fielding_pct
order by month asc
limit 200

order by

Which end of the answer comes first

from mlb.team_fielding_months
select team, season, month, chances
order by chances desc
limit 10

#

A comment, to the end of the line

# Team fielding months — One row per club per calendar month: official errors, chances and fielding percentage — the scorer's record rather than the tracker's.
from mlb.team_fielding_months
select team, season, month, chances, errors, fielding_pct
order by month asc
limit 200

where

Chooses the rows the question is about

from mlb.team_fielding_months
where season = 2026
select team, chances
order by chances desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_fielding_months
where season = 2026 and chances > 0
select team, chances
order by chances desc
limit 10

having

Filters the groups a fold made

from mlb.team_fielding_months
select team, sum(chances)
group by team
having sum(chances) > 0
order by sum(chances) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, chances, chances_percentile
keep chances_percentile >= 90
order by chances_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_fielding_months
select team, season, chances
highlight season = 2026
order by chances desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_fielding_months
where chances >= max(chances) of season 2026
select team, chances
order by chances desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_fielding_months
select team, count(*), sum(chances)
group by team
order by sum(chances) desc
limit 10

then

Folds the answer a second time

from mlb.team_fielding_months
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 by

Reads the answer as a matrix

from mlb.team_fielding_months
select team, season, sum(chances)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_fielding_months
first 3 seasons
select team, sum(chances)
group by team
order by sum(chances) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.team_fielding_months
select team, sum(chances)
group by team
order by sum(chances) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.team_fielding_months
select team, avg(chances)
group by team
order by avg(chances) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_fielding_months
select team, min(chances)
group by team
order by min(chances) desc
limit 10

max(…)

The largest value in each group

from mlb.team_fielding_months
select team, max(chances)
group by team
order by max(chances) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_fielding_months
select team, count(chances)
group by team
order by count(chances) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_fielding_months
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 mlb.team_fielding_months
where season = 2026 and month = 2026-06
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 mlb.team_fielding_months
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 mlb.team_fielding_months
select team, mean(chances)
group by team
order by mean(chances) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.team_fielding_months
select team, median(chances)
group by team
order by median(chances) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_fielding_months
select team, mode(team)
group by team
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, chances, chances_percentile
order by chances_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.team_fielding_months
select team, sum(chances), percentile(sum(chances))
group by team
order by sum(chances) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, chances, standing(chances)
order by chances desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, games, innings, composite(games, innings)
order by composite(games, innings) desc
limit 10

ratio(…)

One column divided by another

from mlb.team_fielding_months
select team, count(*), ratio(sum(chances), count(*))
group by team
order by ratio(sum(chances), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, games, innings, calc(standing(games) - standing(innings))
order by calc(standing(games) - standing(innings)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.team_fielding_months
select team, chances, format(chances, > 0 -> "on the board", <= 0 -> "nothing yet")
order by chances desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, chances, chances_percentile
pair chances with chances_percentile
order by chances desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_fielding_months
where season = 2026 and month = 2026-06
select team, games, innings, chances, composite(games, innings, chances) as Score
hint composite(games, innings, chances) as "G + Inn + TC"
order by composite(games, innings, chances) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.team_batting_days Team batting days

One row per club per date, with the wRC+ only FanGraphs can compute — fold it for any window.

from mlb.team_batting_days
select game_date, team, pa, hr, woba, wrc_plus
order by game_date desc
limit 200
One row is
one team's date (team-date)
Built from
one table, read straight
Reads
mlb_team_batting_days FanGraphs, baseballr
Shows by default
game_date team pa hr woba wrc_plus
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons dates
Newest row
game_date

Before you trust the numbers

  • A single date is a handful of plate appearances — a one-day wRC+ of 250 is noise, not a hot streak. Fold a window: where game_date <= 2024-05-15 with group by team.
  • wRC+ and wOBA fold by plate appearances, which is exact within a season (measured worst case 0.08 wRC+ points) because their adjustments are fixed for the year. Across seasons the constants move and the fold is an approximation.
  • Regular season only, 2015 on — FanGraphs serves date ranges back to 1974. mlb.team_batting_months carries the club's line back to 2000 at month grain.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — because the loader resolves FanGraphs' spelling to a club and the view prints dim_team's.
Dimensions 5
NameBound to
league always mlb
team the team column
player This dataset is one row per club per date — query mlb.player_batting_days for hitters
position Positions belong to players, and this dataset has no players
season the season column
Columns 56
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The calendar date played. One row per date, standing alone rather than cumulative

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
FanGraphs · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
circuit AL/NL string
dimension

American or National League.

American or National League — league is taken by the sport itself

What it takes
  • folds: count(circuit) distinct(circuit) only(circuit) latest(circuit) mode(circuit)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
pa PA integer
measure

Plate appearances — every trip to the plate, walks and sacrifices included. MLB.com

What it takes
  • folds: sum(pa) avg(pa) min(pa) max(pa) count(pa) distinct(pa) only(pa) latest(pa) mean(pa) median(pa) mode(pa)
  • ranks: pa_percentile
  • accumulates: as_of(pa)
  • can be a benchmark
FanGraphs · baseballr
ab AB integer
measure

At-bats — plate appearances less walks, hit-by-pitches and sacrifices. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
FanGraphs · baseballr
hits H integer
measure

Hits. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
FanGraphs · baseballr
singles 1B integer
measure

Singles. MLB.com

What it takes
  • folds: sum(singles) avg(singles) min(singles) max(singles) count(singles) distinct(singles) only(singles) latest(singles) mean(singles) median(singles) mode(singles)
  • ranks: singles_percentile
  • accumulates: as_of(singles)
  • can be a benchmark
FanGraphs · baseballr
doubles 2B integer
measure

Doubles. MLB.com

What it takes
  • folds: sum(doubles) avg(doubles) min(doubles) max(doubles) count(doubles) distinct(doubles) only(doubles) latest(doubles) mean(doubles) median(doubles) mode(doubles)
  • ranks: doubles_percentile
  • accumulates: as_of(doubles)
  • can be a benchmark
FanGraphs · baseballr
triples 3B integer
measure

Triples. MLB.com

What it takes
  • folds: sum(triples) avg(triples) min(triples) max(triples) count(triples) distinct(triples) only(triples) latest(triples) mean(triples) median(triples) mode(triples)
  • ranks: triples_percentile
  • accumulates: as_of(triples)
  • can be a benchmark
FanGraphs · baseballr
hr HR integer
measure

Home runs hit. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · baseballr
runs R integer
measure

Runs scored. MLB.com

What it takes
  • folds: sum(runs) avg(runs) min(runs) max(runs) count(runs) distinct(runs) only(runs) latest(runs) mean(runs) median(runs) mode(runs)
  • ranks: runs_percentile
  • accumulates: as_of(runs)
  • can be a benchmark
FanGraphs · baseballr
rbi RBI integer
measure

Runs batted in. MLB.com

What it takes
  • folds: sum(rbi) avg(rbi) min(rbi) max(rbi) count(rbi) distinct(rbi) only(rbi) latest(rbi) mean(rbi) median(rbi) mode(rbi)
  • ranks: rbi_percentile
  • accumulates: as_of(rbi)
  • can be a benchmark
FanGraphs · baseballr
bb BB integer
measure

Walks drawn. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · baseballr
ibb IBB integer
measure

Walks issued deliberately. MLB.com

What it takes
  • folds: sum(ibb) avg(ibb) min(ibb) max(ibb) count(ibb) distinct(ibb) only(ibb) latest(ibb) mean(ibb) median(ibb) mode(ibb)
  • ranks: ibb_percentile
  • accumulates: as_of(ibb)
  • can be a benchmark
FanGraphs · baseballr
so lower is better SO integer
measure

Times struck out at the plate. MLB.com

What it takes
  • folds: sum(so) avg(so) min(so) max(so) count(so) distinct(so) only(so) latest(so) mean(so) median(so) mode(so)
  • ranks: so_percentile
  • accumulates: as_of(so)
  • can be a benchmark
FanGraphs · baseballr
hbp HBP integer
measure

Times hit by a pitch. MLB.com

What it takes
  • folds: sum(hbp) avg(hbp) min(hbp) max(hbp) count(hbp) distinct(hbp) only(hbp) latest(hbp) mean(hbp) median(hbp) mode(hbp)
  • ranks: hbp_percentile
  • accumulates: as_of(hbp)
  • can be a benchmark
FanGraphs · baseballr
sf SF integer
measure

Sacrifice flies. MLB.com

What it takes
  • folds: sum(sf) avg(sf) min(sf) max(sf) count(sf) distinct(sf) only(sf) latest(sf) mean(sf) median(sf) mode(sf)
  • ranks: sf_percentile
  • accumulates: as_of(sf)
  • can be a benchmark
FanGraphs · baseballr
sh SH integer
measure

Sacrifice bunts. MLB.com

What it takes
  • folds: sum(sh) avg(sh) min(sh) max(sh) count(sh) distinct(sh) only(sh) latest(sh) mean(sh) median(sh) mode(sh)
  • ranks: sh_percentile
  • accumulates: as_of(sh)
  • can be a benchmark
FanGraphs · baseballr
gidp lower is better GIDP integer
measure

Times grounded into a double play. MLB.com

What it takes
  • folds: sum(gidp) avg(gidp) min(gidp) max(gidp) count(gidp) distinct(gidp) only(gidp) latest(gidp) mean(gidp) median(gidp) mode(gidp)
  • ranks: gidp_percentile
  • accumulates: as_of(gidp)
  • can be a benchmark
FanGraphs · baseballr
sb SB integer
measure

Bases stolen. MLB.com

What it takes
  • folds: sum(sb) avg(sb) min(sb) max(sb) count(sb) distinct(sb) only(sb) latest(sb) mean(sb) median(sb) mode(sb)
  • ranks: sb_percentile
  • accumulates: as_of(sb)
  • can be a benchmark
FanGraphs · baseballr
cs lower is better CS integer
measure

Times thrown out stealing. MLB.com

What it takes
  • folds: sum(cs) avg(cs) min(cs) max(cs) count(cs) distinct(cs) only(cs) latest(cs) mean(cs) median(cs) mode(cs)
  • ranks: cs_percentile
  • accumulates: as_of(cs)
  • can be a benchmark
FanGraphs · baseballr
pitches Pitches integer
measure

Pitches seen at the plate. MLB.com

Pitches seen — the denominator every plate-discipline rate here divides by

What it takes
  • folds: sum(pitches) avg(pitches) min(pitches) max(pitches) count(pitches) distinct(pitches) only(pitches) latest(pitches) mean(pitches) median(pitches) mode(pitches)
  • ranks: pitches_percentile
  • accumulates: as_of(pitches)
  • can be a benchmark
FanGraphs · baseballr
bip BIP integer
measure

Batted balls put in play.

Batted-ball events, which the tracking averages are measured over

What it takes
  • folds: sum(bip) avg(bip) min(bip) max(bip) count(bip) distinct(bip) only(bip) latest(bip) mean(bip) median(bip) mode(bip)
  • ranks: bip_percentile
  • accumulates: as_of(bip)
  • can be a benchmark
FanGraphs · baseballr
avg AVG number
measure

Batting average — hits per at-bat. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
FanGraphs · baseballr
obp OBP number
measure

On-base percentage — how often a plate appearance ended with a runner on. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
FanGraphs · baseballr
slg SLG number
measure

Slugging percentage — total bases per at-bat, so it weighs extra-base hits. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
FanGraphs · baseballr
ops OPS number
measure

On-base plus slugging: the two rates added, the quickest one-number read on a hitter. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
FanGraphs · baseballr
iso ISO number
measure

Isolated power — slugging less batting average, so it counts only the extra bases. MLB.com

What it takes
  • folds: sum(iso) avg(iso) min(iso) max(iso) count(iso) distinct(iso) only(iso) latest(iso) mean(iso) median(iso) mode(iso)
  • ranks: iso_percentile
  • accumulates: as_of(iso)
  • can be a benchmark
FanGraphs · baseballr
babip BABIP number
measure

Batting average on balls in play, which strips out strikeouts and home runs. Swings a lot on luck. MLB.com

What it takes
  • folds: sum(babip) avg(babip) min(babip) max(babip) count(babip) distinct(babip) only(babip) latest(babip) mean(babip) median(babip) mode(babip)
  • ranks: babip_percentile
  • accumulates: as_of(babip)
  • can be a benchmark
FanGraphs · baseballr
bb_pct BB% number
measure

Share of plate appearances that ended in a walk. FanGraphs

Walks per plate appearance, as a whole percent (8.5 = 8.5%)

What it takes
  • folds: sum(bb_pct) avg(bb_pct) min(bb_pct) max(bb_pct) count(bb_pct) distinct(bb_pct) only(bb_pct) latest(bb_pct) mean(bb_pct) median(bb_pct) mode(bb_pct)
  • ranks: bb_pct_percentile
  • accumulates: as_of(bb_pct)
  • can be a benchmark
FanGraphs · baseballr
k_pct lower is better K% number
measure

Share of plate appearances that ended in a strikeout. FanGraphs

Strikeouts per plate appearance, as a whole percent

What it takes
  • folds: sum(k_pct) avg(k_pct) min(k_pct) max(k_pct) count(k_pct) distinct(k_pct) only(k_pct) latest(k_pct) mean(k_pct) median(k_pct) mode(k_pct)
  • ranks: k_pct_percentile
  • accumulates: as_of(k_pct)
  • can be a benchmark
FanGraphs · baseballr
gb_pct GB% number
measure

Share of batted balls hit on the ground. MLB.com

What it takes
  • folds: sum(gb_pct) avg(gb_pct) min(gb_pct) max(gb_pct) count(gb_pct) distinct(gb_pct) only(gb_pct) latest(gb_pct) mean(gb_pct) median(gb_pct) mode(gb_pct)
  • ranks: gb_pct_percentile
  • accumulates: as_of(gb_pct)
  • can be a benchmark
FanGraphs · baseballr
fb_pct FB% number
measure

Share of batted balls hit in the air. MLB.com

What it takes
  • folds: sum(fb_pct) avg(fb_pct) min(fb_pct) max(fb_pct) count(fb_pct) distinct(fb_pct) only(fb_pct) latest(fb_pct) mean(fb_pct) median(fb_pct) mode(fb_pct)
  • ranks: fb_pct_percentile
  • accumulates: as_of(fb_pct)
  • can be a benchmark
FanGraphs · baseballr
ld_pct LD% number
measure

Share of batted balls hit on a line. MLB.com

What it takes
  • folds: sum(ld_pct) avg(ld_pct) min(ld_pct) max(ld_pct) count(ld_pct) distinct(ld_pct) only(ld_pct) latest(ld_pct) mean(ld_pct) median(ld_pct) mode(ld_pct)
  • ranks: ld_pct_percentile
  • accumulates: as_of(ld_pct)
  • can be a benchmark
FanGraphs · baseballr
iffb_pct IFFB% number
measure

Share of fly balls that stayed in the infield — an automatic out, and the worst contact there is. MLB.com

What it takes
  • folds: sum(iffb_pct) avg(iffb_pct) min(iffb_pct) max(iffb_pct) count(iffb_pct) distinct(iffb_pct) only(iffb_pct) latest(iffb_pct) mean(iffb_pct) median(iffb_pct) mode(iffb_pct)
  • ranks: iffb_pct_percentile
  • accumulates: as_of(iffb_pct)
  • can be a benchmark
FanGraphs · baseballr
hr_fb HR/FB number
measure

Share of fly balls that left the yard. MLB.com

What it takes
  • folds: sum(hr_fb) avg(hr_fb) min(hr_fb) max(hr_fb) count(hr_fb) distinct(hr_fb) only(hr_fb) latest(hr_fb) mean(hr_fb) median(hr_fb) mode(hr_fb)
  • ranks: hr_fb_percentile
  • accumulates: as_of(hr_fb)
  • can be a benchmark
FanGraphs · baseballr
woba wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
FanGraphs · baseballr
wrc_plus wRC+ integer
measure

Runs created, adjusted for park and league and set on a scale where 100 is average and 150 is half again better. MLB.com

What it takes
  • folds: sum(wrc_plus) avg(wrc_plus) min(wrc_plus) max(wrc_plus) count(wrc_plus) distinct(wrc_plus) only(wrc_plus) latest(wrc_plus) mean(wrc_plus) median(wrc_plus) mode(wrc_plus)
  • ranks: wrc_plus_percentile
  • accumulates: as_of(wrc_plus)
  • can be a benchmark
FanGraphs · baseballr
wrc wRC number
measure

Weighted runs created — a batting line expressed as runs. FanGraphs

Runs created — a counting stat, so it sums across dates

What it takes
  • folds: sum(wrc) avg(wrc) min(wrc) max(wrc) count(wrc) distinct(wrc) only(wrc) latest(wrc) mean(wrc) median(wrc) mode(wrc)
  • ranks: wrc_percentile
  • accumulates: as_of(wrc)
  • can be a benchmark
FanGraphs · baseballr
wraa wRAA number
measure

Weighted runs above average — runs the batting was worth against a league-average hitter. MLB.com

Runs above average, which sums across dates

What it takes
  • folds: sum(wraa) avg(wraa) min(wraa) max(wraa) count(wraa) distinct(wraa) only(wraa) latest(wraa) mean(wraa) median(wraa) mode(wraa)
  • ranks: wraa_percentile
  • accumulates: as_of(wraa)
  • can be a benchmark
FanGraphs · baseballr
war WAR number
measure

Wins above replacement — batting, running and fielding together, as wins over a freely available player. FanGraphs

What it takes
  • folds: sum(war) avg(war) min(war) max(war) count(war) distinct(war) only(war) latest(war) mean(war) median(war) mode(war)
  • ranks: war_percentile
  • accumulates: as_of(war)
  • can be a benchmark
FanGraphs · baseballr
exit_velocity EV number
measure

How hard the ball was hit, in miles per hour, averaged over batted balls. MLB.com

What it takes
  • folds: sum(exit_velocity) avg(exit_velocity) min(exit_velocity) max(exit_velocity) count(exit_velocity) distinct(exit_velocity) only(exit_velocity) latest(exit_velocity) mean(exit_velocity) median(exit_velocity) mode(exit_velocity)
  • ranks: exit_velocity_percentile
  • accumulates: as_of(exit_velocity)
  • can be a benchmark
FanGraphs · baseballr
launch_angle LA number
measure

The vertical angle the ball left the bat at, in degrees. Around 10 to 30 is where hits live. MLB.com

What it takes
  • folds: sum(launch_angle) avg(launch_angle) min(launch_angle) max(launch_angle) count(launch_angle) distinct(launch_angle) only(launch_angle) latest(launch_angle) mean(launch_angle) median(launch_angle) mode(launch_angle)
  • ranks: launch_angle_percentile
  • accumulates: as_of(launch_angle)
  • can be a benchmark
FanGraphs · baseballr
max_exit_velocity maxEV number
measure

The hardest ball hit — the ceiling rather than the habit. MLB.com

Hardest ball hit that date. Fold it with max(max_exit_velocity) — averaging daily maxima understates it

What it takes
  • folds: sum(max_exit_velocity) avg(max_exit_velocity) min(max_exit_velocity) max(max_exit_velocity) count(max_exit_velocity) distinct(max_exit_velocity) only(max_exit_velocity) latest(max_exit_velocity) mean(max_exit_velocity) median(max_exit_velocity) mode(max_exit_velocity)
  • ranks: max_exit_velocity_percentile
  • accumulates: as_of(max_exit_velocity)
  • can be a benchmark
FanGraphs · baseballr
barrel_pct Barrel% number
measure

Share of batted balls hit at the exit velocity and launch angle that have historically produced a .500 average — the best contact there is. MLB.com

Share of batted balls barrelled, as a whole percent (12.17 = 12.17%)

What it takes
  • folds: sum(barrel_pct) avg(barrel_pct) min(barrel_pct) max(barrel_pct) count(barrel_pct) distinct(barrel_pct) only(barrel_pct) latest(barrel_pct) mean(barrel_pct) median(barrel_pct) mode(barrel_pct)
  • ranks: barrel_pct_percentile
  • accumulates: as_of(barrel_pct)
  • can be a benchmark
FanGraphs · baseballr
hard_hit_pct HardHit% number
measure

Share of batted balls hit at 95 mph or more. MLB.com

What it takes
  • folds: sum(hard_hit_pct) avg(hard_hit_pct) min(hard_hit_pct) max(hard_hit_pct) count(hard_hit_pct) distinct(hard_hit_pct) only(hard_hit_pct) latest(hard_hit_pct) mean(hard_hit_pct) median(hard_hit_pct) mode(hard_hit_pct)
  • ranks: hard_hit_pct_percentile
  • accumulates: as_of(hard_hit_pct)
  • can be a benchmark
FanGraphs · baseballr
xwoba xwOBA number
measure

What the contact was worth as a wOBA, from exit velocity and launch angle alone — the fielders and the park taken out. MLB.com

What it takes
  • folds: sum(xwoba) avg(xwoba) min(xwoba) max(xwoba) count(xwoba) distinct(xwoba) only(xwoba) latest(xwoba) mean(xwoba) median(xwoba) mode(xwoba)
  • ranks: xwoba_percentile
  • accumulates: as_of(xwoba)
  • can be a benchmark
FanGraphs · baseballr
xslg xSLG number
measure

What the contact was worth as a slugging percentage, before anyone fielded it. MLB.com

What it takes
  • folds: sum(xslg) avg(xslg) min(xslg) max(xslg) count(xslg) distinct(xslg) only(xslg) latest(xslg) mean(xslg) median(xslg) mode(xslg)
  • ranks: xslg_percentile
  • accumulates: as_of(xslg)
  • can be a benchmark
FanGraphs · baseballr
swing_pct Swing% number
measure

Share of pitches swung at. FanGraphs

What it takes
  • folds: sum(swing_pct) avg(swing_pct) min(swing_pct) max(swing_pct) count(swing_pct) distinct(swing_pct) only(swing_pct) latest(swing_pct) mean(swing_pct) median(swing_pct) mode(swing_pct)
  • ranks: swing_pct_percentile
  • accumulates: as_of(swing_pct)
  • can be a benchmark
FanGraphs · baseballr
zone_pct Zone% number
measure

Share of the pitches seen that were in the strike zone. FanGraphs

What it takes
  • folds: sum(zone_pct) avg(zone_pct) min(zone_pct) max(zone_pct) count(zone_pct) distinct(zone_pct) only(zone_pct) latest(zone_pct) mean(zone_pct) median(zone_pct) mode(zone_pct)
  • ranks: zone_pct_percentile
  • accumulates: as_of(zone_pct)
  • can be a benchmark
FanGraphs · baseballr
swstr_pct SwStr% number
measure

Share of pitches swung at and missed, over all pitches seen. FanGraphs

What it takes
  • folds: sum(swstr_pct) avg(swstr_pct) min(swstr_pct) max(swstr_pct) count(swstr_pct) distinct(swstr_pct) only(swstr_pct) latest(swstr_pct) mean(swstr_pct) median(swstr_pct) mode(swstr_pct)
  • ranks: swstr_pct_percentile
  • accumulates: as_of(swstr_pct)
  • can be a benchmark
FanGraphs · baseballr
cstr_pct CStr% number
measure

Share of pitches taken for a called strike. FanGraphs

What it takes
  • folds: sum(cstr_pct) avg(cstr_pct) min(cstr_pct) max(cstr_pct) count(cstr_pct) distinct(cstr_pct) only(cstr_pct) latest(cstr_pct) mean(cstr_pct) median(cstr_pct) mode(cstr_pct)
  • ranks: cstr_pct_percentile
  • accumulates: as_of(cstr_pct)
  • can be a benchmark
FanGraphs · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.team_batting_days
select game_date, team, pa, hr, woba, wrc_plus
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.team_batting_days
select game_date, team, pa, hr, woba, wrc_plus
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.team_batting_days
select game_date, team, pa as PA
order by pa desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_batting_days
where season = $year
select game_date, team, pa
order by pa desc
limit 10

limit

How many rows come back

from mlb.team_batting_days
select game_date, team, pa, hr, woba, wrc_plus
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.team_batting_days
select game_date, team, pa
order by pa desc
limit 10

#

A comment, to the end of the line

# Team batting days — One row per club per date, with the wRC+ only FanGraphs can compute — fold it for any window.
from mlb.team_batting_days
select game_date, team, pa, hr, woba, wrc_plus
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.team_batting_days
where season = 2026
select team, pa
order by pa desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_batting_days
where season = 2026 and pa > 0
select team, pa
order by pa desc
limit 10

having

Filters the groups a fold made

from mlb.team_batting_days
select team, sum(pa)
group by team
having sum(pa) > 0
order by sum(pa) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_batting_days
where season = 2026
select team, pa, pa_percentile
keep pa_percentile >= 90
order by pa_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_batting_days
select team, season, pa
highlight season = 2026
order by pa desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_batting_days
where pa >= max(pa) of season 2026
select team, pa
order by pa desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_batting_days
select team, count(*), sum(pa)
group by team
order by sum(pa) desc
limit 10

then

Folds the answer a second time

from mlb.team_batting_days
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 by

Reads the answer as a matrix

from mlb.team_batting_days
select team, season, sum(pa)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_batting_days
first 3 game_dates
select team, sum(pa)
group by team
order by sum(pa) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.team_batting_days
select team, sum(pa)
group by team
order by sum(pa) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.team_batting_days
select team, avg(pa)
group by team
order by avg(pa) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_batting_days
select team, min(pa)
group by team
order by min(pa) desc
limit 10

max(…)

The largest value in each group

from mlb.team_batting_days
select team, max(pa)
group by team
order by max(pa) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_batting_days
select team, count(pa)
group by team
order by count(pa) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_batting_days
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 mlb.team_batting_days
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 mlb.team_batting_days
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 mlb.team_batting_days
select team, mean(pa)
group by team
order by mean(pa) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.team_batting_days
select team, median(pa)
group by team
order by median(pa) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_batting_days
select team, mode(team)
group by team
order by count(*) desc
limit 10

year(…)

Reads a date as the year it falls in

from mlb.team_batting_days
select team, year(game_date), sum(pa)
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 mlb.team_batting_days
select team, quarter(game_date), sum(pa)
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 mlb.team_batting_days
select team, month(game_date), sum(pa)
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 mlb.team_batting_days
select team, week(game_date), sum(pa)
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 mlb.team_batting_days
where season = 2026
select team, month(game_date), as_of(pa)
group by team, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_batting_days
where season = 2026
select team, pa, pa_percentile
order by pa_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.team_batting_days
select team, sum(pa), percentile(sum(pa))
group by team
order by sum(pa) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.team_batting_days
where season = 2026
select team, pa, standing(pa)
order by pa desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.team_batting_days
where season = 2026
select team, games, pa, composite(games, pa)
order by composite(games, pa) desc
limit 10

ratio(…)

One column divided by another

from mlb.team_batting_days
select team, count(*), ratio(sum(pa), count(*))
group by team
order by ratio(sum(pa), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.team_batting_days
where season = 2026
select team, games, pa, calc(standing(games) - standing(pa))
order by calc(standing(games) - standing(pa)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.team_batting_days
select team, pa, format(pa, > 0 -> "on the board", <= 0 -> "nothing yet")
order by pa desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_batting_days
where season = 2026
select team, pa, pa_percentile
pair pa with pa_percentile
order by pa desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_batting_days
where season = 2026
select team, games, pa, ab, composite(games, pa, ab) as Score
hint composite(games, pa, ab) as "G + PA + AB"
order by composite(games, pa, ab) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.team_batting_months Team batting months

One row per club per calendar month, 2000 on — the wRC+ only FanGraphs can compute, at the grain its whole history can be asked at.

from mlb.team_batting_months
select team, season, month, pa, hr, ops, wrc_plus
order by month desc
limit 200
One row is
one team's month (team-month)
Built from
one table, read straight
Reads
mlb_team_batting_months FanGraphs, baseballr
Shows by default
team season month pa hr ops wrc_plus
Ordered by
month desc
Rows
200 by default, 5000 at most
Ranks within
season month
Careers counted in
seasons months

Before you trust the numbers

  • One row per club per calendar month, 2000 on. For a window that is not a whole month, query mlb.team_batting_days — finer, but seeded from 2015.
  • wRC+ and wOBA fold by plate appearances, which is exact within a season (measured worst case 0.08 wRC+ points) because their adjustments are fixed for the year. Across seasons the constants move and the fold is an approximation.
  • Tracking columns — exit velocity, xwOBA, the plate-discipline rates — are null before 2015: the board serves them from there.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — because the loader resolves FanGraphs' spelling to a club and the view prints dim_team's.
  • month is a YYYY-MM period, the same shape month(game_date) produces on mlb.team_defense_games — so a monthly wRC+ and a monthly DER are read along one axis.
Dimensions 6
NameBound to
league always mlb
team the team column
player This dataset is one row per club per month — query mlb.player_batting_days for hitters
position Positions belong to players, and this dataset has no players
season the season column
monththis sport only the month column
Columns 56
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
month Month period
dimension

Calendar month the row covers, as YYYY-MM.

Calendar month as YYYY-MM, March through October

What it takes
  • folds: count(month) distinct(month) only(month) latest(month) mode(month)
FanGraphs · baseballr
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
circuit AL/NL string
dimension

American or National League.

American or National League — league is taken by the sport itself

What it takes
  • folds: count(circuit) distinct(circuit) only(circuit) latest(circuit) mode(circuit)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
pa PA integer
measure

Plate appearances — every trip to the plate, walks and sacrifices included. MLB.com

What it takes
  • folds: sum(pa) avg(pa) min(pa) max(pa) count(pa) distinct(pa) only(pa) latest(pa) mean(pa) median(pa) mode(pa)
  • ranks: pa_percentile
  • accumulates: as_of(pa)
  • can be a benchmark
FanGraphs · baseballr
ab AB integer
measure

At-bats — plate appearances less walks, hit-by-pitches and sacrifices. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
FanGraphs · baseballr
hits H integer
measure

Hits. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
FanGraphs · baseballr
singles 1B integer
measure

Singles. MLB.com

What it takes
  • folds: sum(singles) avg(singles) min(singles) max(singles) count(singles) distinct(singles) only(singles) latest(singles) mean(singles) median(singles) mode(singles)
  • ranks: singles_percentile
  • accumulates: as_of(singles)
  • can be a benchmark
FanGraphs · baseballr
doubles 2B integer
measure

Doubles. MLB.com

What it takes
  • folds: sum(doubles) avg(doubles) min(doubles) max(doubles) count(doubles) distinct(doubles) only(doubles) latest(doubles) mean(doubles) median(doubles) mode(doubles)
  • ranks: doubles_percentile
  • accumulates: as_of(doubles)
  • can be a benchmark
FanGraphs · baseballr
triples 3B integer
measure

Triples. MLB.com

What it takes
  • folds: sum(triples) avg(triples) min(triples) max(triples) count(triples) distinct(triples) only(triples) latest(triples) mean(triples) median(triples) mode(triples)
  • ranks: triples_percentile
  • accumulates: as_of(triples)
  • can be a benchmark
FanGraphs · baseballr
hr HR integer
measure

Home runs hit. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · baseballr
runs R integer
measure

Runs scored. MLB.com

What it takes
  • folds: sum(runs) avg(runs) min(runs) max(runs) count(runs) distinct(runs) only(runs) latest(runs) mean(runs) median(runs) mode(runs)
  • ranks: runs_percentile
  • accumulates: as_of(runs)
  • can be a benchmark
FanGraphs · baseballr
rbi RBI integer
measure

Runs batted in. MLB.com

What it takes
  • folds: sum(rbi) avg(rbi) min(rbi) max(rbi) count(rbi) distinct(rbi) only(rbi) latest(rbi) mean(rbi) median(rbi) mode(rbi)
  • ranks: rbi_percentile
  • accumulates: as_of(rbi)
  • can be a benchmark
FanGraphs · baseballr
bb BB integer
measure

Walks drawn. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · baseballr
ibb IBB integer
measure

Walks issued deliberately. MLB.com

What it takes
  • folds: sum(ibb) avg(ibb) min(ibb) max(ibb) count(ibb) distinct(ibb) only(ibb) latest(ibb) mean(ibb) median(ibb) mode(ibb)
  • ranks: ibb_percentile
  • accumulates: as_of(ibb)
  • can be a benchmark
FanGraphs · baseballr
so lower is better SO integer
measure

Times struck out at the plate. MLB.com

What it takes
  • folds: sum(so) avg(so) min(so) max(so) count(so) distinct(so) only(so) latest(so) mean(so) median(so) mode(so)
  • ranks: so_percentile
  • accumulates: as_of(so)
  • can be a benchmark
FanGraphs · baseballr
hbp HBP integer
measure

Times hit by a pitch. MLB.com

What it takes
  • folds: sum(hbp) avg(hbp) min(hbp) max(hbp) count(hbp) distinct(hbp) only(hbp) latest(hbp) mean(hbp) median(hbp) mode(hbp)
  • ranks: hbp_percentile
  • accumulates: as_of(hbp)
  • can be a benchmark
FanGraphs · baseballr
sf SF integer
measure

Sacrifice flies. MLB.com

What it takes
  • folds: sum(sf) avg(sf) min(sf) max(sf) count(sf) distinct(sf) only(sf) latest(sf) mean(sf) median(sf) mode(sf)
  • ranks: sf_percentile
  • accumulates: as_of(sf)
  • can be a benchmark
FanGraphs · baseballr
sh SH integer
measure

Sacrifice bunts. MLB.com

What it takes
  • folds: sum(sh) avg(sh) min(sh) max(sh) count(sh) distinct(sh) only(sh) latest(sh) mean(sh) median(sh) mode(sh)
  • ranks: sh_percentile
  • accumulates: as_of(sh)
  • can be a benchmark
FanGraphs · baseballr
gidp lower is better GIDP integer
measure

Times grounded into a double play. MLB.com

What it takes
  • folds: sum(gidp) avg(gidp) min(gidp) max(gidp) count(gidp) distinct(gidp) only(gidp) latest(gidp) mean(gidp) median(gidp) mode(gidp)
  • ranks: gidp_percentile
  • accumulates: as_of(gidp)
  • can be a benchmark
FanGraphs · baseballr
sb SB integer
measure

Bases stolen. MLB.com

What it takes
  • folds: sum(sb) avg(sb) min(sb) max(sb) count(sb) distinct(sb) only(sb) latest(sb) mean(sb) median(sb) mode(sb)
  • ranks: sb_percentile
  • accumulates: as_of(sb)
  • can be a benchmark
FanGraphs · baseballr
cs lower is better CS integer
measure

Times thrown out stealing. MLB.com

What it takes
  • folds: sum(cs) avg(cs) min(cs) max(cs) count(cs) distinct(cs) only(cs) latest(cs) mean(cs) median(cs) mode(cs)
  • ranks: cs_percentile
  • accumulates: as_of(cs)
  • can be a benchmark
FanGraphs · baseballr
pitches Pitches integer
measure

Pitches seen at the plate. MLB.com

Pitches seen — the denominator every plate-discipline rate here divides by

What it takes
  • folds: sum(pitches) avg(pitches) min(pitches) max(pitches) count(pitches) distinct(pitches) only(pitches) latest(pitches) mean(pitches) median(pitches) mode(pitches)
  • ranks: pitches_percentile
  • accumulates: as_of(pitches)
  • can be a benchmark
FanGraphs · baseballr
bip BIP integer
measure

Batted balls put in play.

Batted-ball events, which the tracking averages are measured over

What it takes
  • folds: sum(bip) avg(bip) min(bip) max(bip) count(bip) distinct(bip) only(bip) latest(bip) mean(bip) median(bip) mode(bip)
  • ranks: bip_percentile
  • accumulates: as_of(bip)
  • can be a benchmark
FanGraphs · baseballr
avg AVG number
measure

Batting average — hits per at-bat. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
FanGraphs · baseballr
obp OBP number
measure

On-base percentage — how often a plate appearance ended with a runner on. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
FanGraphs · baseballr
slg SLG number
measure

Slugging percentage — total bases per at-bat, so it weighs extra-base hits. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
FanGraphs · baseballr
ops OPS number
measure

On-base plus slugging: the two rates added, the quickest one-number read on a hitter. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
FanGraphs · baseballr
iso ISO number
measure

Isolated power — slugging less batting average, so it counts only the extra bases. MLB.com

What it takes
  • folds: sum(iso) avg(iso) min(iso) max(iso) count(iso) distinct(iso) only(iso) latest(iso) mean(iso) median(iso) mode(iso)
  • ranks: iso_percentile
  • accumulates: as_of(iso)
  • can be a benchmark
FanGraphs · baseballr
babip BABIP number
measure

Batting average on balls in play, which strips out strikeouts and home runs. Swings a lot on luck. MLB.com

What it takes
  • folds: sum(babip) avg(babip) min(babip) max(babip) count(babip) distinct(babip) only(babip) latest(babip) mean(babip) median(babip) mode(babip)
  • ranks: babip_percentile
  • accumulates: as_of(babip)
  • can be a benchmark
FanGraphs · baseballr
bb_pct BB% number
measure

Share of plate appearances that ended in a walk. FanGraphs

Walks per plate appearance, as a whole percent (8.5 = 8.5%)

What it takes
  • folds: sum(bb_pct) avg(bb_pct) min(bb_pct) max(bb_pct) count(bb_pct) distinct(bb_pct) only(bb_pct) latest(bb_pct) mean(bb_pct) median(bb_pct) mode(bb_pct)
  • ranks: bb_pct_percentile
  • accumulates: as_of(bb_pct)
  • can be a benchmark
FanGraphs · baseballr
k_pct lower is better K% number
measure

Share of plate appearances that ended in a strikeout. FanGraphs

Strikeouts per plate appearance, as a whole percent

What it takes
  • folds: sum(k_pct) avg(k_pct) min(k_pct) max(k_pct) count(k_pct) distinct(k_pct) only(k_pct) latest(k_pct) mean(k_pct) median(k_pct) mode(k_pct)
  • ranks: k_pct_percentile
  • accumulates: as_of(k_pct)
  • can be a benchmark
FanGraphs · baseballr
gb_pct GB% number
measure

Share of batted balls hit on the ground. MLB.com

What it takes
  • folds: sum(gb_pct) avg(gb_pct) min(gb_pct) max(gb_pct) count(gb_pct) distinct(gb_pct) only(gb_pct) latest(gb_pct) mean(gb_pct) median(gb_pct) mode(gb_pct)
  • ranks: gb_pct_percentile
  • accumulates: as_of(gb_pct)
  • can be a benchmark
FanGraphs · baseballr
fb_pct FB% number
measure

Share of batted balls hit in the air. MLB.com

What it takes
  • folds: sum(fb_pct) avg(fb_pct) min(fb_pct) max(fb_pct) count(fb_pct) distinct(fb_pct) only(fb_pct) latest(fb_pct) mean(fb_pct) median(fb_pct) mode(fb_pct)
  • ranks: fb_pct_percentile
  • accumulates: as_of(fb_pct)
  • can be a benchmark
FanGraphs · baseballr
ld_pct LD% number
measure

Share of batted balls hit on a line. MLB.com

What it takes
  • folds: sum(ld_pct) avg(ld_pct) min(ld_pct) max(ld_pct) count(ld_pct) distinct(ld_pct) only(ld_pct) latest(ld_pct) mean(ld_pct) median(ld_pct) mode(ld_pct)
  • ranks: ld_pct_percentile
  • accumulates: as_of(ld_pct)
  • can be a benchmark
FanGraphs · baseballr
iffb_pct IFFB% number
measure

Share of fly balls that stayed in the infield — an automatic out, and the worst contact there is. MLB.com

What it takes
  • folds: sum(iffb_pct) avg(iffb_pct) min(iffb_pct) max(iffb_pct) count(iffb_pct) distinct(iffb_pct) only(iffb_pct) latest(iffb_pct) mean(iffb_pct) median(iffb_pct) mode(iffb_pct)
  • ranks: iffb_pct_percentile
  • accumulates: as_of(iffb_pct)
  • can be a benchmark
FanGraphs · baseballr
hr_fb HR/FB number
measure

Share of fly balls that left the yard. MLB.com

What it takes
  • folds: sum(hr_fb) avg(hr_fb) min(hr_fb) max(hr_fb) count(hr_fb) distinct(hr_fb) only(hr_fb) latest(hr_fb) mean(hr_fb) median(hr_fb) mode(hr_fb)
  • ranks: hr_fb_percentile
  • accumulates: as_of(hr_fb)
  • can be a benchmark
FanGraphs · baseballr
woba wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
FanGraphs · baseballr
wrc_plus wRC+ integer
measure

Runs created, adjusted for park and league and set on a scale where 100 is average and 150 is half again better. MLB.com

What it takes
  • folds: sum(wrc_plus) avg(wrc_plus) min(wrc_plus) max(wrc_plus) count(wrc_plus) distinct(wrc_plus) only(wrc_plus) latest(wrc_plus) mean(wrc_plus) median(wrc_plus) mode(wrc_plus)
  • ranks: wrc_plus_percentile
  • accumulates: as_of(wrc_plus)
  • can be a benchmark
FanGraphs · baseballr
wrc wRC number
measure

Weighted runs created — a batting line expressed as runs. FanGraphs

Runs created — a counting stat, so it sums across dates

What it takes
  • folds: sum(wrc) avg(wrc) min(wrc) max(wrc) count(wrc) distinct(wrc) only(wrc) latest(wrc) mean(wrc) median(wrc) mode(wrc)
  • ranks: wrc_percentile
  • accumulates: as_of(wrc)
  • can be a benchmark
FanGraphs · baseballr
wraa wRAA number
measure

Weighted runs above average — runs the batting was worth against a league-average hitter. MLB.com

Runs above average, which sums across dates

What it takes
  • folds: sum(wraa) avg(wraa) min(wraa) max(wraa) count(wraa) distinct(wraa) only(wraa) latest(wraa) mean(wraa) median(wraa) mode(wraa)
  • ranks: wraa_percentile
  • accumulates: as_of(wraa)
  • can be a benchmark
FanGraphs · baseballr
war WAR number
measure

Wins above replacement — batting, running and fielding together, as wins over a freely available player. FanGraphs

What it takes
  • folds: sum(war) avg(war) min(war) max(war) count(war) distinct(war) only(war) latest(war) mean(war) median(war) mode(war)
  • ranks: war_percentile
  • accumulates: as_of(war)
  • can be a benchmark
FanGraphs · baseballr
exit_velocity EV number
measure

How hard the ball was hit, in miles per hour, averaged over batted balls. MLB.com

What it takes
  • folds: sum(exit_velocity) avg(exit_velocity) min(exit_velocity) max(exit_velocity) count(exit_velocity) distinct(exit_velocity) only(exit_velocity) latest(exit_velocity) mean(exit_velocity) median(exit_velocity) mode(exit_velocity)
  • ranks: exit_velocity_percentile
  • accumulates: as_of(exit_velocity)
  • can be a benchmark
FanGraphs · baseballr
launch_angle LA number
measure

The vertical angle the ball left the bat at, in degrees. Around 10 to 30 is where hits live. MLB.com

What it takes
  • folds: sum(launch_angle) avg(launch_angle) min(launch_angle) max(launch_angle) count(launch_angle) distinct(launch_angle) only(launch_angle) latest(launch_angle) mean(launch_angle) median(launch_angle) mode(launch_angle)
  • ranks: launch_angle_percentile
  • accumulates: as_of(launch_angle)
  • can be a benchmark
FanGraphs · baseballr
max_exit_velocity maxEV number
measure

The hardest ball hit — the ceiling rather than the habit. MLB.com

Hardest ball hit that date. Fold it with max(max_exit_velocity) — averaging daily maxima understates it

What it takes
  • folds: sum(max_exit_velocity) avg(max_exit_velocity) min(max_exit_velocity) max(max_exit_velocity) count(max_exit_velocity) distinct(max_exit_velocity) only(max_exit_velocity) latest(max_exit_velocity) mean(max_exit_velocity) median(max_exit_velocity) mode(max_exit_velocity)
  • ranks: max_exit_velocity_percentile
  • accumulates: as_of(max_exit_velocity)
  • can be a benchmark
FanGraphs · baseballr
barrel_pct Barrel% number
measure

Share of batted balls hit at the exit velocity and launch angle that have historically produced a .500 average — the best contact there is. MLB.com

Share of batted balls barrelled, as a whole percent (12.17 = 12.17%)

What it takes
  • folds: sum(barrel_pct) avg(barrel_pct) min(barrel_pct) max(barrel_pct) count(barrel_pct) distinct(barrel_pct) only(barrel_pct) latest(barrel_pct) mean(barrel_pct) median(barrel_pct) mode(barrel_pct)
  • ranks: barrel_pct_percentile
  • accumulates: as_of(barrel_pct)
  • can be a benchmark
FanGraphs · baseballr
hard_hit_pct HardHit% number
measure

Share of batted balls hit at 95 mph or more. MLB.com

What it takes
  • folds: sum(hard_hit_pct) avg(hard_hit_pct) min(hard_hit_pct) max(hard_hit_pct) count(hard_hit_pct) distinct(hard_hit_pct) only(hard_hit_pct) latest(hard_hit_pct) mean(hard_hit_pct) median(hard_hit_pct) mode(hard_hit_pct)
  • ranks: hard_hit_pct_percentile
  • accumulates: as_of(hard_hit_pct)
  • can be a benchmark
FanGraphs · baseballr
xwoba xwOBA number
measure

What the contact was worth as a wOBA, from exit velocity and launch angle alone — the fielders and the park taken out. MLB.com

What it takes
  • folds: sum(xwoba) avg(xwoba) min(xwoba) max(xwoba) count(xwoba) distinct(xwoba) only(xwoba) latest(xwoba) mean(xwoba) median(xwoba) mode(xwoba)
  • ranks: xwoba_percentile
  • accumulates: as_of(xwoba)
  • can be a benchmark
FanGraphs · baseballr
xslg xSLG number
measure

What the contact was worth as a slugging percentage, before anyone fielded it. MLB.com

What it takes
  • folds: sum(xslg) avg(xslg) min(xslg) max(xslg) count(xslg) distinct(xslg) only(xslg) latest(xslg) mean(xslg) median(xslg) mode(xslg)
  • ranks: xslg_percentile
  • accumulates: as_of(xslg)
  • can be a benchmark
FanGraphs · baseballr
swing_pct Swing% number
measure

Share of pitches swung at. FanGraphs

What it takes
  • folds: sum(swing_pct) avg(swing_pct) min(swing_pct) max(swing_pct) count(swing_pct) distinct(swing_pct) only(swing_pct) latest(swing_pct) mean(swing_pct) median(swing_pct) mode(swing_pct)
  • ranks: swing_pct_percentile
  • accumulates: as_of(swing_pct)
  • can be a benchmark
FanGraphs · baseballr
zone_pct Zone% number
measure

Share of the pitches seen that were in the strike zone. FanGraphs

What it takes
  • folds: sum(zone_pct) avg(zone_pct) min(zone_pct) max(zone_pct) count(zone_pct) distinct(zone_pct) only(zone_pct) latest(zone_pct) mean(zone_pct) median(zone_pct) mode(zone_pct)
  • ranks: zone_pct_percentile
  • accumulates: as_of(zone_pct)
  • can be a benchmark
FanGraphs · baseballr
swstr_pct SwStr% number
measure

Share of pitches swung at and missed, over all pitches seen. FanGraphs

What it takes
  • folds: sum(swstr_pct) avg(swstr_pct) min(swstr_pct) max(swstr_pct) count(swstr_pct) distinct(swstr_pct) only(swstr_pct) latest(swstr_pct) mean(swstr_pct) median(swstr_pct) mode(swstr_pct)
  • ranks: swstr_pct_percentile
  • accumulates: as_of(swstr_pct)
  • can be a benchmark
FanGraphs · baseballr
cstr_pct CStr% number
measure

Share of pitches taken for a called strike. FanGraphs

What it takes
  • folds: sum(cstr_pct) avg(cstr_pct) min(cstr_pct) max(cstr_pct) count(cstr_pct) distinct(cstr_pct) only(cstr_pct) latest(cstr_pct) mean(cstr_pct) median(cstr_pct) mode(cstr_pct)
  • ranks: cstr_pct_percentile
  • accumulates: as_of(cstr_pct)
  • can be a benchmark
FanGraphs · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · baseballr
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.team_batting_months
select team, season, month, pa, hr, ops, wrc_plus
order by month desc
limit 200

select

The columns the answer carries

from mlb.team_batting_months
select team, season, month, pa, hr, ops, wrc_plus
order by month desc
limit 200

as

Renames a column's heading and nothing else

from mlb.team_batting_months
select team, season, pa as PA
order by pa desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.team_batting_months
where season = $year
select team, season, month
order by pa desc
limit 10

limit

How many rows come back

from mlb.team_batting_months
select team, season, month, pa, hr, ops, wrc_plus
order by month desc
limit 200

order by

Which end of the answer comes first

from mlb.team_batting_months
select team, season, month, pa
order by pa desc
limit 10

#

A comment, to the end of the line

# Team batting months — One row per club per calendar month, 2000 on — the wRC+ only FanGraphs can compute, at the grain its whole history can be asked at.
from mlb.team_batting_months
select team, season, month, pa, hr, ops, wrc_plus
order by month desc
limit 200

where

Chooses the rows the question is about

from mlb.team_batting_months
where season = 2026
select team, pa
order by pa desc
limit 10

and

Continues whichever filter clause came last

from mlb.team_batting_months
where season = 2026 and pa > 0
select team, pa
order by pa desc
limit 10

having

Filters the groups a fold made

from mlb.team_batting_months
select team, sum(pa)
group by team
having sum(pa) > 0
order by sum(pa) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, pa, pa_percentile
keep pa_percentile >= 90
order by pa_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.team_batting_months
select team, season, pa
highlight season = 2026
order by pa desc
limit 10

of

A threshold that is another row rather than a number

from mlb.team_batting_months
where pa >= max(pa) of season 2026
select team, pa
order by pa desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.team_batting_months
select team, count(*), sum(pa)
group by team
order by sum(pa) desc
limit 10

then

Folds the answer a second time

from mlb.team_batting_months
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 by

Reads the answer as a matrix

from mlb.team_batting_months
select team, season, sum(pa)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.team_batting_months
first 3 seasons
select team, sum(pa)
group by team
order by sum(pa) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.team_batting_months
select team, sum(pa)
group by team
order by sum(pa) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.team_batting_months
select team, avg(pa)
group by team
order by avg(pa) desc
limit 10

min(…)

The smallest value in each group

from mlb.team_batting_months
select team, min(pa)
group by team
order by min(pa) desc
limit 10

max(…)

The largest value in each group

from mlb.team_batting_months
select team, max(pa)
group by team
order by max(pa) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.team_batting_months
select team, count(pa)
group by team
order by count(pa) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.team_batting_months
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 mlb.team_batting_months
where season = 2026 and month = 2026-06
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 mlb.team_batting_months
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 mlb.team_batting_months
select team, mean(pa)
group by team
order by mean(pa) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.team_batting_months
select team, median(pa)
group by team
order by median(pa) desc
limit 10

mode(…)

The commonest value in the group

from mlb.team_batting_months
select team, mode(team)
group by team
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, pa, pa_percentile
order by pa_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.team_batting_months
select team, sum(pa), percentile(sum(pa))
group by team
order by sum(pa) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, pa, standing(pa)
order by pa desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, games, pa, composite(games, pa)
order by composite(games, pa) desc
limit 10

ratio(…)

One column divided by another

from mlb.team_batting_months
select team, count(*), ratio(sum(pa), count(*))
group by team
order by ratio(sum(pa), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, games, pa, calc(standing(games) - standing(pa))
order by calc(standing(games) - standing(pa)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.team_batting_months
select team, pa, format(pa, > 0 -> "on the board", <= 0 -> "nothing yet")
order by pa desc
limit 10

pair

Draws two columns of the answer in one

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, pa, pa_percentile
pair pa with pa_percentile
order by pa desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.team_batting_months
where season = 2026 and month = 2026-06
select team, games, pa, ab, composite(games, pa, ab) as Score
hint composite(games, pa, ab) as "G + PA + AB"
order by composite(games, pa, ab) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.player_batting_days Hitter days

One row per hitter per date — wRC+, wOBA and the counting line at whatever window you fold to.

from mlb.player_batting_days
select game_date, player, team, pa, hits, hr, wrc_plus
order by game_date desc
limit 200
One row is
one player's date (player-date)
Built from
one table, read straight
Reads
mlb_player_batting_days FanGraphs, baseballr
Shows by default
game_date player team pa hits hr wrc_plus
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons dates
Newest row
game_date

Before you trust the numbers

  • A single date is a handful of plate appearances — a one-day wRC+ of 250 is noise, not a hot streak. Fold a window: where game_date <= 2024-05-15 with group by team.
  • wRC+ and wOBA fold by plate appearances, which is exact within a season (measured worst case 0.08 wRC+ points) because their adjustments are fixed for the year. Across seasons the constants move and the fold is an approximation.
  • Regular season only, 2015 on — FanGraphs serves date ranges back to 1974. mlb.team_batting_months carries the club's line back to 2000 at month grain.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — because the loader resolves FanGraphs' spelling to a club and the view prints dim_team's.
  • Only hitters with a plate appearance that date are stored — a reliever who appeared and never batted is not a row.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position This board is every hitter — query mlb.fielders for positions
season the season column
Columns 56
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The calendar date played. One row per date, standing alone rather than cumulative

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
FanGraphs · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
FanGraphs · baseballr
team completes team Team string
dimension

The club.

The club he played for that day, so a trade is two dates rather than a null

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
pa PA integer
measure

Plate appearances — every trip to the plate, walks and sacrifices included. MLB.com

What it takes
  • folds: sum(pa) avg(pa) min(pa) max(pa) count(pa) distinct(pa) only(pa) latest(pa) mean(pa) median(pa) mode(pa)
  • ranks: pa_percentile
  • accumulates: as_of(pa)
  • can be a benchmark
FanGraphs · baseballr
ab AB integer
measure

At-bats — plate appearances less walks, hit-by-pitches and sacrifices. MLB.com

What it takes
  • folds: sum(ab) avg(ab) min(ab) max(ab) count(ab) distinct(ab) only(ab) latest(ab) mean(ab) median(ab) mode(ab)
  • ranks: ab_percentile
  • accumulates: as_of(ab)
  • can be a benchmark
FanGraphs · baseballr
hits H integer
measure

Hits. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
FanGraphs · baseballr
singles 1B integer
measure

Singles. MLB.com

What it takes
  • folds: sum(singles) avg(singles) min(singles) max(singles) count(singles) distinct(singles) only(singles) latest(singles) mean(singles) median(singles) mode(singles)
  • ranks: singles_percentile
  • accumulates: as_of(singles)
  • can be a benchmark
FanGraphs · baseballr
doubles 2B integer
measure

Doubles. MLB.com

What it takes
  • folds: sum(doubles) avg(doubles) min(doubles) max(doubles) count(doubles) distinct(doubles) only(doubles) latest(doubles) mean(doubles) median(doubles) mode(doubles)
  • ranks: doubles_percentile
  • accumulates: as_of(doubles)
  • can be a benchmark
FanGraphs · baseballr
triples 3B integer
measure

Triples. MLB.com

What it takes
  • folds: sum(triples) avg(triples) min(triples) max(triples) count(triples) distinct(triples) only(triples) latest(triples) mean(triples) median(triples) mode(triples)
  • ranks: triples_percentile
  • accumulates: as_of(triples)
  • can be a benchmark
FanGraphs · baseballr
hr HR integer
measure

Home runs hit. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · baseballr
runs R integer
measure

Runs scored. MLB.com

What it takes
  • folds: sum(runs) avg(runs) min(runs) max(runs) count(runs) distinct(runs) only(runs) latest(runs) mean(runs) median(runs) mode(runs)
  • ranks: runs_percentile
  • accumulates: as_of(runs)
  • can be a benchmark
FanGraphs · baseballr
rbi RBI integer
measure

Runs batted in. MLB.com

What it takes
  • folds: sum(rbi) avg(rbi) min(rbi) max(rbi) count(rbi) distinct(rbi) only(rbi) latest(rbi) mean(rbi) median(rbi) mode(rbi)
  • ranks: rbi_percentile
  • accumulates: as_of(rbi)
  • can be a benchmark
FanGraphs · baseballr
bb BB integer
measure

Walks drawn. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · baseballr
ibb IBB integer
measure

Walks issued deliberately. MLB.com

What it takes
  • folds: sum(ibb) avg(ibb) min(ibb) max(ibb) count(ibb) distinct(ibb) only(ibb) latest(ibb) mean(ibb) median(ibb) mode(ibb)
  • ranks: ibb_percentile
  • accumulates: as_of(ibb)
  • can be a benchmark
FanGraphs · baseballr
so lower is better SO integer
measure

Times struck out at the plate. MLB.com

What it takes
  • folds: sum(so) avg(so) min(so) max(so) count(so) distinct(so) only(so) latest(so) mean(so) median(so) mode(so)
  • ranks: so_percentile
  • accumulates: as_of(so)
  • can be a benchmark
FanGraphs · baseballr
hbp HBP integer
measure

Times hit by a pitch. MLB.com

What it takes
  • folds: sum(hbp) avg(hbp) min(hbp) max(hbp) count(hbp) distinct(hbp) only(hbp) latest(hbp) mean(hbp) median(hbp) mode(hbp)
  • ranks: hbp_percentile
  • accumulates: as_of(hbp)
  • can be a benchmark
FanGraphs · baseballr
sf SF integer
measure

Sacrifice flies. MLB.com

What it takes
  • folds: sum(sf) avg(sf) min(sf) max(sf) count(sf) distinct(sf) only(sf) latest(sf) mean(sf) median(sf) mode(sf)
  • ranks: sf_percentile
  • accumulates: as_of(sf)
  • can be a benchmark
FanGraphs · baseballr
sh SH integer
measure

Sacrifice bunts. MLB.com

What it takes
  • folds: sum(sh) avg(sh) min(sh) max(sh) count(sh) distinct(sh) only(sh) latest(sh) mean(sh) median(sh) mode(sh)
  • ranks: sh_percentile
  • accumulates: as_of(sh)
  • can be a benchmark
FanGraphs · baseballr
gidp lower is better GIDP integer
measure

Times grounded into a double play. MLB.com

What it takes
  • folds: sum(gidp) avg(gidp) min(gidp) max(gidp) count(gidp) distinct(gidp) only(gidp) latest(gidp) mean(gidp) median(gidp) mode(gidp)
  • ranks: gidp_percentile
  • accumulates: as_of(gidp)
  • can be a benchmark
FanGraphs · baseballr
sb SB integer
measure

Bases stolen. MLB.com

What it takes
  • folds: sum(sb) avg(sb) min(sb) max(sb) count(sb) distinct(sb) only(sb) latest(sb) mean(sb) median(sb) mode(sb)
  • ranks: sb_percentile
  • accumulates: as_of(sb)
  • can be a benchmark
FanGraphs · baseballr
cs lower is better CS integer
measure

Times thrown out stealing. MLB.com

What it takes
  • folds: sum(cs) avg(cs) min(cs) max(cs) count(cs) distinct(cs) only(cs) latest(cs) mean(cs) median(cs) mode(cs)
  • ranks: cs_percentile
  • accumulates: as_of(cs)
  • can be a benchmark
FanGraphs · baseballr
pitches Pitches integer
measure

Pitches seen at the plate. MLB.com

Pitches seen — the denominator every plate-discipline rate here divides by

What it takes
  • folds: sum(pitches) avg(pitches) min(pitches) max(pitches) count(pitches) distinct(pitches) only(pitches) latest(pitches) mean(pitches) median(pitches) mode(pitches)
  • ranks: pitches_percentile
  • accumulates: as_of(pitches)
  • can be a benchmark
FanGraphs · baseballr
bip BIP integer
measure

Batted balls put in play.

Batted-ball events, which the tracking averages are measured over

What it takes
  • folds: sum(bip) avg(bip) min(bip) max(bip) count(bip) distinct(bip) only(bip) latest(bip) mean(bip) median(bip) mode(bip)
  • ranks: bip_percentile
  • accumulates: as_of(bip)
  • can be a benchmark
FanGraphs · baseballr
avg AVG number
measure

Batting average — hits per at-bat. MLB.com

What it takes
  • folds: sum(avg) avg(avg) min(avg) max(avg) count(avg) distinct(avg) only(avg) latest(avg) mean(avg) median(avg) mode(avg)
  • ranks: avg_percentile
  • accumulates: as_of(avg)
  • can be a benchmark
FanGraphs · baseballr
obp OBP number
measure

On-base percentage — how often a plate appearance ended with a runner on. MLB.com

What it takes
  • folds: sum(obp) avg(obp) min(obp) max(obp) count(obp) distinct(obp) only(obp) latest(obp) mean(obp) median(obp) mode(obp)
  • ranks: obp_percentile
  • accumulates: as_of(obp)
  • can be a benchmark
FanGraphs · baseballr
slg SLG number
measure

Slugging percentage — total bases per at-bat, so it weighs extra-base hits. MLB.com

What it takes
  • folds: sum(slg) avg(slg) min(slg) max(slg) count(slg) distinct(slg) only(slg) latest(slg) mean(slg) median(slg) mode(slg)
  • ranks: slg_percentile
  • accumulates: as_of(slg)
  • can be a benchmark
FanGraphs · baseballr
ops OPS number
measure

On-base plus slugging: the two rates added, the quickest one-number read on a hitter. MLB.com

What it takes
  • folds: sum(ops) avg(ops) min(ops) max(ops) count(ops) distinct(ops) only(ops) latest(ops) mean(ops) median(ops) mode(ops)
  • ranks: ops_percentile
  • accumulates: as_of(ops)
  • can be a benchmark
FanGraphs · baseballr
iso ISO number
measure

Isolated power — slugging less batting average, so it counts only the extra bases. MLB.com

What it takes
  • folds: sum(iso) avg(iso) min(iso) max(iso) count(iso) distinct(iso) only(iso) latest(iso) mean(iso) median(iso) mode(iso)
  • ranks: iso_percentile
  • accumulates: as_of(iso)
  • can be a benchmark
FanGraphs · baseballr
babip BABIP number
measure

Batting average on balls in play, which strips out strikeouts and home runs. Swings a lot on luck. MLB.com

What it takes
  • folds: sum(babip) avg(babip) min(babip) max(babip) count(babip) distinct(babip) only(babip) latest(babip) mean(babip) median(babip) mode(babip)
  • ranks: babip_percentile
  • accumulates: as_of(babip)
  • can be a benchmark
FanGraphs · baseballr
bb_pct BB% number
measure

Share of plate appearances that ended in a walk. FanGraphs

Walks per plate appearance, as a whole percent (8.5 = 8.5%)

What it takes
  • folds: sum(bb_pct) avg(bb_pct) min(bb_pct) max(bb_pct) count(bb_pct) distinct(bb_pct) only(bb_pct) latest(bb_pct) mean(bb_pct) median(bb_pct) mode(bb_pct)
  • ranks: bb_pct_percentile
  • accumulates: as_of(bb_pct)
  • can be a benchmark
FanGraphs · baseballr
k_pct lower is better K% number
measure

Share of plate appearances that ended in a strikeout. FanGraphs

Strikeouts per plate appearance, as a whole percent

What it takes
  • folds: sum(k_pct) avg(k_pct) min(k_pct) max(k_pct) count(k_pct) distinct(k_pct) only(k_pct) latest(k_pct) mean(k_pct) median(k_pct) mode(k_pct)
  • ranks: k_pct_percentile
  • accumulates: as_of(k_pct)
  • can be a benchmark
FanGraphs · baseballr
gb_pct GB% number
measure

Share of batted balls hit on the ground. MLB.com

What it takes
  • folds: sum(gb_pct) avg(gb_pct) min(gb_pct) max(gb_pct) count(gb_pct) distinct(gb_pct) only(gb_pct) latest(gb_pct) mean(gb_pct) median(gb_pct) mode(gb_pct)
  • ranks: gb_pct_percentile
  • accumulates: as_of(gb_pct)
  • can be a benchmark
FanGraphs · baseballr
fb_pct FB% number
measure

Share of batted balls hit in the air. MLB.com

What it takes
  • folds: sum(fb_pct) avg(fb_pct) min(fb_pct) max(fb_pct) count(fb_pct) distinct(fb_pct) only(fb_pct) latest(fb_pct) mean(fb_pct) median(fb_pct) mode(fb_pct)
  • ranks: fb_pct_percentile
  • accumulates: as_of(fb_pct)
  • can be a benchmark
FanGraphs · baseballr
ld_pct LD% number
measure

Share of batted balls hit on a line. MLB.com

What it takes
  • folds: sum(ld_pct) avg(ld_pct) min(ld_pct) max(ld_pct) count(ld_pct) distinct(ld_pct) only(ld_pct) latest(ld_pct) mean(ld_pct) median(ld_pct) mode(ld_pct)
  • ranks: ld_pct_percentile
  • accumulates: as_of(ld_pct)
  • can be a benchmark
FanGraphs · baseballr
iffb_pct IFFB% number
measure

Share of fly balls that stayed in the infield — an automatic out, and the worst contact there is. MLB.com

What it takes
  • folds: sum(iffb_pct) avg(iffb_pct) min(iffb_pct) max(iffb_pct) count(iffb_pct) distinct(iffb_pct) only(iffb_pct) latest(iffb_pct) mean(iffb_pct) median(iffb_pct) mode(iffb_pct)
  • ranks: iffb_pct_percentile
  • accumulates: as_of(iffb_pct)
  • can be a benchmark
FanGraphs · baseballr
hr_fb HR/FB number
measure

Share of fly balls that left the yard. MLB.com

What it takes
  • folds: sum(hr_fb) avg(hr_fb) min(hr_fb) max(hr_fb) count(hr_fb) distinct(hr_fb) only(hr_fb) latest(hr_fb) mean(hr_fb) median(hr_fb) mode(hr_fb)
  • ranks: hr_fb_percentile
  • accumulates: as_of(hr_fb)
  • can be a benchmark
FanGraphs · baseballr
woba wOBA number
measure

Weighted on-base average — on-base percentage with each way of reaching weighted by the runs it is actually worth. MLB.com

What it takes
  • folds: sum(woba) avg(woba) min(woba) max(woba) count(woba) distinct(woba) only(woba) latest(woba) mean(woba) median(woba) mode(woba)
  • ranks: woba_percentile
  • accumulates: as_of(woba)
  • can be a benchmark
FanGraphs · baseballr
wrc_plus wRC+ integer
measure

Runs created, adjusted for park and league and set on a scale where 100 is average and 150 is half again better. MLB.com

What it takes
  • folds: sum(wrc_plus) avg(wrc_plus) min(wrc_plus) max(wrc_plus) count(wrc_plus) distinct(wrc_plus) only(wrc_plus) latest(wrc_plus) mean(wrc_plus) median(wrc_plus) mode(wrc_plus)
  • ranks: wrc_plus_percentile
  • accumulates: as_of(wrc_plus)
  • can be a benchmark
FanGraphs · baseballr
wrc wRC number
measure

Weighted runs created — a batting line expressed as runs. FanGraphs

Runs created — a counting stat, so it sums across dates

What it takes
  • folds: sum(wrc) avg(wrc) min(wrc) max(wrc) count(wrc) distinct(wrc) only(wrc) latest(wrc) mean(wrc) median(wrc) mode(wrc)
  • ranks: wrc_percentile
  • accumulates: as_of(wrc)
  • can be a benchmark
FanGraphs · baseballr
wraa wRAA number
measure

Weighted runs above average — runs the batting was worth against a league-average hitter. MLB.com

Runs above average, which sums across dates

What it takes
  • folds: sum(wraa) avg(wraa) min(wraa) max(wraa) count(wraa) distinct(wraa) only(wraa) latest(wraa) mean(wraa) median(wraa) mode(wraa)
  • ranks: wraa_percentile
  • accumulates: as_of(wraa)
  • can be a benchmark
FanGraphs · baseballr
war WAR number
measure

Wins above replacement — batting, running and fielding together, as wins over a freely available player. FanGraphs

What it takes
  • folds: sum(war) avg(war) min(war) max(war) count(war) distinct(war) only(war) latest(war) mean(war) median(war) mode(war)
  • ranks: war_percentile
  • accumulates: as_of(war)
  • can be a benchmark
FanGraphs · baseballr
exit_velocity EV number
measure

How hard the ball was hit, in miles per hour, averaged over batted balls. MLB.com

What it takes
  • folds: sum(exit_velocity) avg(exit_velocity) min(exit_velocity) max(exit_velocity) count(exit_velocity) distinct(exit_velocity) only(exit_velocity) latest(exit_velocity) mean(exit_velocity) median(exit_velocity) mode(exit_velocity)
  • ranks: exit_velocity_percentile
  • accumulates: as_of(exit_velocity)
  • can be a benchmark
FanGraphs · baseballr
launch_angle LA number
measure

The vertical angle the ball left the bat at, in degrees. Around 10 to 30 is where hits live. MLB.com

What it takes
  • folds: sum(launch_angle) avg(launch_angle) min(launch_angle) max(launch_angle) count(launch_angle) distinct(launch_angle) only(launch_angle) latest(launch_angle) mean(launch_angle) median(launch_angle) mode(launch_angle)
  • ranks: launch_angle_percentile
  • accumulates: as_of(launch_angle)
  • can be a benchmark
FanGraphs · baseballr
max_exit_velocity maxEV number
measure

The hardest ball hit — the ceiling rather than the habit. MLB.com

Hardest ball hit that date. Fold it with max(max_exit_velocity) — averaging daily maxima understates it

What it takes
  • folds: sum(max_exit_velocity) avg(max_exit_velocity) min(max_exit_velocity) max(max_exit_velocity) count(max_exit_velocity) distinct(max_exit_velocity) only(max_exit_velocity) latest(max_exit_velocity) mean(max_exit_velocity) median(max_exit_velocity) mode(max_exit_velocity)
  • ranks: max_exit_velocity_percentile
  • accumulates: as_of(max_exit_velocity)
  • can be a benchmark
FanGraphs · baseballr
barrel_pct Barrel% number
measure

Share of batted balls hit at the exit velocity and launch angle that have historically produced a .500 average — the best contact there is. MLB.com

Share of batted balls barrelled, as a whole percent (12.17 = 12.17%)

What it takes
  • folds: sum(barrel_pct) avg(barrel_pct) min(barrel_pct) max(barrel_pct) count(barrel_pct) distinct(barrel_pct) only(barrel_pct) latest(barrel_pct) mean(barrel_pct) median(barrel_pct) mode(barrel_pct)
  • ranks: barrel_pct_percentile
  • accumulates: as_of(barrel_pct)
  • can be a benchmark
FanGraphs · baseballr
hard_hit_pct HardHit% number
measure

Share of batted balls hit at 95 mph or more. MLB.com

What it takes
  • folds: sum(hard_hit_pct) avg(hard_hit_pct) min(hard_hit_pct) max(hard_hit_pct) count(hard_hit_pct) distinct(hard_hit_pct) only(hard_hit_pct) latest(hard_hit_pct) mean(hard_hit_pct) median(hard_hit_pct) mode(hard_hit_pct)
  • ranks: hard_hit_pct_percentile
  • accumulates: as_of(hard_hit_pct)
  • can be a benchmark
FanGraphs · baseballr
xwoba xwOBA number
measure

What the contact was worth as a wOBA, from exit velocity and launch angle alone — the fielders and the park taken out. MLB.com

What it takes
  • folds: sum(xwoba) avg(xwoba) min(xwoba) max(xwoba) count(xwoba) distinct(xwoba) only(xwoba) latest(xwoba) mean(xwoba) median(xwoba) mode(xwoba)
  • ranks: xwoba_percentile
  • accumulates: as_of(xwoba)
  • can be a benchmark
FanGraphs · baseballr
xslg xSLG number
measure

What the contact was worth as a slugging percentage, before anyone fielded it. MLB.com

What it takes
  • folds: sum(xslg) avg(xslg) min(xslg) max(xslg) count(xslg) distinct(xslg) only(xslg) latest(xslg) mean(xslg) median(xslg) mode(xslg)
  • ranks: xslg_percentile
  • accumulates: as_of(xslg)
  • can be a benchmark
FanGraphs · baseballr
swing_pct Swing% number
measure

Share of pitches swung at. FanGraphs

What it takes
  • folds: sum(swing_pct) avg(swing_pct) min(swing_pct) max(swing_pct) count(swing_pct) distinct(swing_pct) only(swing_pct) latest(swing_pct) mean(swing_pct) median(swing_pct) mode(swing_pct)
  • ranks: swing_pct_percentile
  • accumulates: as_of(swing_pct)
  • can be a benchmark
FanGraphs · baseballr
zone_pct Zone% number
measure

Share of the pitches seen that were in the strike zone. FanGraphs

What it takes
  • folds: sum(zone_pct) avg(zone_pct) min(zone_pct) max(zone_pct) count(zone_pct) distinct(zone_pct) only(zone_pct) latest(zone_pct) mean(zone_pct) median(zone_pct) mode(zone_pct)
  • ranks: zone_pct_percentile
  • accumulates: as_of(zone_pct)
  • can be a benchmark
FanGraphs · baseballr
swstr_pct SwStr% number
measure

Share of pitches swung at and missed, over all pitches seen. FanGraphs

What it takes
  • folds: sum(swstr_pct) avg(swstr_pct) min(swstr_pct) max(swstr_pct) count(swstr_pct) distinct(swstr_pct) only(swstr_pct) latest(swstr_pct) mean(swstr_pct) median(swstr_pct) mode(swstr_pct)
  • ranks: swstr_pct_percentile
  • accumulates: as_of(swstr_pct)
  • can be a benchmark
FanGraphs · baseballr
cstr_pct CStr% number
measure

Share of pitches taken for a called strike. FanGraphs

What it takes
  • folds: sum(cstr_pct) avg(cstr_pct) min(cstr_pct) max(cstr_pct) count(cstr_pct) distinct(cstr_pct) only(cstr_pct) latest(cstr_pct) mean(cstr_pct) median(cstr_pct) mode(cstr_pct)
  • ranks: cstr_pct_percentile
  • accumulates: as_of(cstr_pct)
  • can be a benchmark
FanGraphs · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.player_batting_days
select game_date, player, team, pa, hits, hr, wrc_plus
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.player_batting_days
select game_date, player, team, pa, hits, hr, wrc_plus
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.player_batting_days
select game_date, player, pa as PA
order by pa desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.player_batting_days
where season = $year
select game_date, player, team
order by pa desc
limit 10

limit

How many rows come back

from mlb.player_batting_days
select game_date, player, team, pa, hits, hr, wrc_plus
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.player_batting_days
select game_date, player, team, pa
order by pa desc
limit 10

#

A comment, to the end of the line

# Hitter days — One row per hitter per date — wRC+, wOBA and the counting line at whatever window you fold to.
from mlb.player_batting_days
select game_date, player, team, pa, hits, hr, wrc_plus
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.player_batting_days
where season = 2026
select player, pa
order by pa desc
limit 10

and

Continues whichever filter clause came last

from mlb.player_batting_days
where season = 2026 and pa > 0
select player, pa
order by pa desc
limit 10

having

Filters the groups a fold made

from mlb.player_batting_days
select player, sum(pa)
group by player
having sum(pa) > 0
order by sum(pa) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.player_batting_days
where season = 2026
select player, pa, pa_percentile
keep pa_percentile >= 90
order by pa_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.player_batting_days
select player, season, pa
highlight season = 2026
order by pa desc
limit 10

of

A threshold that is another row rather than a number

from mlb.player_batting_days
where pa >= max(pa) of season 2026
select player, pa
order by pa desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.player_batting_days
select player, count(*), sum(pa)
group by player
order by sum(pa) desc
limit 10

then

Folds the answer a second time

from mlb.player_batting_days
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 by

Reads the answer as a matrix

from mlb.player_batting_days
select player, team, sum(pa)
group by player, team
pivot by team
limit 25

first / last

Only part of each career, before anything else runs

from mlb.player_batting_days
first 3 game_dates
select player, sum(pa)
group by player
order by sum(pa) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.player_batting_days
select player, sum(pa)
group by player
order by sum(pa) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.player_batting_days
select player, avg(pa)
group by player
order by avg(pa) desc
limit 10

min(…)

The smallest value in each group

from mlb.player_batting_days
select player, min(pa)
group by player
order by min(pa) desc
limit 10

max(…)

The largest value in each group

from mlb.player_batting_days
select player, max(pa)
group by player
order by max(pa) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.player_batting_days
select player, count(pa)
group by player
order by count(pa) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.player_batting_days
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 mlb.player_batting_days
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 mlb.player_batting_days
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 mlb.player_batting_days
select player, mean(pa)
group by player
order by mean(pa) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.player_batting_days
select player, median(pa)
group by player
order by median(pa) desc
limit 10

mode(…)

The commonest value in the group

from mlb.player_batting_days
select player, mode(player)
group by player
order by count(*) desc
limit 10

year(…)

Reads a date as the year it falls in

from mlb.player_batting_days
select player, year(game_date), sum(pa)
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 mlb.player_batting_days
select player, quarter(game_date), sum(pa)
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 mlb.player_batting_days
select player, month(game_date), sum(pa)
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 mlb.player_batting_days
select player, week(game_date), sum(pa)
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 mlb.player_batting_days
where season = 2026
select player, month(game_date), as_of(pa)
group by player, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.player_batting_days
where season = 2026
select player, pa, pa_percentile
order by pa_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.player_batting_days
select player, sum(pa), percentile(sum(pa))
group by player
order by sum(pa) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.player_batting_days
where season = 2026
select player, pa, standing(pa)
order by pa desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.player_batting_days
where season = 2026
select player, games, pa, composite(games, pa)
order by composite(games, pa) desc
limit 10

ratio(…)

One column divided by another

from mlb.player_batting_days
select player, count(*), ratio(sum(pa), count(*))
group by player
order by ratio(sum(pa), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.player_batting_days
where season = 2026
select player, games, pa, calc(standing(games) - standing(pa))
order by calc(standing(games) - standing(pa)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.player_batting_days
select player, pa, format(pa, > 0 -> "on the board", <= 0 -> "nothing yet")
order by pa desc
limit 10

pair

Draws two columns of the answer in one

from mlb.player_batting_days
where season = 2026
select player, pa, pa_percentile
pair pa with pa_percentile
order by pa desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.player_batting_days
where season = 2026
select player, games, pa, ab, composite(games, pa, ab) as Score
hint composite(games, pa, ab) as "G + PA + AB"
order by composite(games, pa, ab) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.player_pitching_days Pitcher days

One row per pitcher per date — FIP, xFIP and WPA at whatever window you fold to.

from mlb.player_pitching_days
select game_date, player, team, ip, era, fip, wpa
order by game_date desc
limit 200
One row is
one player's date (player-date)
Built from
one table, read straight
Reads
mlb_player_pitching_days FanGraphs, baseballr
Shows by default
game_date player team ip era fip wpa
Ordered by
game_date desc
Rows
200 by default, 10000 at most
Ranks within
season
Careers counted in
game_dates seasons dates
Newest row
game_date

Before you trust the numbers

  • A single date is an inning or two — a one-day FIP of 13 is one home run, not a collapse. These rows are made to be folded: where game_date <= 2026-06-30 with group by month(game_date).
  • FIP and xFIP fold by innings, which is exact within a season because the constant is fixed for the year and innings are its own denominator. Across seasons the constant moves and the fold is an approximation.
  • WPA, +WPA, -WPA and RE24 sum — a window is the sum of its days, so a running total from any date is sum(wpa). This is FanGraphs' win probability, not a Statcast run-value proxy: it is wins rather than runs, and it knows the leverage the game was played at.
  • SIERA, pitching WAR and xERA are absent on purpose — each was measured folding wrong over a window, and a column that cannot be folded honestly is worse than one that is missing.
  • Regular season only, 2015 on — FanGraphs serves date ranges back to 1974, and widening it is a backfill rather than a code change.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — because the loader resolves FanGraphs' spelling to a club and the view prints dim_team's.
  • Only pitchers who recorded an out that date are stored — a reliever who warmed up and never entered is not a row.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position the role column
season the season column
Columns 38
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

The calendar date played. One row per date, standing alone rather than cumulative

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
FanGraphs · baseballr
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
FanGraphs · baseballr
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
FanGraphs · baseballr
team completes team Team string
dimension

The club.

The club he pitched for that day, so a trade is two dates rather than a null

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
FanGraphs · baseballr
role completes position Role string
dimension

Whether he was working as a starter or out of the bullpen.

SP on a date he started, otherwise RP

The day's role, not the season's — a starter's relief outing is an RP row

What it takes
  • folds: count(role) distinct(role) only(role) latest(role) mode(role)
FanGraphs · baseballr
games G integer
measure

Games played. MLB.com

What it takes
  • folds: sum(games) avg(games) min(games) max(games) count(games) distinct(games) only(games) latest(games) mean(games) median(games) mode(games)
  • ranks: games_percentile
  • accumulates: as_of(games)
  • can be a benchmark
FanGraphs · baseballr
starts GS integer
measure

Games he started. MLB.com

What it takes
  • folds: sum(starts) avg(starts) min(starts) max(starts) count(starts) distinct(starts) only(starts) latest(starts) mean(starts) median(starts) mode(starts)
  • ranks: starts_percentile
  • accumulates: as_of(starts)
  • can be a benchmark
FanGraphs · baseballr
ip IP number
measure

Innings pitched. The decimal is thirds of an inning: 6.2 is six and two outs. MLB.com

What it takes
  • folds: sum(ip) avg(ip) min(ip) max(ip) count(ip) distinct(ip) only(ip) latest(ip) mean(ip) median(ip) mode(ip)
  • ranks: ip_percentile
  • accumulates: as_of(ip)
  • can be a benchmark
FanGraphs · baseballr
start_ip Start IP number
measure

Innings he threw as a starter.

What it takes
  • folds: sum(start_ip) avg(start_ip) min(start_ip) max(start_ip) count(start_ip) distinct(start_ip) only(start_ip) latest(start_ip) mean(start_ip) median(start_ip) mode(start_ip)
  • ranks: start_ip_percentile
  • accumulates: as_of(start_ip)
  • can be a benchmark
FanGraphs · baseballr
relief_ip Relief IP number
measure

Innings he threw in relief.

What it takes
  • folds: sum(relief_ip) avg(relief_ip) min(relief_ip) max(relief_ip) count(relief_ip) distinct(relief_ip) only(relief_ip) latest(relief_ip) mean(relief_ip) median(relief_ip) mode(relief_ip)
  • ranks: relief_ip_percentile
  • accumulates: as_of(relief_ip)
  • can be a benchmark
FanGraphs · baseballr
tbf TBF integer
measure

Total batters faced. MLB.com

What it takes
  • folds: sum(tbf) avg(tbf) min(tbf) max(tbf) count(tbf) distinct(tbf) only(tbf) latest(tbf) mean(tbf) median(tbf) mode(tbf)
  • ranks: tbf_percentile
  • accumulates: as_of(tbf)
  • can be a benchmark
FanGraphs · baseballr
er lower is better ER integer
measure

Earned runs allowed — the ones not caused by an error. MLB.com

What it takes
  • folds: sum(er) avg(er) min(er) max(er) count(er) distinct(er) only(er) latest(er) mean(er) median(er) mode(er)
  • ranks: er_percentile
  • accumulates: as_of(er)
  • can be a benchmark
FanGraphs · baseballr
r lower is better R integer
measure

Runs allowed, earned or not. MLB.com

What it takes
  • folds: sum(r) avg(r) min(r) max(r) count(r) distinct(r) only(r) latest(r) mean(r) median(r) mode(r)
  • ranks: r_percentile
  • accumulates: as_of(r)
  • can be a benchmark
FanGraphs · baseballr
hits lower is better H integer
measure

Hits he gave up. MLB.com

What it takes
  • folds: sum(hits) avg(hits) min(hits) max(hits) count(hits) distinct(hits) only(hits) latest(hits) mean(hits) median(hits) mode(hits)
  • ranks: hits_percentile
  • accumulates: as_of(hits)
  • can be a benchmark
FanGraphs · baseballr
hr lower is better HR integer
measure

Home runs he gave up. MLB.com

What it takes
  • folds: sum(hr) avg(hr) min(hr) max(hr) count(hr) distinct(hr) only(hr) latest(hr) mean(hr) median(hr) mode(hr)
  • ranks: hr_percentile
  • accumulates: as_of(hr)
  • can be a benchmark
FanGraphs · baseballr
bb lower is better BB integer
measure

Walks he issued. MLB.com

What it takes
  • folds: sum(bb) avg(bb) min(bb) max(bb) count(bb) distinct(bb) only(bb) latest(bb) mean(bb) median(bb) mode(bb)
  • ranks: bb_percentile
  • accumulates: as_of(bb)
  • can be a benchmark
FanGraphs · baseballr
hbp lower is better HBP integer
measure

Batters he hit. MLB.com

What it takes
  • folds: sum(hbp) avg(hbp) min(hbp) max(hbp) count(hbp) distinct(hbp) only(hbp) latest(hbp) mean(hbp) median(hbp) mode(hbp)
  • ranks: hbp_percentile
  • accumulates: as_of(hbp)
  • can be a benchmark
FanGraphs · baseballr
k SO integer
measure

Strikeouts recorded. MLB.com

What it takes
  • folds: sum(k) avg(k) min(k) max(k) count(k) distinct(k) only(k) latest(k) mean(k) median(k) mode(k)
  • ranks: k_percentile
  • accumulates: as_of(k)
  • can be a benchmark
FanGraphs · baseballr
saves SV integer
measure

Saves. MLB.com

What it takes
  • folds: sum(saves) avg(saves) min(saves) max(saves) count(saves) distinct(saves) only(saves) latest(saves) mean(saves) median(saves) mode(saves)
  • ranks: saves_percentile
  • accumulates: as_of(saves)
  • can be a benchmark
FanGraphs · baseballr
holds HLD integer
measure

Holds — a lead handed on intact by a reliever who was not the closer. MLB.com

What it takes
  • folds: sum(holds) avg(holds) min(holds) max(holds) count(holds) distinct(holds) only(holds) latest(holds) mean(holds) median(holds) mode(holds)
  • ranks: holds_percentile
  • accumulates: as_of(holds)
  • can be a benchmark
FanGraphs · baseballr
blown_saves lower is better BS integer
measure

Save chances he gave away. MLB.com

What it takes
  • folds: sum(blown_saves) avg(blown_saves) min(blown_saves) max(blown_saves) count(blown_saves) distinct(blown_saves) only(blown_saves) latest(blown_saves) mean(blown_saves) median(blown_saves) mode(blown_saves)
  • ranks: blown_saves_percentile
  • accumulates: as_of(blown_saves)
  • can be a benchmark
FanGraphs · baseballr
fip lower is better FIP number
measure

Fielding independent pitching: what the ERA would be if only strikeouts, walks and home runs counted, put on the ERA scale. MLB.com

FanGraphs' own, including the season constant — nothing here recomputes it

What it takes
  • folds: sum(fip) avg(fip) min(fip) max(fip) count(fip) distinct(fip) only(fip) latest(fip) mean(fip) median(fip) mode(fip)
  • ranks: fip_percentile
  • accumulates: as_of(fip)
  • can be a benchmark
FanGraphs · baseballr
xfip lower is better xFIP number
measure

FIP with his home-run rate replaced by the league's, on the theory that a pitcher controls fly balls but not which ones leave. MLB.com

What it takes
  • folds: sum(xfip) avg(xfip) min(xfip) max(xfip) count(xfip) distinct(xfip) only(xfip) latest(xfip) mean(xfip) median(xfip) mode(xfip)
  • ranks: xfip_percentile
  • accumulates: as_of(xfip)
  • can be a benchmark
FanGraphs · baseballr
era lower is better ERA number
measure

Earned run average — earned runs per nine innings, the number a pitcher is quoted by. MLB.com

What it takes
  • folds: sum(era) avg(era) min(era) max(era) count(era) distinct(era) only(era) latest(era) mean(era) median(era) mode(era)
  • ranks: era_percentile
  • accumulates: as_of(era)
  • can be a benchmark
FanGraphs · baseballr
ra_9 lower is better RA/9 number
measure

Runs allowed per nine innings, earned or not — ERA with the scorer's judgement taken out. MLB.com

What it takes
  • folds: sum(ra_9) avg(ra_9) min(ra_9) max(ra_9) count(ra_9) distinct(ra_9) only(ra_9) latest(ra_9) mean(ra_9) median(ra_9) mode(ra_9)
  • ranks: ra_9_percentile
  • accumulates: as_of(ra_9)
  • can be a benchmark
FanGraphs · baseballr
whip lower is better WHIP number
measure

Walks and hits per inning pitched — how many runners the pitching put on. MLB.com

What it takes
  • folds: sum(whip) avg(whip) min(whip) max(whip) count(whip) distinct(whip) only(whip) latest(whip) mean(whip) median(whip) mode(whip)
  • ranks: whip_percentile
  • accumulates: as_of(whip)
  • can be a benchmark
FanGraphs · baseballr
k_9 K/9 number
measure

Strikeouts per nine innings. MLB.com

What it takes
  • folds: sum(k_9) avg(k_9) min(k_9) max(k_9) count(k_9) distinct(k_9) only(k_9) latest(k_9) mean(k_9) median(k_9) mode(k_9)
  • ranks: k_9_percentile
  • accumulates: as_of(k_9)
  • can be a benchmark
FanGraphs · baseballr
bb_9 lower is better BB/9 number
measure

Walks per nine innings. MLB.com

What it takes
  • folds: sum(bb_9) avg(bb_9) min(bb_9) max(bb_9) count(bb_9) distinct(bb_9) only(bb_9) latest(bb_9) mean(bb_9) median(bb_9) mode(bb_9)
  • ranks: bb_9_percentile
  • accumulates: as_of(bb_9)
  • can be a benchmark
FanGraphs · baseballr
hr_9 lower is better HR/9 number
measure

Home runs allowed per nine innings. MLB.com

What it takes
  • folds: sum(hr_9) avg(hr_9) min(hr_9) max(hr_9) count(hr_9) distinct(hr_9) only(hr_9) latest(hr_9) mean(hr_9) median(hr_9) mode(hr_9)
  • ranks: hr_9_percentile
  • accumulates: as_of(hr_9)
  • can be a benchmark
FanGraphs · baseballr
k_pct K% number
measure

Share of the batters he faced that he struck out.

What it takes
  • folds: sum(k_pct) avg(k_pct) min(k_pct) max(k_pct) count(k_pct) distinct(k_pct) only(k_pct) latest(k_pct) mean(k_pct) median(k_pct) mode(k_pct)
  • ranks: k_pct_percentile
  • accumulates: as_of(k_pct)
  • can be a benchmark
FanGraphs · baseballr
bb_pct lower is better BB% number
measure

Share of the batters he faced that he walked.

What it takes
  • folds: sum(bb_pct) avg(bb_pct) min(bb_pct) max(bb_pct) count(bb_pct) distinct(bb_pct) only(bb_pct) latest(bb_pct) mean(bb_pct) median(bb_pct) mode(bb_pct)
  • ranks: bb_pct_percentile
  • accumulates: as_of(bb_pct)
  • can be a benchmark
FanGraphs · baseballr
blown_save_pct lower is better BS% number
measure

Share of his save chances he gave away. MLB.com

Share of save opportunities blown — a save opportunity is a save or a blown one

What it takes
  • folds: sum(blown_save_pct) avg(blown_save_pct) min(blown_save_pct) max(blown_save_pct) count(blown_save_pct) distinct(blown_save_pct) only(blown_save_pct) latest(blown_save_pct) mean(blown_save_pct) median(blown_save_pct) mode(blown_save_pct)
  • ranks: blown_save_pct_percentile
  • accumulates: as_of(blown_save_pct)
  • can be a benchmark
FanGraphs · baseballr
wpa WPA number
measure

Win probability added — how much his work moved his club's chance of winning. MLB.com

Win Probability Added — wins, summed over every plate appearance faced

What it takes
  • folds: sum(wpa) avg(wpa) min(wpa) max(wpa) count(wpa) distinct(wpa) only(wpa) latest(wpa) mean(wpa) median(wpa) mode(wpa)
  • ranks: wpa_percentile
  • accumulates: as_of(wpa)
  • can be a benchmark
FanGraphs · baseballr
wpa_plus +WPA number
measure

The win probability he added, before counting any he gave back. FanGraphs

What it takes
  • folds: sum(wpa_plus) avg(wpa_plus) min(wpa_plus) max(wpa_plus) count(wpa_plus) distinct(wpa_plus) only(wpa_plus) latest(wpa_plus) mean(wpa_plus) median(wpa_plus) mode(wpa_plus)
  • ranks: wpa_plus_percentile
  • accumulates: as_of(wpa_plus)
  • can be a benchmark
FanGraphs · baseballr
wpa_minus -WPA number
measure

The win probability he gave back. FanGraphs

What it takes
  • folds: sum(wpa_minus) avg(wpa_minus) min(wpa_minus) max(wpa_minus) count(wpa_minus) distinct(wpa_minus) only(wpa_minus) latest(wpa_minus) mean(wpa_minus) median(wpa_minus) mode(wpa_minus)
  • ranks: wpa_minus_percentile
  • accumulates: as_of(wpa_minus)
  • can be a benchmark
FanGraphs · baseballr
re24 RE24 number
measure

Runs saved against run expectancy: the base-out situation he inherited, less the one he left. The run-scale companion to WPA. FanGraphs

What it takes
  • folds: sum(re24) avg(re24) min(re24) max(re24) count(re24) distinct(re24) only(re24) latest(re24) mean(re24) median(re24) mode(re24)
  • ranks: re24_percentile
  • accumulates: as_of(re24)
  • can be a benchmark
FanGraphs · baseballr
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs · baseballr
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs · baseballr
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.player_pitching_days
select game_date, player, team, ip, era, fip, wpa
order by game_date desc
limit 200

select

The columns the answer carries

from mlb.player_pitching_days
select game_date, player, team, ip, era, fip, wpa
order by game_date desc
limit 200

as

Renames a column's heading and nothing else

from mlb.player_pitching_days
select game_date, player, ip as IP
order by ip desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.player_pitching_days
where season = $year
select game_date, player, team
order by ip desc
limit 10

limit

How many rows come back

from mlb.player_pitching_days
select game_date, player, team, ip, era, fip, wpa
order by game_date desc
limit 200

order by

Which end of the answer comes first

from mlb.player_pitching_days
select game_date, player, team, ip
order by ip desc
limit 10

#

A comment, to the end of the line

# Pitcher days — One row per pitcher per date — FIP, xFIP and WPA at whatever window you fold to.
from mlb.player_pitching_days
select game_date, player, team, ip, era, fip, wpa
order by game_date desc
limit 200

where

Chooses the rows the question is about

from mlb.player_pitching_days
where season = 2026
select player, ip
order by ip desc
limit 10

and

Continues whichever filter clause came last

from mlb.player_pitching_days
where season = 2026 and ip > 0
select player, ip
order by ip desc
limit 10

having

Filters the groups a fold made

from mlb.player_pitching_days
select player, sum(ip)
group by player
having sum(ip) > 0
order by sum(ip) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.player_pitching_days
where season = 2026
select player, ip, ip_percentile
keep ip_percentile >= 90
order by ip_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.player_pitching_days
select player, season, ip
highlight season = 2026
order by ip desc
limit 10

of

A threshold that is another row rather than a number

from mlb.player_pitching_days
where ip >= max(ip) of season 2026
select player, ip
order by ip desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.player_pitching_days
select player, count(*), sum(ip)
group by player
order by sum(ip) desc
limit 10

then

Folds the answer a second time

from mlb.player_pitching_days
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 by

Reads the answer as a matrix

from mlb.player_pitching_days
select player, team, sum(ip)
group by player, team
pivot by team
limit 25

first / last

Only part of each career, before anything else runs

from mlb.player_pitching_days
first 3 game_dates
select player, sum(ip)
group by player
order by sum(ip) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.player_pitching_days
select player, sum(ip)
group by player
order by sum(ip) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.player_pitching_days
select player, avg(ip)
group by player
order by avg(ip) desc
limit 10

min(…)

The smallest value in each group

from mlb.player_pitching_days
select player, min(ip)
group by player
order by min(ip) desc
limit 10

max(…)

The largest value in each group

from mlb.player_pitching_days
select player, max(ip)
group by player
order by max(ip) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.player_pitching_days
select player, count(ip)
group by player
order by count(ip) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.player_pitching_days
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 mlb.player_pitching_days
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 mlb.player_pitching_days
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 mlb.player_pitching_days
select player, mean(ip)
group by player
order by mean(ip) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.player_pitching_days
select player, median(ip)
group by player
order by median(ip) desc
limit 10

mode(…)

The commonest value in the group

from mlb.player_pitching_days
select player, mode(player)
group by player
order by count(*) desc
limit 10

year(…)

Reads a date as the year it falls in

from mlb.player_pitching_days
select player, year(game_date), sum(ip)
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 mlb.player_pitching_days
select player, quarter(game_date), sum(ip)
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 mlb.player_pitching_days
select player, month(game_date), sum(ip)
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 mlb.player_pitching_days
select player, week(game_date), sum(ip)
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 mlb.player_pitching_days
where season = 2026
select player, month(game_date), as_of(ip)
group by player, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.player_pitching_days
where season = 2026
select player, ip, ip_percentile
order by ip_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.player_pitching_days
select player, sum(ip), percentile(sum(ip))
group by player
order by sum(ip) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.player_pitching_days
where season = 2026
select player, ip, standing(ip)
order by ip desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.player_pitching_days
where season = 2026
select player, games, starts, composite(games, starts)
order by composite(games, starts) desc
limit 10

ratio(…)

One column divided by another

from mlb.player_pitching_days
select player, count(*), ratio(sum(ip), count(*))
group by player
order by ratio(sum(ip), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.player_pitching_days
where season = 2026
select player, games, starts, calc(standing(games) - standing(starts))
order by calc(standing(games) - standing(starts)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.player_pitching_days
select player, ip, format(ip, > 0 -> "on the board", <= 0 -> "nothing yet")
order by ip desc
limit 10

pair

Draws two columns of the answer in one

from mlb.player_pitching_days
where season = 2026
select player, ip, ip_percentile
pair ip with ip_percentile
order by ip desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.player_pitching_days
where season = 2026
select player, games, starts, ip, composite(games, starts, ip) as Score
hint composite(games, starts, ip) as "G + GS + IP"
order by composite(games, starts, ip) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.arbitration Arbitration salaries

One row per player per arbitration season, from Spotrac team payroll pages. A season split across clubs by a trade is summed back into one row.

from mlb.arbitration
select player, season, arb_year, salary
order by salary desc
limit 100
One row is
one player's season (player-season)
Built from
one table, read straight
Reads
mlb_arbitration_seasons Spotrac, topspin
Shows by default
player season arb_year salary
Ordered by
salary desc
Rows
100 by default, 5000 at most
Ranks within
season arb_year
Careers counted in
seasons arb_years
Biggest row
salary

Applied unless you say otherwise

  • Excluded arb years bought out by an earlier extension — that salary was negotiated, not arbitrated. Add where is_arb_bypassed = true to include them.

Before you trust the numbers

  • Spotrac's arb-tier labels are only reliable from 2011 — earlier seasons carry no tier and are not in this dataset at all.
Dimensions 5
NameBound to
league always mlb
team An arbitration salary is summed across the clubs that paid it, so it has no single team
player the player column
position The Spotrac payroll line carries a position but the summed view does not — query mlb.fielders or mlb.pitchers for that
season the season column
Columns 9
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) top(season) mode(season)
  • can be a benchmark
Spotrac · topspin
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) top(player) mode(player)
Spotrac · topspin
arb_year Arb integer
dimension

Which trip through salary arbitration this season was.

Arbitration tier: 1, 2 or 3 — and 4, which only a Super Two reaches

What it takes
  • folds: sum(arb_year) avg(arb_year) min(arb_year) max(arb_year) count(arb_year) distinct(arb_year) only(arb_year) latest(arb_year) top(arb_year) mean(arb_year) median(arb_year) mode(arb_year)
  • can be a benchmark
Spotrac · topspin
salary Salary integer
measure

Dollars he was paid that season.

Dollars earned that season, summed across clubs if he was traded

Null on a handful of older rows that carry a tier but no figure

What it takes
  • folds: sum(salary) avg(salary) min(salary) max(salary) count(salary) distinct(salary) only(salary) latest(salary) top(salary) mean(salary) median(salary) mode(salary)
  • ranks: salary_percentile
  • accumulates: as_of(salary)
  • can be a benchmark
Spotrac · topspin
is_super_two Super Two boolean
dimension

Whether he qualified for arbitration a year early on service time, which is how a fourth trip exists.

What it takes
  • folds: count(is_super_two) distinct(is_super_two) only(is_super_two) latest(is_super_two) top(is_super_two) mode(is_super_two)
Spotrac · topspin
is_arb_bypassed Bypassed boolean
dimension

Whether an extension had already bought out this arbitration year.

The tier was bought out by an earlier extension, so the figure is extension money

What it takes
  • folds: count(is_arb_bypassed) distinct(is_arb_bypassed) only(is_arb_bypassed) latest(is_arb_bypassed) top(is_arb_bypassed) mode(is_arb_bypassed)
Spotrac · topspin
traded_midseason Traded boolean
dimension

Whether the season's salary was split across more than one club.

Salary was split across two clubs and re-summed here

What it takes
  • folds: count(traded_midseason) distinct(traded_midseason) only(traded_midseason) latest(traded_midseason) top(traded_midseason) mode(traded_midseason)
Spotrac · topspin
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

Spotrac · topspin
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

Spotrac · topspin
Operators on this table 35 available, 8 not

from

The one table a query reads

from mlb.arbitration
select player, season, arb_year, salary
order by salary desc
limit 100

select

The columns the answer carries

from mlb.arbitration
select player, season, arb_year, salary
order by salary desc
limit 100

as

Renames a column's heading and nothing else

from mlb.arbitration
select player, season, salary as Salary
order by salary desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.arbitration
where season = $year
select player, season, arb_year
order by salary desc
limit 10

limit

How many rows come back

from mlb.arbitration
select player, season, arb_year, salary
order by salary desc
limit 100

order by

Which end of the answer comes first

from mlb.arbitration
select player, season, arb_year, salary
order by salary desc
limit 10

#

A comment, to the end of the line

# Arbitration salaries — One row per player per arbitration season, from Spotrac team payroll pages. A season split across clubs by a trade is summed back into one row.
from mlb.arbitration
select player, season, arb_year, salary
order by salary desc
limit 100

where

Chooses the rows the question is about

from mlb.arbitration
where season = 2026
select player, salary
order by salary desc
limit 10

and

Continues whichever filter clause came last

from mlb.arbitration
where season = 2026 and salary > 0
select player, salary
order by salary desc
limit 10

having

Filters the groups a fold made

from mlb.arbitration
select player, sum(salary)
group by player
having sum(salary) > 0
order by sum(salary) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.arbitration
where season = 2026 and arb_year = 1
select player, salary, salary_percentile
keep salary_percentile >= 90
order by salary_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.arbitration
select player, season, salary
highlight season = 2026
order by salary desc
limit 10

of

A threshold that is another row rather than a number

from mlb.arbitration
where salary >= max(salary) of season 2026
select player, salary
order by salary desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.arbitration
select player, count(*), sum(salary)
group by player
order by sum(salary) desc
limit 10

then

Folds the answer a second time

from mlb.arbitration
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 by

Reads the answer as a matrix

from mlb.arbitration
select player, season, sum(salary)
group by player, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.arbitration
first 3 seasons
select player, sum(salary)
group by player
order by sum(salary) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.arbitration
select player, sum(salary)
group by player
order by sum(salary) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.arbitration
select player, avg(salary)
group by player
order by avg(salary) desc
limit 10

min(…)

The smallest value in each group

from mlb.arbitration
select player, min(salary)
group by player
order by min(salary) desc
limit 10

max(…)

The largest value in each group

from mlb.arbitration
select player, max(salary)
group by player
order by max(salary) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.arbitration
select player, count(salary)
group by player
order by count(salary) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.arbitration
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 mlb.arbitration
where season = 2026 and arb_year = 1
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 mlb.arbitration
select player, latest(player)
group by player
order by count(*) desc
limit 10

top(…)

The value on the group's biggest row

from mlb.arbitration
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 mlb.arbitration
select player, mean(salary)
group by player
order by mean(salary) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.arbitration
select player, median(salary)
group by player
order by median(salary) desc
limit 10

mode(…)

The commonest value in the group

from mlb.arbitration
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.arbitration
where season = 2026 and arb_year = 1
select player, salary, salary_percentile
order by salary_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.arbitration
select player, sum(salary), percentile(sum(salary))
group by player
order by sum(salary) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.arbitration
where season = 2026 and arb_year = 1
select player, salary, standing(salary)
order by salary desc
limit 10

ratio(…)

One column divided by another

from mlb.arbitration
select player, count(*), ratio(sum(salary), count(*))
group by player
order by ratio(sum(salary), count(*)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.arbitration
select player, salary, format(salary, > 0 -> "on the board", <= 0 -> "nothing yet")
order by salary desc
limit 10

pair

Draws two columns of the answer in one

from mlb.arbitration
where season = 2026 and arb_year = 1
select player, salary, salary_percentile
pair salary with salary_percentile
order by salary desc
limit 10

Not on this table

  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along
  • composite(…) — a score needs two stats this table can rank, and it has fewer
  • calc(…) — this table has fewer than two numbers to do arithmetic between
  • hint — the example hints a score, and this table has fewer than two stats to score

mlb.payroll Payroll

One row per player per club per season, from Spotrac team payroll pages. A player traded mid-season is two rows, one under each club that paid him.

from mlb.payroll
select player, team, season, status, salary
order by salary desc
limit 100
One row is
one player's season (player-season)
Built from
one table, read straight
Reads
mlb_player_payroll Spotrac, topspin
Shows by default
player team season status salary
Ordered by
salary desc
Rows
100 by default, 5000 at most
Ranks within
season
Careers counted in
seasons arb_years

Before you trust the numbers

  • Spotrac's payroll pages, 2011 on — the first season its arbitration labels are reliable.
  • A player traded mid-season appears once under each club, charged for his days there, which is what makes a club's total reconcile to Spotrac's. Fold to one row per player with group by player if you want his year.
  • Roughly a tenth of the rows are players with no career line anywhere else — the payroll pages carry minor-leaguers. They are kept because a club paid them, so dropping them would understate every total.
  • Club codes are the Stats API's — KC, SD, SF, TB, WSH, CWS — not FanGraphs' KCR, SDP, SFG, TBR, WSN, CHW.
  • A finished season is read once after it ends and then left alone; the live season is re-read weekly, so it is as of its last read rather than as of today.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position the position column
season the season column
Columns 13
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

Season starts in 2011

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
Spotrac · topspin
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
Spotrac · topspin
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) mode(team)
Spotrac · topspin
position Pos string
dimension

The fielding position, by its scorer's name. MLB.com

The position Spotrac lists him at on the payroll page

What it takes
  • folds: count(position) distinct(position) only(position) latest(position) mode(position)
Spotrac · topspin
status Status string
dimension

Spotrac's own label for how a player is paid this season — Veteran, Pre-Arbitration, Arbitration 1, and so on.

Spotrac's own label — Veteran, Pre-Arbitration, Arbitration 1, and so on

What it takes
  • folds: count(status) distinct(status) only(status) latest(status) mode(status)
Spotrac · topspin
salary Salary integer
measure

Dollars he was paid that season.

What the club was charged for his days on its books this season, which is the figure its payroll total is built from

Prorated to the days he was on the club, so a traded player's season is split between his clubs, and 2020 is the 60 games that were paid. The live season is read weekly, so it is a payroll as of the last read rather than a final one. Null where the club was charged nothing toward its payroll, as for a minor-leaguer on a minor-league wage

Salary starts in 2011

What it takes
  • folds: sum(salary) avg(salary) min(salary) max(salary) count(salary) distinct(salary) only(salary) latest(salary) mean(salary) median(salary) mode(salary)
  • ranks: salary_percentile
  • accumulates: as_of(salary)
  • can be a benchmark
Spotrac · topspin
base_salary Base integer
measure

The salary written into the contract, which differs from what the club is charged wherever money was deferred or another club ate some of it.

The contract's own figure, which differs from the charge wherever money was deferred or eaten

Base starts in 2011

What it takes
  • folds: sum(base_salary) avg(base_salary) min(base_salary) max(base_salary) count(base_salary) distinct(base_salary) only(base_salary) latest(base_salary) mean(base_salary) median(base_salary) mode(base_salary)
  • ranks: base_salary_percentile
  • accumulates: as_of(base_salary)
  • can be a benchmark
Spotrac · topspin
signing_bonus Bonus integer
measure

The bonus paid to sign the contract, spread across its years rather than charged to one.

Bonus starts in 2011

What it takes
  • folds: sum(signing_bonus) avg(signing_bonus) min(signing_bonus) max(signing_bonus) count(signing_bonus) distinct(signing_bonus) only(signing_bonus) latest(signing_bonus) mean(signing_bonus) median(signing_bonus) mode(signing_bonus)
  • ranks: signing_bonus_percentile
  • accumulates: as_of(signing_bonus)
  • can be a benchmark
Spotrac · topspin
service_time Service number
measure

Years of major-league service. Six of them is free agency, and the fractions are what arbitration eligibility turns on. MLB.com

Years of major-league service, as Spotrac counts them

Service starts in 2011

What it takes
  • folds: sum(service_time) avg(service_time) min(service_time) max(service_time) count(service_time) distinct(service_time) only(service_time) latest(service_time) mean(service_time) median(service_time) mode(service_time)
  • ranks: service_time_percentile
  • accumulates: as_of(service_time)
  • can be a benchmark
Spotrac · topspin
arb_year Arb integer
dimension

Which trip through salary arbitration this season was.

Arbitration tier where he is in one, and null where he is not

What it takes
  • folds: sum(arb_year) avg(arb_year) min(arb_year) max(arb_year) count(arb_year) distinct(arb_year) only(arb_year) latest(arb_year) mean(arb_year) median(arb_year) mode(arb_year)
  • can be a benchmark
Spotrac · topspin
is_pre_arb Pre-arb boolean
dimension

Whether he is still on a club-set salary, having not yet reached arbitration.

What it takes
  • folds: count(is_pre_arb) distinct(is_pre_arb) only(is_pre_arb) latest(is_pre_arb) mode(is_pre_arb)
Spotrac · topspin
is_super_two Super Two boolean
dimension

Whether he qualified for arbitration a year early on service time, which is how a fourth trip exists.

What it takes
  • folds: count(is_super_two) distinct(is_super_two) only(is_super_two) latest(is_super_two) mode(is_super_two)
Spotrac · topspin
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

Spotrac · topspin
Operators on this table 37 available, 6 not

from

The one table a query reads

from mlb.payroll
select player, team, season, status, salary
order by salary desc
limit 100

select

The columns the answer carries

from mlb.payroll
select player, team, season, status, salary
order by salary desc
limit 100

as

Renames a column's heading and nothing else

from mlb.payroll
select player, team, salary as Salary
order by salary desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.payroll
where season = $year
select player, team, season
order by salary desc
limit 10

limit

How many rows come back

from mlb.payroll
select player, team, season, status, salary
order by salary desc
limit 100

order by

Which end of the answer comes first

from mlb.payroll
select player, team, season, salary
order by salary desc
limit 10

#

A comment, to the end of the line

# Payroll — One row per player per club per season, from Spotrac team payroll pages. A player traded mid-season is two rows, one under each club that paid him.
from mlb.payroll
select player, team, season, status, salary
order by salary desc
limit 100

where

Chooses the rows the question is about

from mlb.payroll
where season = 2026
select player, salary
order by salary desc
limit 10

and

Continues whichever filter clause came last

from mlb.payroll
where season = 2026 and salary > 0
select player, salary
order by salary desc
limit 10

having

Filters the groups a fold made

from mlb.payroll
select player, sum(salary)
group by player
having sum(salary) > 0
order by sum(salary) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.payroll
where season = 2026
select player, salary, salary_percentile
keep salary_percentile >= 90
order by salary_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.payroll
select player, season, salary
highlight season = 2026
order by salary desc
limit 10

of

A threshold that is another row rather than a number

from mlb.payroll
where salary >= max(salary) of season 2026
select player, salary
order by salary desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.payroll
select player, count(*), sum(salary)
group by player
order by sum(salary) desc
limit 10

then

Folds the answer a second time

from mlb.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 by

Reads the answer as a matrix

from mlb.payroll
select player, season, sum(salary)
group by player, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.payroll
first 3 seasons
select player, sum(salary)
group by player
order by sum(salary) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.payroll
select player, sum(salary)
group by player
order by sum(salary) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.payroll
select player, avg(salary)
group by player
order by avg(salary) desc
limit 10

min(…)

The smallest value in each group

from mlb.payroll
select player, min(salary)
group by player
order by min(salary) desc
limit 10

max(…)

The largest value in each group

from mlb.payroll
select player, max(salary)
group by player
order by max(salary) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.payroll
select player, count(salary)
group by player
order by count(salary) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.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 mlb.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 mlb.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 mlb.payroll
select player, mean(salary)
group by player
order by mean(salary) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.payroll
select player, median(salary)
group by player
order by median(salary) desc
limit 10

mode(…)

The commonest value in the group

from mlb.payroll
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.payroll
where season = 2026
select player, salary, salary_percentile
order by salary_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.payroll
select player, sum(salary), percentile(sum(salary))
group by player
order by sum(salary) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.payroll
where season = 2026
select player, salary, standing(salary)
order by salary desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.payroll
where season = 2026
select player, salary, base_salary, composite(salary, base_salary)
order by composite(salary, base_salary) desc
limit 10

ratio(…)

One column divided by another

from mlb.payroll
select player, count(*), ratio(sum(salary), count(*))
group by player
order by ratio(sum(salary), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.payroll
where season = 2026
select player, salary, base_salary, calc(standing(salary) - standing(base_salary))
order by calc(standing(salary) - standing(base_salary)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.payroll
select player, salary, format(salary, > 0 -> "on the board", <= 0 -> "nothing yet")
order by salary desc
limit 10

pair

Draws two columns of the answer in one

from mlb.payroll
where season = 2026
select player, salary, salary_percentile
pair salary with salary_percentile
order by salary desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.payroll
where season = 2026
select player, salary, base_salary, signing_bonus, composite(salary, base_salary, signing_bonus) as Score
hint composite(salary, base_salary, signing_bonus) as "Salary + Base + Bonus"
order by composite(salary, base_salary, signing_bonus) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick
  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.command Command

One row per pitcher per pitch type per season: how far his median pitch missed the target it was thrown at, in inches.

from mlb.command
select player, team, pitches, miss
order by miss asc
limit 100
One row is
one player's season (player-season)
Built from
one table, read straight
Reads
mlb_pitcher_command_seasons OpenCommand, topspin
Shows by default
player team pitches miss
Ordered by
miss asc
Rows
100 by default, 5000 at most
Ranks within
season pitch_type
Careers counted in
seasons
Biggest row
pitches

Applied unless you say otherwise

  • Showing each pitcher's whole season. Name pitch_type — in a select, a group or a filter — to break it out by pitch.

Before you trust the numbers

  • 2024 on. OpenCommand has published three seasons and there is no earlier data to backfill.
  • Median rather than mean, because a miss has no left tail and a long right one — one bad glove detection would otherwise cost a hundred good pitches.
  • Regular season only, like every other season board here. OpenCommand's published leaderboard counts every game type, so a number here can sit slightly off theirs.
  • Rows are per pitch type, and pitch_type = "ALL" is his whole season — a median of its own, not the average of the rows beside it. A query that does not mention pitch type gets the ALL rows.
  • The target is inferred and assumes a pitcher is calibrated on each of his pitch types. Believable to about an inch across a season; not believable about a single pitch.
  • OpenCommand is published under CC BY-NC-SA 4.0 — cite it, and do not sell what you build on it.
Dimensions 5
NameBound to
league always mlb
team the team column
player the player column
position Command is measured per pitch type, which is the split that means something here — query mlb.pitchers for SP/RP
season the season column
Columns 10
NameHeadingTypeWhat it is
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) top(season) mode(season)
  • can be a benchmark
OpenCommand · topspin
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) top(player) mode(player)
OpenCommand · topspin
team completes team Team string
dimension

The club.

From his FanGraphs season line, so null when the season was split across clubs

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) top(team) mode(team)
OpenCommand · topspin
throws Throws string
dimension

Which hand he throws with.

R or L, from dim_player — the same hand every other dataset means by it

What it takes
  • folds: count(throws) distinct(throws) only(throws) latest(throws) top(throws) mode(throws)
OpenCommand · topspin
pitch_type completes pitch_type Pitch string
dimension

Which pitch it was, by Statcast's two-letter code — FF four-seam, SI sinker, SL slider, CH changeup. MLB.com

Statcast's two-letter code — FF, SI, SL, CH. ALL is the pitcher's whole season, which is a median in its own right rather than an average of the rows beside it

What it takes
  • folds: count(pitch_type) distinct(pitch_type) only(pitch_type) latest(pitch_type) top(pitch_type) mode(pitch_type)
OpenCommand · topspin
pitches Pitches integer
measure

How many of his pitches had a target solved for them — the sample the medians beside it are taken over.

Scored pitches behind the median — about 90% of the ones he threw

What it takes
  • folds: sum(pitches) avg(pitches) min(pitches) max(pitches) count(pitches) distinct(pitches) only(pitches) latest(pitches) top(pitches) mean(pitches) median(pitches) mode(pitches)
  • ranks: pitches_percentile
  • accumulates: as_of(pitches)
  • can be a benchmark
OpenCommand · topspin
miss lower is better Miss number
measure

Median inches between where a pitch was aimed and where it crossed the plate. The target is inferred from the catcher's glove and the pitcher's own relationship to it; lower is better command.

Median inches from the inferred target. The headline number, and the one OpenCommand's own leaderboard is ordered by

Median of a season, not a number that means anything about one pitch

Miss starts in 2024

What it takes
  • folds: sum(miss) avg(miss) min(miss) max(miss) count(miss) distinct(miss) only(miss) latest(miss) top(miss) mean(miss) median(miss) mode(miss)
  • ranks: miss_percentile
  • accumulates: as_of(miss)
  • can be a benchmark
OpenCommand · topspin
glove_miss lower is better Glove miss number
measure

The same distance measured to the catcher's glove itself, with no model in between — larger than miss for every pitcher who deliberately aims off the glove.

Median inches from the catcher's glove itself, with no model between them — the raw version of miss, and larger for every pitcher who aims off the glove

Glove miss starts in 2024

What it takes
  • folds: sum(glove_miss) avg(glove_miss) min(glove_miss) max(glove_miss) count(glove_miss) distinct(glove_miss) only(glove_miss) latest(glove_miss) top(glove_miss) mean(glove_miss) median(glove_miss) mode(glove_miss)
  • ranks: glove_miss_percentile
  • accumulates: as_of(glove_miss)
  • can be a benchmark
OpenCommand · topspin
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

OpenCommand · topspin
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

OpenCommand · topspin
Operators on this table 38 available, 5 not

from

The one table a query reads

from mlb.command
select player, team, pitches, miss
order by miss asc
limit 100

select

The columns the answer carries

from mlb.command
select player, team, pitches, miss
order by miss asc
limit 100

as

Renames a column's heading and nothing else

from mlb.command
select player, team, pitches as Pitches
order by pitches desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.command
where season = $year
select player, team, pitches
order by pitches desc
limit 10

limit

How many rows come back

from mlb.command
select player, team, pitches, miss
order by miss asc
limit 100

order by

Which end of the answer comes first

from mlb.command
select player, team, pitches
order by pitches desc
limit 10

#

A comment, to the end of the line

# Command — One row per pitcher per pitch type per season: how far his median pitch missed the target it was thrown at, in inches.
from mlb.command
select player, team, pitches, miss
order by miss asc
limit 100

where

Chooses the rows the question is about

from mlb.command
where season = 2026
select player, pitches
order by pitches desc
limit 10

and

Continues whichever filter clause came last

from mlb.command
where season = 2026 and pitches > 0
select player, pitches
order by pitches desc
limit 10

having

Filters the groups a fold made

from mlb.command
select player, sum(pitches)
group by player
having sum(pitches) > 0
order by sum(pitches) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, pitches_percentile
keep pitches_percentile >= 90
order by pitches_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.command
select player, season, pitches
highlight season = 2026
order by pitches desc
limit 10

of

A threshold that is another row rather than a number

from mlb.command
where pitches >= max(pitches) of season 2026
select player, pitches
order by pitches desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.command
select player, count(*), sum(pitches)
group by player
order by sum(pitches) desc
limit 10

then

Folds the answer a second time

from mlb.command
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 by

Reads the answer as a matrix

from mlb.command
select player, team, sum(pitches)
group by player, team
pivot by team
limit 25

first / last

Only part of each career, before anything else runs

from mlb.command
first 3 seasons
select player, sum(pitches)
group by player
order by sum(pitches) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.command
select player, sum(pitches)
group by player
order by sum(pitches) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.command
select player, avg(pitches)
group by player
order by avg(pitches) desc
limit 10

min(…)

The smallest value in each group

from mlb.command
select player, min(pitches)
group by player
order by min(pitches) desc
limit 10

max(…)

The largest value in each group

from mlb.command
select player, max(pitches)
group by player
order by max(pitches) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.command
select player, count(pitches)
group by player
order by count(pitches) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.command
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 mlb.command
where season = 2026 and pitch_type = "ALL"
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 mlb.command
select player, latest(player)
group by player
order by count(*) desc
limit 10

top(…)

The value on the group's biggest row

from mlb.command
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 mlb.command
select player, mean(pitches)
group by player
order by mean(pitches) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.command
select player, median(pitches)
group by player
order by median(pitches) desc
limit 10

mode(…)

The commonest value in the group

from mlb.command
select player, mode(player)
group by player
order by count(*) desc
limit 10

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, pitches_percentile
order by pitches_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.command
select player, sum(pitches), percentile(sum(pitches))
group by player
order by sum(pitches) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, standing(pitches)
order by pitches desc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, miss, composite(pitches, miss)
order by composite(pitches, miss) desc
limit 10

ratio(…)

One column divided by another

from mlb.command
select player, count(*), ratio(sum(pitches), count(*))
group by player
order by ratio(sum(pitches), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, miss, calc(standing(pitches) - standing(miss))
order by calc(standing(pitches) - standing(miss)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.command
select player, pitches, format(pitches, > 0 -> "on the board", <= 0 -> "nothing yet")
order by pitches desc
limit 10

pair

Draws two columns of the answer in one

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, pitches_percentile
pair pitches with pitches_percentile
order by pitches desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.command
where season = 2026 and pitch_type = "ALL"
select player, pitches, miss, glove_miss, composite(pitches, miss, glove_miss) as Score
hint composite(pitches, miss, glove_miss) as "Pitches + Miss + Glove miss"
order by composite(pitches, miss, glove_miss) desc
limit 10

Not on this table

  • year(…) — this table has no date column to read a period off
  • quarter(…) — this table has no date column to read a period off
  • month(…) — this table has no date column to read a period off
  • week(…) — this table has no date column to read a period off
  • as_of(…) — this table has no time axis to accumulate along

mlb.command_pitches Command pitches

One row per scored pitch: where it was aimed, where it crossed, and how far apart those were.

from mlb.command_pitches
select game_date, player, pitch_type, target_x, target_z, plate_x, plate_z, miss
order by game_date desc
limit 500
One row is
one player's pitch (player-pitch)
Built from
one table, read straight
Reads
mlb_command_pitches OpenCommand
Shows by default
game_date player pitch_type target_x target_z plate_x plate_z miss
Ordered by
game_date desc
Rows
500 by default, 20000 at most
Ranks within
season
Careers counted in
game_dates seasons pitchs
Newest row
game_date

Before you trust the numbers

  • 2024 on, and about 90% of the pitches thrown — a clip with no strike zone drawn, no ball release found or a late camera cut has no target and is not here.
  • Inches from the middle of the front of the plate: x is positive toward the catcher's right, z is up from the ground.
  • A single pitch's miss carries the whole error of the inference. Read a shape, or fold a season — mlb.command is the folded version.
  • Every game type, including spring training and October. The season board mlb.command is regular season only.
  • OpenCommand is published under CC BY-NC-SA 4.0 — cite it, and do not sell what you build on it.
Dimensions 5
NameBound to
league always mlb
team OpenCommand records the park a pitch was thrown in, not the club that employed the pitcher — query mlb.command for a season line with a club on it
player the player column
position A pitch has a pitcher and no position — query mlb.pitchers for SP/RP
season the season column
Columns 13
NameHeadingTypeWhat it is
game_date Date date
dimension

The date the game counts for in the standings.

What it takes
  • folds: min(game_date) max(game_date) count(game_date) distinct(game_date) only(game_date) latest(game_date) mode(game_date)
  • periods: year(game_date) quarter(game_date) month(game_date) week(game_date)
  • can be a benchmark
OpenCommand
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) mode(season)
  • can be a benchmark
OpenCommand
player completes player Player string
dimension

The player, by the name FanGraphs lists him under.

What it takes
  • folds: count(player) distinct(player) only(player) latest(player) mode(player)
OpenCommand
throws Throws string
dimension

Which hand he throws with.

R or L, from dim_player — the same hand every other dataset means by it

What it takes
  • folds: count(throws) distinct(throws) only(throws) latest(throws) mode(throws)
OpenCommand
pitch_type completes pitch_type Pitch string
dimension

Which pitch it was, by Statcast's two-letter code — FF four-seam, SI sinker, SL slider, CH changeup. MLB.com

Statcast's two-letter code — FF, SI, SL, CH

What it takes
  • folds: count(pitch_type) distinct(pitch_type) only(pitch_type) latest(pitch_type) mode(pitch_type)
OpenCommand
miss lower is better Miss number
measure

Median inches between where a pitch was aimed and where it crossed the plate. The target is inferred from the catcher's glove and the pitcher's own relationship to it; lower is better command.

Inches from the inferred target to where the pitch crossed

One pitch. The inference is a season-level claim; this is its residual

Miss starts in 2024

What it takes
  • folds: sum(miss) avg(miss) min(miss) max(miss) count(miss) distinct(miss) only(miss) latest(miss) mean(miss) median(miss) mode(miss)
  • ranks: miss_percentile
  • accumulates: as_of(miss)
  • can be a benchmark
OpenCommand
glove_miss lower is better Glove miss number
measure

The same distance measured to the catcher's glove itself, with no model in between — larger than miss for every pitcher who deliberately aims off the glove.

Inches from the catcher's glove itself, with no model between them

Glove miss starts in 2024

What it takes
  • folds: sum(glove_miss) avg(glove_miss) min(glove_miss) max(glove_miss) count(glove_miss) distinct(glove_miss) only(glove_miss) latest(glove_miss) mean(glove_miss) median(glove_miss) mode(glove_miss)
  • ranks: glove_miss_percentile
  • accumulates: as_of(glove_miss)
  • can be a benchmark
OpenCommand
target_x Target x number
measure

How far right of the middle of the plate the pitch was aimed, in inches from the catcher's view.

Inferred target, inches right of the middle of the plate from the catcher's view

Target x starts in 2024

What it takes
  • folds: sum(target_x) avg(target_x) min(target_x) max(target_x) count(target_x) distinct(target_x) only(target_x) latest(target_x) mean(target_x) median(target_x) mode(target_x)
  • ranks: target_x_percentile
  • accumulates: as_of(target_x)
  • can be a benchmark
OpenCommand
target_z Target z number
measure

How high off the ground the pitch was aimed, in inches.

Inferred target, inches above the ground

Target z starts in 2024

What it takes
  • folds: sum(target_z) avg(target_z) min(target_z) max(target_z) count(target_z) distinct(target_z) only(target_z) latest(target_z) mean(target_z) median(target_z) mode(target_z)
  • ranks: target_z_percentile
  • accumulates: as_of(target_z)
  • can be a benchmark
OpenCommand
plate_x Plate x number
measure

How far right of the middle of the plate the pitch actually crossed, in inches.

Where it actually crossed, inches right of the middle of the plate

Plate x starts in 2024

What it takes
  • folds: sum(plate_x) avg(plate_x) min(plate_x) max(plate_x) count(plate_x) distinct(plate_x) only(plate_x) latest(plate_x) mean(plate_x) median(plate_x) mode(plate_x)
  • ranks: plate_x_percentile
  • accumulates: as_of(plate_x)
  • can be a benchmark
OpenCommand
plate_z Plate z number
measure

How high off the ground the pitch actually crossed, in inches.

Where it actually crossed, inches above the ground

Plate z starts in 2024

What it takes
  • folds: sum(plate_z) avg(plate_z) min(plate_z) max(plate_z) count(plate_z) distinct(plate_z) only(plate_z) latest(plate_z) mean(plate_z) median(plate_z) mode(plate_z)
  • ranks: plate_z_percentile
  • accumulates: as_of(plate_z)
  • can be a benchmark
OpenCommand
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

OpenCommand
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

OpenCommand
Operators on this table 42 available, 1 not

from

The one table a query reads

from mlb.command_pitches
select game_date, player, pitch_type, target_x, target_z, plate_x, plate_z, miss
order by game_date desc
limit 500

select

The columns the answer carries

from mlb.command_pitches
select game_date, player, pitch_type, target_x, target_z, plate_x, plate_z, miss
order by game_date desc
limit 500

as

Renames a column's heading and nothing else

from mlb.command_pitches
select game_date, player, miss as Miss
order by miss asc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.command_pitches
where season = $year
select game_date, player, pitch_type
order by miss asc
limit 10

limit

How many rows come back

from mlb.command_pitches
select game_date, player, pitch_type, target_x, target_z, plate_x, plate_z, miss
order by game_date desc
limit 500

order by

Which end of the answer comes first

from mlb.command_pitches
select game_date, player, pitch_type, miss
order by miss asc
limit 10

#

A comment, to the end of the line

# Command pitches — One row per scored pitch: where it was aimed, where it crossed, and how far apart those were.
from mlb.command_pitches
select game_date, player, pitch_type, target_x, target_z, plate_x, plate_z, miss
order by game_date desc
limit 500

where

Chooses the rows the question is about

from mlb.command_pitches
where season = 2026
select player, miss
order by miss asc
limit 10

and

Continues whichever filter clause came last

from mlb.command_pitches
where season = 2026 and miss > 0
select player, miss
order by miss asc
limit 10

having

Filters the groups a fold made

from mlb.command_pitches
select player, sum(miss)
group by player
having sum(miss) > 0
order by sum(miss) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.command_pitches
where season = 2026
select player, miss, miss_percentile
keep miss_percentile >= 90
order by miss_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.command_pitches
select player, season, miss
highlight season = 2026
order by miss asc
limit 10

of

A threshold that is another row rather than a number

from mlb.command_pitches
where miss >= max(miss) of season 2026
select player, miss
order by miss asc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.command_pitches
select player, count(*), sum(miss)
group by player
order by sum(miss) desc
limit 10

then

Folds the answer a second time

from mlb.command_pitches
select player, pitch_type, count(*)
group by player, pitch_type
having count(*) > 10
then
select player, count(*) as Pitchs
group by player
order by count(*) desc
limit 10

pivot by

Reads the answer as a matrix

from mlb.command_pitches
select player, pitch_type, sum(miss)
group by player, pitch_type
pivot by pitch_type
limit 25

first / last

Only part of each career, before anything else runs

from mlb.command_pitches
first 3 game_dates
select player, sum(miss)
group by player
order by sum(miss) desc
limit 10

sum(…)

Adds a stat up across the rows in each group

from mlb.command_pitches
select player, sum(miss)
group by player
order by sum(miss) desc
limit 10

avg(…)

The mean of a stat, with rates rebuilt rather than averaged

from mlb.command_pitches
select player, avg(miss)
group by player
order by avg(miss) desc
limit 10

min(…)

The smallest value in each group

from mlb.command_pitches
select player, min(miss)
group by player
order by min(miss) desc
limit 10

max(…)

The largest value in each group

from mlb.command_pitches
select player, max(miss)
group by player
order by max(miss) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.command_pitches
select player, count(miss)
group by player
order by count(miss) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.command_pitches
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 mlb.command_pitches
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 mlb.command_pitches
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 mlb.command_pitches
select player, mean(miss)
group by player
order by mean(miss) desc
limit 10

median(…)

The middle value in the group — half above it, half below

from mlb.command_pitches
select player, median(miss)
group by player
order by median(miss) desc
limit 10

mode(…)

The commonest value in the group

from mlb.command_pitches
select player, mode(player)
group by player
order by count(*) desc
limit 10

year(…)

Reads a date as the year it falls in

from mlb.command_pitches
select player, year(game_date), sum(miss)
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 mlb.command_pitches
select player, quarter(game_date), sum(miss)
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 mlb.command_pitches
select player, month(game_date), sum(miss)
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 mlb.command_pitches
select player, week(game_date), sum(miss)
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 mlb.command_pitches
where season = 2026
select player, month(game_date), as_of(miss)
group by player, month(game_date)
order by month(game_date) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.command_pitches
where season = 2026
select player, miss, miss_percentile
order by miss_percentile desc
limit 10

percentile(…)

Where a folded group ranks among the other groups

from mlb.command_pitches
select player, sum(miss), percentile(sum(miss))
group by player
order by sum(miss) desc
limit 10

standing(…)

The same window, read as a place — 1 being best

from mlb.command_pitches
where season = 2026
select player, miss, standing(miss)
order by miss asc
limit 10

composite(…)

One 0-100 score standing for several stats at once

from mlb.command_pitches
where season = 2026
select player, miss, glove_miss, composite(miss, glove_miss)
order by composite(miss, glove_miss) desc
limit 10

ratio(…)

One column divided by another

from mlb.command_pitches
select player, count(*), ratio(sum(miss), count(*))
group by player
order by ratio(sum(miss), count(*)) desc
limit 10

calc(…)

Arithmetic over any columns the table can build

from mlb.command_pitches
where season = 2026
select player, miss, glove_miss, calc(standing(miss) - standing(glove_miss))
order by calc(standing(miss) - standing(glove_miss)) desc
limit 10

format(…)

Prints a column's values as words, changing nothing else

from mlb.command_pitches
select player, miss, format(miss, > 0 -> "on the board", <= 0 -> "nothing yet")
order by miss asc
limit 10

pair

Draws two columns of the answer in one

from mlb.command_pitches
where season = 2026
select player, miss, miss_percentile
pair miss with miss_percentile
order by miss asc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.command_pitches
where season = 2026
select player, miss, glove_miss, target_x, composite(miss, glove_miss, target_x) as Score
hint composite(miss, glove_miss, target_x) as "Miss + Glove miss + Target x"
order by composite(miss, glove_miss, target_x) desc
limit 10

Not on this table

  • top(…) — this table does not say which of its rows is the biggest, so there is no top one to pick

mlb.playoff_odds Playoff odds

One row per club per day: FanGraphs' chance of the postseason, the division, the pennant and the World Series.

from mlb.playoff_odds
select team, wins, losses, playoffs, division_odds, world_series
order by playoffs desc
limit 30
One row is
one team's date (team-date)
Built from
one table, read straight
Reads
mlb_team_playoff_odds FanGraphs
Shows by default
team wins losses playoffs division_odds world_series
Ordered by
playoffs desc
Rows
30 by default, 10000 at most
Ranks within
season
Careers counted in
as_ofs seasons dates
Newest row
as_of
Biggest row
playoffs

Applied unless you say otherwise

  • Showing the newest snapshot — select as_of for the season's whole run

Before you trust the numbers

  • Simulated, not measured. These are frequencies out of FanGraphs' own runs of the remaining schedule, and two clubs a point apart are the same club.
  • One projection mode — FanGraphs' default, which is what its standings page shows.
  • No history before the night the loader first ran: the board publishes today and nothing serves yesterday.
Dimensions 5
NameBound to
league always mlb
team the team column
player Odds are a fact about a club — query mlb.hitters for players
position Positions belong to players, and this dataset has no players
season the season column
Columns 17
NameHeadingTypeWhat it is
as_of As of date
dimension

The day these odds were read. They move daily, and a row is one day's answer.

The day the odds were read. Naming it anywhere returns the season's whole run rather than today alone

What it takes
  • folds: min(as_of) max(as_of) count(as_of) distinct(as_of) only(as_of) latest(as_of) top(as_of) mode(as_of)
  • periods: year(as_of) quarter(as_of) month(as_of) week(as_of)
  • can be a benchmark
FanGraphs
season completes season Season season
dimension

The season the row belongs to, as the year it was played.

What it takes
  • folds: min(season) max(season) count(season) distinct(season) only(season) latest(season) top(season) mode(season)
  • can be a benchmark
FanGraphs
team completes team Team string
dimension

The club.

What it takes
  • folds: count(team) distinct(team) only(team) latest(team) top(team) mode(team)
FanGraphs
circuit AL/NL string
dimension

American or National League.

American or National League — league is taken by the sport itself

What it takes
  • folds: count(circuit) distinct(circuit) only(circuit) latest(circuit) top(circuit) mode(circuit)
FanGraphs
division Division string
dimension

The division the club plays in, AL East through NL West.

The club's division. Its chance of *winning* it is division_odds

What it takes
  • folds: count(division) distinct(division) only(division) latest(division) top(division) mode(division)
FanGraphs
current Current boolean
dimension

Whether this is the newest reading of the season — the one an unqualified question means.

The newest snapshot of the season. True unless the query asked for a date, in which case every day is here

What it takes
  • folds: count(current) distinct(current) only(current) latest(current) top(current) mode(current)
FanGraphs
wins W integer
measure

Wins. MLB.com

The club's record on the day the odds were read

What it takes
  • folds: sum(wins) avg(wins) min(wins) max(wins) count(wins) distinct(wins) only(wins) latest(wins) top(wins) mean(wins) median(wins) mode(wins)
  • ranks: wins_percentile
  • accumulates: as_of(wins)
  • can be a benchmark
FanGraphs
losses lower is better L integer
measure

Losses. MLB.com

What it takes
  • folds: sum(losses) avg(losses) min(losses) max(losses) count(losses) distinct(losses) only(losses) latest(losses) top(losses) mean(losses) median(losses) mode(losses)
  • ranks: losses_percentile
  • accumulates: as_of(losses)
  • can be a benchmark
FanGraphs
proj_wins Proj W number
measure

Where FanGraphs expects the club to finish, averaged over its simulations.

Where FanGraphs expects the club to finish — the mean of its simulations, so a fraction of a win is meaningful

What it takes
  • folds: sum(proj_wins) avg(proj_wins) min(proj_wins) max(proj_wins) count(proj_wins) distinct(proj_wins) only(proj_wins) latest(proj_wins) top(proj_wins) mean(proj_wins) median(proj_wins) mode(proj_wins)
  • ranks: proj_wins_percentile
  • accumulates: as_of(proj_wins)
  • can be a benchmark
FanGraphs
proj_losses lower is better Proj L number
measure

The other half of that projected record.

What it takes
  • folds: sum(proj_losses) avg(proj_losses) min(proj_losses) max(proj_losses) count(proj_losses) distinct(proj_losses) only(proj_losses) latest(proj_losses) top(proj_losses) mean(proj_losses) median(proj_losses) mode(proj_losses)
  • ranks: proj_losses_percentile
  • accumulates: as_of(proj_losses)
  • can be a benchmark
FanGraphs
playoffs Playoffs number
measure

Chance of reaching the postseason at all, by either route.

Any berth, division or wild card. The headline number, and what a club's playoff probability means unqualified

What it takes
  • folds: sum(playoffs) avg(playoffs) min(playoffs) max(playoffs) count(playoffs) distinct(playoffs) only(playoffs) latest(playoffs) top(playoffs) mean(playoffs) median(playoffs) mode(playoffs)
  • ranks: playoffs_percentile
  • can be a benchmark
FanGraphs
division_odds Div number
measure

Chance of winning the division outright.

Winning the division outright

What it takes
  • folds: sum(division_odds) avg(division_odds) min(division_odds) max(division_odds) count(division_odds) distinct(division_odds) only(division_odds) latest(division_odds) top(division_odds) mean(division_odds) median(division_odds) mode(division_odds)
  • ranks: division_odds_percentile
  • can be a benchmark
FanGraphs
wild_card WC number
measure

Chance of a wild-card berth specifically, rather than the division.

A wild-card berth specifically — playoffs less division_odds

What it takes
  • folds: sum(wild_card) avg(wild_card) min(wild_card) max(wild_card) count(wild_card) distinct(wild_card) only(wild_card) latest(wild_card) top(wild_card) mean(wild_card) median(wild_card) mode(wild_card)
  • ranks: wild_card_percentile
  • can be a benchmark
FanGraphs
pennant Pennant number
measure

Chance of winning the league and reaching the World Series.

Reaching the World Series

What it takes
  • folds: sum(pennant) avg(pennant) min(pennant) max(pennant) count(pennant) distinct(pennant) only(pennant) latest(pennant) top(pennant) mean(pennant) median(pennant) mode(pennant)
  • ranks: pennant_percentile
  • can be a benchmark
FanGraphs
world_series WS number
measure

Chance of winning the World Series.

Winning it

What it takes
  • folds: sum(world_series) avg(world_series) min(world_series) max(world_series) count(world_series) distinct(world_series) only(world_series) latest(world_series) top(world_series) mean(world_series) median(world_series) mode(world_series)
  • ranks: world_series_percentile
  • can be a benchmark
FanGraphs
rank computed lower is better # integer
measure

Where the row placed in this result under your order by; ties share a number and the next place skips past them (1, 2, 2, 4).

FanGraphs
pctile computed %ile integer
measure

Where the row sits within the rows this query returned, 0 to 100 — <stat>_percentile ranks against the whole season instead.

FanGraphs
Operators on this table 43 available

from

The one table a query reads

from mlb.playoff_odds
select team, wins, losses, playoffs, division_odds, world_series
order by playoffs desc
limit 30

select

The columns the answer carries

from mlb.playoff_odds
select team, wins, losses, playoffs, division_odds, world_series
order by playoffs desc
limit 30

as

Renames a column's heading and nothing else

from mlb.playoff_odds
select team, wins, wins as W
order by wins desc
limit 10

let

A value written once and referred to as $name

let year = 2026
from mlb.playoff_odds
where season = $year
select team, wins, losses
order by wins desc
limit 10

limit

How many rows come back

from mlb.playoff_odds
select team, wins, losses, playoffs, division_odds, world_series
order by playoffs desc
limit 30

order by

Which end of the answer comes first

from mlb.playoff_odds
select team, wins, losses
order by wins desc
limit 10

#

A comment, to the end of the line

# Playoff odds — One row per club per day: FanGraphs' chance of the postseason, the division, the pennant and the World Series.
from mlb.playoff_odds
select team, wins, losses, playoffs, division_odds, world_series
order by playoffs desc
limit 30

where

Chooses the rows the question is about

from mlb.playoff_odds
where season = 2026
select team, wins
order by wins desc
limit 10

and

Continues whichever filter clause came last

from mlb.playoff_odds
where season = 2026 and wins > 0
select team, wins
order by wins desc
limit 10

having

Filters the groups a fold made

from mlb.playoff_odds
select team, sum(wins)
group by team
having sum(wins) > 0
order by sum(wins) desc
limit 10

keep

where, moved one layer out — after the ranking

from mlb.playoff_odds
where season = 2026
select team, wins, wins_percentile
keep wins_percentile >= 90
order by wins_percentile desc
limit 10

highlight

Points at rows instead of choosing them

from mlb.playoff_odds
select team, season, wins
highlight season = 2026
order by wins desc
limit 10

of

A threshold that is another row rather than a number

from mlb.playoff_odds
where wins >= max(wins) of season 2026
select team, wins
order by wins desc
limit 10

group by

Folds the rows sharing these keys into one

from mlb.playoff_odds
select team, count(*), sum(wins)
group by team
order by sum(wins) desc
limit 10

then

Folds the answer a second time

from mlb.playoff_odds
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 by

Reads the answer as a matrix

from mlb.playoff_odds
select team, season, sum(wins)
group by team, season
pivot by season
limit 25

first / last

Only part of each career, before anything else runs

from mlb.playoff_odds
first 3 as_ofs
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 mlb.playoff_odds
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 mlb.playoff_odds
select team, avg(wins)
group by team
order by avg(wins) desc
limit 10

min(…)

The smallest value in each group

from mlb.playoff_odds
select team, min(wins)
group by team
order by min(wins) desc
limit 10

max(…)

The largest value in each group

from mlb.playoff_odds
select team, max(wins)
group by team
order by max(wins) desc
limit 10

count(…)

How many rows a group swallowed

from mlb.playoff_odds
select team, count(wins)
group by team
order by count(wins) desc
limit 10

distinct(…)

How many different values a group holds

from mlb.playoff_odds
select team, distinct(as_of)
group by team
order by distinct(as_of) desc
limit 10

only(…)

The one value in the group, and an error if there are two

from mlb.playoff_odds
where season = 2026
select team, only(as_of)
group by team
order by only(as_of) desc
limit 10

latest(…)

The newest row's value, rather than a number

from mlb.playoff_odds
select team, latest(team)
group by team
order by count(*) desc
limit 10

top(…)

The value on the group's biggest row

from mlb.playoff_odds
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 mlb.playoff_odds
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 mlb.playoff_odds
select team, median(wins)
group by team
order by median(wins) desc
limit 10

mode(…)

The commonest value in the group

from mlb.playoff_odds
select team, mode(team)
group by team
order by count(*) desc
limit 10

year(…)

Reads a date as the year it falls in

from mlb.playoff_odds
select team, year(as_of), sum(wins)
group by team, year(as_of)
order by year(as_of) asc
limit 20

quarter(…)

Reads a date as the quarter it falls in

from mlb.playoff_odds
select team, quarter(as_of), sum(wins)
group by team, quarter(as_of)
order by quarter(as_of) asc
limit 20

month(…)

Reads a date as the month it falls in

from mlb.playoff_odds
select team, month(as_of), sum(wins)
group by team, month(as_of)
order by month(as_of) asc
limit 20

week(…)

Reads a date as the week it falls in

from mlb.playoff_odds
select team, week(as_of), sum(wins)
group by team, week(as_of)
order by week(as_of) asc
limit 20

as_of(…)

The stat as it stood, season to date

from mlb.playoff_odds
where season = 2026
select team, month(as_of), as_of(wins)
group by team, month(as_of)
order by month(as_of) asc
limit 25

<stat>_percentile

Where a row sits in its population, 0-100

from mlb.playoff_odds
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 mlb.playoff_odds
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 mlb.playoff_odds
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 mlb.playoff_odds
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 mlb.playoff_odds
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 mlb.playoff_odds
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 mlb.playoff_odds
select team, wins, format(wins, > 0 -> "on the board", <= 0 -> "nothing yet")
order by wins desc
limit 10

pair

Draws two columns of the answer in one

from mlb.playoff_odds
where season = 2026
select team, wins, wins_percentile
pair wins with wins_percentile
order by wins desc
limit 10

hint

Shows a sentence on a heading when the pointer rests on it

from mlb.playoff_odds
where season = 2026
select team, wins, losses, proj_wins, composite(wins, losses, proj_wins) as Score
hint composite(wins, losses, proj_wins) as "W + L + Proj W"
order by composite(wins, losses, proj_wins) desc
limit 10
Back to top