View Single Post
Old 12-13-2021, 04:59 PM   #4
Syd Thrift
Hall Of Famer
 
Syd Thrift's Avatar
 
Join Date: May 2004
Posts: 10,614
...and the team pitching breakdown, sorted by IP. As before I used the layout, more or less, of the Great American Baseball Stat Book from the 80s, although here I stuck decisions and saves in the front rather than the back. This team by the way is the Atlanta Braves, who just clinched the playoffs in my league for the first time in franchise history.

Code:
			w	l	Pct	Sv	era	g	gs	cg	sho	gf	ip	bfp	h	r	er	hr	sh	sf	hp	bb	ibb	so	wp	bk	Hper9	HRper9	BBer9	Kper9
George	House		21	8	0.724	0	2.70	34	34	11	3	0	256.2	1038	251	87	77	17	15	8	15	49	5	175	3	0	8.8	0.6	1.7	6.1
Trevon	Dean		21	5	0.808	0	3.58	31	31	9	5	0	233.2	959	207	101	93	15	8	7	10	81	2	112	7	0	8.0	0.6	3.1	4.3
Felix	Carranza	9	15	0.375	0	4.38	32	31	6	3	1	213.2	909	227	125	104	21	20	3	11	57	4	116	9	0	9.6	0.9	2.4	4.9
Kevin	Pennock		18	7	0.720	0	2.98	30	25	3	0	3	190.1	798	181	71	63	10	9	3	8	61	2	84	10	0	8.6	0.5	2.9	4.0
John	Winn		7	4	0.636	25	1.96	62	0	0	0	55	87.1	342	67	21	19	5	5	3	1	20	4	95	2	0	6.9	0.5	2.1	9.8
Jake	Cari		4	3	0.571	0	3.61	29	9	2	1	8	77.1	322	65	33	31	5	5	2	1	37	5	43	1	0	7.6	0.6	4.3	5.0
Seth	Cokely		3	2	0.600	0	3.83	15	5	2	0	5	51.2	220	52	24	22	4	4	1	0	25	1	12	1	0	9.1	0.7	4.4	2.1
Andres	Rivera		1	1	0.500	3	5.55	44	0	0	0	23	48.2	206	53	31	30	9	1	4	2	11	3	32	1	0	9.8	1.7	2.0	5.9
Chris	Wilson		2	4	0.333	0	5.63	12	4	0	0	2	38.1	163	42	24	24	7	2	3	0	18	0	20	0	0	9.9	1.6	4.2	4.7
Nate	Dolezal		3	2	0.600	0	6.10	11	3	0	0	5	31.0	137	30	28	21	5	2	3	1	16	2	22	1	0	8.7	1.5	4.6	6.4
Scott	Richey		0	1	0.000	0	5.60	20	0	0	0	8	27.1	123	34	19	17	2	1	3	0	12	0	14	1	1	11.2	0.7	4.0	4.6
Ethan	Fair		0	3	0.000	0	6.23	6	4	0	0	0	26.0	121	30	23	18	5	2	2	2	16	0	11	1	0	10.4	1.7	5.5	3.8
Tyler	Painter		1	0	1.000	1	3.97	14	0	0	0	6	22.2	111	23	15	10	1	0	2	1	23	0	17	0	0	9.1	0.4	9.1	6.8
Mickael	Diot		0	3	0.000	0	4.29	3	3	0	0	0	21.0	88	25	11	10	4	1	2	1	5	3	13	2	0	10.7	1.7	2.1	5.6
Roger	Evans		1	2	0.333	0	4.71	15	1	0	0	2	21.0	99	21	13	11	0	1	0	2	13	1	13	2	0	9.0	0.0	5.6	5.6
Tony	Morales		0	1	0.000	0	5.50	5	2	0	0	1	18.0	76	13	11	11	5	0	0	0	8	0	11	0	0	6.5	2.5	4.0	5.5
Paul	Hibbert		0	1	0.000	0	5.71	7	1	0	0	1	17.1	70	15	12	11	4	0	0	0	3	0	15	1	0	7.8	2.1	1.6	7.8
Mike	Lambert		0	1	0.000	0	7.50	1	1	0	0	0	6.0	30	9	5	5	0	0	1	0	4	0	1	1	0	13.5	0.0	6.0	1.5
Victor	Reyes		1	0	1.000	0	9.95	5	0	0	0	2	6.1	27	7	7	7	1	0	1	0	2	0	2	0	0	9.9	1.4	2.8	2.8
Damian	Seja		0	0		0	3.00	1	1	0	0	0	3.0	11	3	1	1	0	0	0	0	0	0	3	0	0	9.0	0.0	0.0	9.0
Carlos	Ortiz		0	0		0	0.00	1	0	0	0	0	2.0	7	0	0	0	0	0	0	0	0	0	0	0	0	0.0	0.0	0.0	0.0
Rick	Shattuck	0	0		0	0.00	1	0	0	0	0	0.2	2	1	0	0	0	0	0	0	0	0	0	0	0	13.5	0.0	0.0	0.0
Code:
SET @year = 1969, @team_abbr='ATL';

SELECT 
	plr.first_name,
    plr.last_name,
        pit.w,
    pit.l,
    round(pit.w / (pit.w + pit.l), 3) as Pct,
    pit.s as Sv,
    round((pit.er * 9) / (pit.ip + (pit.ipf / 3)), 2) as era,
	pit.g,
    pit.gs,
    pit.cg,
    pit.sho,
    pit.gf,
    concat(pit.ip, ".", pit.ipf) as ip,
    (pit.ab + pit.bb + pit.hp) as bfp,
    pit.ha as h,
    pit.r,
    pit.er,
    pit.hra as hr,
    pit.sh,
    pit.sf,
    pit.hp,
    pit.bb,
    pit.iw as ibb,
    pit.k as so,
    pit.wp,
    pit.bk,
    round(ha / (ip + ipf / 3) * 9,1) as Hper9,
    round(hra / (ip + ipf / 3) * 9,1) as HRper9,
    round(bb / (ip + ipf / 3) * 9,1) as BBer9,
    round(k / (ip + ipf / 3) * 9,1) as Kper9
    
FROM `modern-ish-baseball`.players_career_pitching_stats pit
LEFT JOIN players plr
	on plr.player_id = pit.player_id
LEFT JOIN teams tm
	on pit.team_id = tm.team_id
	WHERE year = @year
		and tm.abbr = @team_abbr
		and split_id = 1
order by pit.ip desc
I didn't have to get especially tricky with ordering or what have you so I did not. I guess the only slightly weird bit here is that there are two fields in the DB that comprise innings pitched: IP and "IPF", which stands for "innings pitched fraction". As baseball nomenclature goes, it's added onto the IP totals as {ip}.{ipf} and then it's treated as the third of an inning that it is in the calculations.

I know WHIP was super popular at around this time too so I considered adding it but... I never used it so I did not. The rates per 9 were not a part of the GABSB but I like them as a quick way to suss out peripherals so I added them, too.
__________________
Quote:
Originally Posted by Markus Heinsohn
You bastard....
The Great American Baseball Thrift Book - Like reading the Sporting News from back in the day, only with fake players. REAL LIFE DRAMA THOUGH maybe not
Syd Thrift is offline   Reply With Quote