Player confusion

21 views
Skip to first unread message

John Currey

unread,
Feb 10, 2022, 8:26:22 AMFeb 10
to SDQL API

Hi,

I'm starting to experiment with player data for MLB. I am missing something and not having success with queries based on player data. 

Feb9.PNG

I follow the above instructions have a t:Players and o:Players keys in my dictionary that contain a list of dictionaries containing player data for the Dodgers at Giants game on 7/23/2020.  It looks like this:

{'date': 20200723, 'o:team': 'Giants', 't:team': 'Dodgers', 'double header': 0, 't:Players': [{'position': '1B', 'name': 'Max Muncy', 'batting order': 1, 'at bats': 4, 'runs': 0, 'hits': 1, 'rbi': 1, 'walks': 1, 'singles': 0, 'doubles': 1, 'triples': 0, 'home runs': 0, 'total bases': 2, 'stolen bases': 0, 'hit by pitch': 0, 'strike outs': 1, 'plate appearances': 5, 'batter pitches': 18, 'batter strikes': 9, 'average': 0.25}, {'position': 'RF', 'name': 'Mookie Betts', 'batting order': 2, 'at bats': 5, ...

After adding the player data to my MLB database, I followed the instructions below:

Feb10a.PNG

I tried the link below which fails as well as various other queries unsuccessfully.

https://s3.sportsdatabase.com/MLB/query.html?sdql=date%2Cteam%2Co%3Ateam%40P%3APlayer%3AMax+Muncy%3Aat+bats%3E0&submit=++S+D+Q+L+%21++

Any guidance is appreciated. 

Joe Meyer

unread,
Feb 10, 2022, 10:19:24 AMFeb 10
to sdq...@googlegroups.com
John and SDQL API Friends,

Please note that you can name 'Player' tables anything you like.
In NHL, for example, you might choose to have separate tables for 'Skaters' and 'Goalies' - or just lump them together as 'Players'.

In your MLB work, I see that you have defined a table named 'Players'.
However,  your sample SDQL uses 'Player' - and that throws an error.

best regards,

Joe Meyer
Sports Database LLC 

--

---
You received this message because you are subscribed to the Google Groups "SDQL API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sdqlapi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sdqlapi/f2774886-cd1a-4fab-be23-7d9adf5f207dn%40googlegroups.com.

John Currey

unread,
Feb 10, 2022, 10:34:18 AMFeb 10
to SDQL API
Damn, I'm a dope! Thanks, Joe, for pointing me in the right direction!

John Currey

unread,
Feb 10, 2022, 10:38:03 AMFeb 10
to SDQL API
Also, it looks like there is some magic in the "name:" key where it's assumed. Is that correct?

Joe Meyer

unread,
Feb 10, 2022, 7:37:08 PMFeb 10
to sdq...@googlegroups.com
Hi John and API Friends,

that brings up a somewhat subtle point regarding reference to player-level data.

table:name:parameter 

is the full and correct format.

When there are no spaces in the reference, you can use CamelCaseCompletion on table names.

That is:

Pl:list:name

is fine, while

Pl:list:at bats

fail and the full and correct format: 

Players:list:at bats

is required.

best regards,

Joe Meyer
Sports Database LLC

John Currey

unread,
Feb 10, 2022, 8:06:44 PMFeb 10
to SDQL API
Thanks for that clarification.
Reply all
Reply to author
Forward
0 new messages