Hill suffers from an intense condition of arachnophobia. On one occasion, Hill sustained cuts and scrapes on his feet, knees and arm during a violent nightmare about spiders. Hill jumped out of bed, bumped into a glass table and plunged down a staircase, all occurring when he was asleep. Hill ended up being placed on the 15-day disabled list. This led to him being nicknamed “Spiderman.”
*Requires retrosheet and a lahman or baseball_databank database.
There are a million ways to do this. The one here probably possesses a devastating inefficiency, for I am not a master of self-joining. It may not even be right, please tell me if its not. Or don’t tell me, I don’t care.
USE retrosheet; CREATE PROCEDURE `hitting_streak`(IN Last VARCHAR(56), IN First VARCHAR(56)) BEGIN SET @streak:=0; SELECT MAX(STREAK) FROM (SELECT GAME_DATE, YEAR, @streak:=@streak*STREAK+STREAK AS STREAK FROM (SELECT DATE(MID(a.GAME,4,8)) AS GAME_DATE, a.YEAR AS YEAR, a.H>0 AS STREAK FROM (SELECT GAME_ID AS GAME, YEAR_ID AS YEAR, SUM(IF(BAT_EVENT_FL='F' OR SH_FL='T' OR EVENT_CD BETWEEN 14 AND 17,0,1)) AS AB, SUM(EVENT_CD>19) AS H FROM retrosheet.events WHERE BAT_ID=(SELECT retroID FROM lahman.master WHERE nameFirst like (First) AND nameLast like (Last)) GROUP BY GAME_ID) AS a WHERE a.AB>0 ORDER BY GAME_DATE) as t) as a; END
More than likely when I post something now it will be of a similar nature.
Here is a little PHP script that grabs NBA data from covers.com (for example, here) and throws it over to a MySQL database. Each game is identified with a unique ‘GmNAME’ so duplicates are ignored. However this doesn’t happen until the MySQL query. It would be ideal if PHP handled this operation, would speed up the script considerably, but I just threw it together and only thought of that while writing this.
Open the php file in a text editor, enter your MySQL connection parameters, and the desired span of years for which to get data. Uncomment the lines that create the table structure.
I may mess around with it at length.
Again, last post on this. I’ll attach necessary files at bottom.
Hit both pitchers last year. Kershaw was sharp, he won us money (be weary of “max payout” disclaimers on Cy Young futures emailed to you after the fact by some unspecified sportsbooks, though no worries we got paid in full).
AL and NL formulas:
And a different formula is required for NL relief pitchers:
bWAR is baseball-reference WAR projected to the end of the season.
AL CY YOUNG
NL CY YOUNG