Short Cuts¶
SDQL short cuts save on typing and make queries more readable.
single letter¶
The SDQL provides single letter short cuts for common parameters.
- H the team is at home
- A the team is away
- W the team won
- L the team lost
- F the team is favored to win
- D the team is the underdog
- O the game went over the projected total
- U the game went under the projected total
- C the team and opponent are in the same conference.
Single letter short cuts can be strung together: H and W and F is the same as HWF.
- To see the Average margin for home dogs after winning as an away dog, use the SDQL:
- A(points-o:points) @ HD and p:WAD
summative¶
Summative short cuts are also addressed in Summative.
- tA the team’s season to date average
- tS the team’s season to date sum
- oA the opponent’s season to date average
- oS the opponent’s season to date sum
- tpA the team’s average last season
- tpS the team’s sum last season
- opA the opponent’s average last season
- opS the opponent’s sum last season
- tp2A the team’s average two seasons back
- tp2S the team’s sum two seasons back
- op2A the opponent’s average two seasons back
- op2S the opponent’s sum two seasons back
The pattern continues so that summative stats from any past season can be accessed.
For baseball, the corresponding shortcuts for starters are: sA, sS, spA, spS, and so on.
- To see how NFL teams have done in week 1 when their average points had increased over the past three seasons, use the SDQL:
- tp3A(points)<tp2A(points)<tpA(points) and week=1
Python automatically casts Booleans as integers inside of summatives.
- To see the against-the-spread record of each NBA team for the 2016 season, use the SDQL:
- tS(points+line>o:points) as ‘ATSW’,tS(points+line<o:points) as ‘ATSL’@team and season=2016