How to use the Baseball query page:|
Use this page to type in queries to check the records and net profits of any situation.
Profits are calculated based on risking the line to win $100 when playing on
favorites and risking $100 to win the line when playing on dogs.
A query consists of one or more clauses joined by and or or.
The full format for reference to the MLB SportsDataBase is game reference:parameter.
team and site=home
returns the home records for all teams
p:runs<=1 and 5<=po:runs
returns games after a team scored 1 or fewer runs while their opponent scored 5 or more runs.
returns games grouped by all occurrences of the teams previous runs
gives results grouped by previous runs fewer than 1,2,3,4, and 5.
Use of the game reference lets you probe any game relative to the
game for which you want to see stats. We saw this above with
meaning "How do teams do after scoring 1 or fewer runs?"
To reqire this same condition also on the team's run productions 2 games back use:
p:runs<=1 and pp:runs<=1
Allowed game references are:
t => team's stats
o => opponent's stats
p => team's previous game
op => opp's previous game
P => previous match up
n => team's next game
on => opp's next game
N => next match up
s => starter's previous start
S => starter's previous match up start
site=home and P:runs=0 and PP:runs=0
returns home games where the team was shut out their two previous matchups. (Remember
that 'P' refers to the previous matchup between the two teams
while 'p' refers to the team's previous game.)
o:walks=0 and team=Cubs
returns games where the Cubs' pitchers gave up no walks.
6<o:strike outs and team=Mets
returns games where the Mets' pitchers struck out more than 6 hitters.
Short cuts come in three flavors:
- Single letter short cuts (e.g.: `H` means `site=home`)
- Single letter plus number short cuts (e.g.: `R5` means 'runs scored in the fifth inning')
- Multi-character short cuts (e.g.: `SO` means `strike outs`)
Single letter short cuts
Single letter short cuts are great because you can easily combine them
and you only need to specify the prefix once.
H, A, W, L, F, D, O, U, C, X are allowed short cuts for home,away,win,loss,favorite,dog,over the total,under the total, a same-conference game, and extra innings. As with the parameter prefixes, these can be strung together without limit.
HF and p:HFL and pp:HFL
returns home favorites after they just lost as home favorites their last two games.
P:O and PP:O and PPP:O and PPPP:O and PPPPP:O and PPPPPP:O
returns games where teams have gone over the total their last six matchups.
HF and p:WADX
returns games where the team is a home favorite after winning as an away dog in extra innings.
Single letter plus number short cuts
The runs scored in each inning is saved as a list in the database under the header `inning runs`. The short cuts
R1, R2,...R9 (runs in the specified inning)
M1, M2,...M9 (the margin after the specified innings)
S1, S2,...S9 (the score after the specified inning)
facilitate access to this parameter.
p:M8<-4 and p:R9>5 and p:W
returns games after the team was down by +4 after 8, scored more than 5 in the 9th to win.
p:S3>10 and p:L
returns games after the team scored more than 10 runs in the first three innings and lost.
Multi-character short cuts
Multi-character short cuts save on typing and can make your SDQL more readable.
- AASB - After All-Star Break
- AWP - Away Winning Percentage
- BASB - Before All-Star Break
- BL - Biggest Lead
- BPRA - Bull Pen Runs Allowed
- BS - Bad Start (4 or fewer innings and 5 or more earned runs)
- DAY - Day (start time<1800)
- DDP - Defensive Double Plays
- DIV - Divisional Game
- FGS - First Game of a Series
- HR - Home Runs
- HPR - Hits Per Run
- HPU - Home Plate Umpire
- HWP - Home Winning Percentage
- IL - Innings Led
- IT - Innings Tied
- LGS - Last Game of a Series
- LOB - Left on Base
- MRI - Multiple Run Innings
- NDIV - Not a Divisional Game
- NGT - Night (start time>=1800)
- NQS - Non Quality Start
- ODP - Offensive Double Plays (hit into double plays)
- PBRS - Percent Base Runners Scored
- PO - During the Playoffs
- PU - Pitchers Used
- QS - Quality Start (at least 6 innings and 3 or fewer earned runs)
- REG - During the Regular Season
- RG3 - Rubber Game 3 (3rd game of a 3 game series and they split the first 2)
- RMAX - The maximum runs the team scored in any one inning
- SERA - Starters' Earned Run Average in the Referenced Game
- SF - Scored First
- SG - Series Game
- SGS - Series Games
- SHA - Starter's Hits Allowed
- SHF - Starter's Hitters Faced
- SHRA - Starter's Home Runs Allowed
- SII - Scored In Innings
- SIP - Starter's Innings Pitched
- SO - Strikeouts
- SOPW - Strikeouts Per Walk
- SPPH - Starter's Pitch Per Hitter
- SPB - Strike Per Ball
- SPT - Starter Pitches Thrown
- SRA - Starter's Runs Allowed
- SSO - Starter's Strike Outs
- SSPB - Starter's Strike Per Ball
- STDHPR - Season To Date Hits Per Run
- STDSERA - Starter's Season To Date ERA
- STDSOPW - Season To Date Stike Outs Per Walk
- STDSSOPW - Starter's Season To Date Stike Outs Per Walk
- STDSPB - Season To Date Stikes Per Ball
- STDSSPB - Starter's Season To Date Stikes Per Ball
- STDSWHIP - Starter's Season To Date WHIP
- STR - Starter Throws Right
- STL - Starter Throws Left
- SWA - Starter's Walks Allowed
- SWHIP - Starter's Walks Plus Hits Per Inning Pitched
- TLOB - Team Left On Base
- TT - Times Tied
- WOW - Walk Off Win
- WP - Winning Percentage
- XBH - eXtra Base Hits (doubles + triples)