Parameter TypesFor the most up-to-date list of available parameters see the SDQL query pages for the NFL, NBA, and MLB.
SDQL parameters in all sports use the following types:
- Number (e.g. points, first downs, total)
- String (e.g. team, division)
- List (e.g. quarter scores, inning runs)
- Date (for date)
additionally, MLB has its own custom type:
- Line (for line and run line)
Parameters which are numbers can be combined using the usual math symbols:
+, -, / and * (for multiplication).
To query on NFL teams after they got more than 10 yards per pass attempt use the SDQL:
p:passing yards > 10 * p:passes
Database strings are accessed using single quotes.
To get home games for the Bears use the SDQL:
team = 'Bears' and site = 'home'
Note that although the use of single quotes for string parameters is always correct, many sites
do not require them. For example, on SportsDataBase.com
this query can also be done without quotes:
team = Bears and site = home.
The contents of lists are accessed by offset (starting at 0) using square brackets.
To see how MLB teams do when scoring three or more runs in the first inning use the SDQL:
inning runs >= 3.
To check how teams do after a game in which they scored at least 4 in ninth and lost use the SDQL:
p:inning runs >= 4 and p:L.
Splicing works both ways: to find MLB games in which a team scored one run in each of the last four inning use the SDQL:
inning runs[-4:] = [1,1,1,1].
The date parameter has its own type to allow convenient addition and subtraction: a Date minus a Date is a Number while a Date plus or minus a Number is a Date. To see how NBA teams do when they are looking ahead to at least three days off use the SDQL:
n:date - date > 3.
The MLB line and run line parameters have their own type to allow queries on line differnces between games. To see how MLB teams do when they are 50 cents more favored then in their last game use the SDQL:
line - p:line = -50.
Note that this query covers favorite to bigger favorite (e.g. p:line = -120 and line = -170), dog to favorite (e.g. p:line = 120 and line = -130), and dog to less of a dog (e.g. p:line = 180 and line = 130).