# Ask the guy who's downloaded at the Retrosheet baseball data into a database.

**URL:** https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663
**Category:** Miscellaneous and Personal Stuff I Must Share
**Created:** [October 17, 2005, 10:27pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663 "2005-10-17T22:27:39Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 17, 2005, 10:27pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/1 "2005-10-17T22:27:39Z")

</div>

So, in yet another one of my creative attempts to avoid doing any real work, i was playing around on [Retrosheet](http://www.retrosheet.org/home.htm) and decided to download all their game logs and import them into an Access database table.

I now have a single table with 184,147 records, encompassing regular season games starting in 1871 and going all the way through to the end of 2004. It’s a lot of fun playing around with it, asking it for the sort of meaningless statistics that TV commentators seem to love so much.

For example, did you know that, in night games played between the Baltimore Orioles and National League teams in the years 1998-2004, Baltimore pitchers pitched a total of 10 complete games. Of those 10 games, 9 were at home and 1 was on the road, and 9 were victories while 1 was a loss.

Or, that during Cal Ripken’s career, in games where Ripken played shortstop and batted at number 5 in the order, the Orioles won 63 games by 4 runs or more?

So, tell me what you want to know. I’ll do my best to come up with queries (either using the Access query builder, or trying to write my own SQL phrase) that will answer your question.

To give you an idea of the information at my disposal, [here](http://www.retrosheet.org/gamelogs/glfields.txt) is a guide to the statistics contained in the Retrosheet game logs.

By the way, if there are any database gurus out there who have any suggestions as to how i might organize this data more efficiently than in just one massive table, i’d be happy to hear it. Part of the reason to download this data in the first place was to give me a chance to practice my rudimentary knowledge of SQL. I’m really no database expert.

---

<div class="post-metadata">

### Author: ![World\_Eater](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@World\_Eater](https://boards.straightdope.com/u/World_Eater)
#### Post date: [October 17, 2005, 11:01pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/2 "2005-10-17T23:01:56Z")

</div>

How many home runs were hit by national league pitchers during Tuesday night games between 1957 and 1983? 😛

---

<div class="post-metadata">

### Author: ![lieu](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@lieu](https://boards.straightdope.com/u/lieu)
#### Post date: [October 17, 2005, 11:14pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/3 "2005-10-17T23:14:56Z")

</div>

Heh, **mhendo** , that’s pretty dedgum cool. Yes, you’ve got hundreds of future work hours quite suddenly at risk.

Let’s see… how about something germane to tonite’s game? Help me formulate something pertinent cuz left to my own devices my question’s gonna suck.

Ummm… how many times (or what percentage of the time) does an NL wildcard team win the LCS in 5, 6 and 7 games? If that needs to be improved upon, please be my guest.

---

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 17, 2005, 11:26pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/4 "2005-10-17T23:26:34Z")

</div>

Sorry guys.

You both asked questions that the data can’t answer. It doesn’t contain individual player stats, so i can’t answer **World Eater** ’s question. And it’s regular season games only (no postseason), so **lieu** ’s question is out.

Have a look at the second link in the OP and it will give you an idea of what stats are available.

---

<div class="post-metadata">

### Author: ![World\_Eater](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@World\_Eater](https://boards.straightdope.com/u/World_Eater)
#### Post date: [October 17, 2005, 11:26pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/5 "2005-10-17T23:26:50Z")

</div>

> [@World Eater](#):
>
> How many home runs were hit by national league pitchers during Tuesday night games between 1957 and 1983? 😛

How many of them were with full counts?

How many with full counts, a runner on second, and 1 out?

Ok, ok I’ll quit while I’m ahead. I have a sinking feeling you’re going to punch me next time we go for a drink!

---

<div class="post-metadata">

### Author: ![World\_Eater](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@World\_Eater](https://boards.straightdope.com/u/World_Eater)
#### Post date: [October 17, 2005, 11:30pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/6 "2005-10-17T23:30:18Z")

</div>

Ok, a serious question. Is it possible to determine which team historically has the best winning percentage in the second game of a doubleheader?

---

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 17, 2005, 11:35pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/7 "2005-10-17T23:35:40Z")

</div>

> [@World Eater](#):
>
> Ok, a serious question. Is it possible to determine which team historically has the best winning percentage in the second game of a doubleheader?

Wow. I think that it might be. The main limitation on this will be my SQL query-building skill. Let me see what i can do.

---

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 18, 2005, 12:55am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/8 "2005-10-18T00:55:38Z")

</div>

> [@World Eater](#):
>
> Ok, a serious question. Is it possible to determine which team historically has the best winning percentage in the second game of a doubleheader?

Well, it took a bit of messing around, but i’ve finally got some figures.

In order to make it manageable (at least for someone with my low level of database knowledge), i restricted the time period to the years since 1970. That way, i didn’t have to deal with a whole bunch of franchise name changes. There were a few, but not enough to make life much more difficult.

Anyway, in the period since 1970, the team with the best record in the second game of a double header is the Florida Marlins, with a record of 14-8, or .636. The team with the worst record in these situations is the Tampa Bay Devil Rays, with a record of 3-8, or .273.

Now, it’s clear that neither of those teams have played too many double headers. If we look only at teams who have played more than 100 such games, then the team with the best record is the New York Yankees at 132-80 (.622), and the worst is the Houston Astros at 55-79 (.410).

Here’s the full sheet, in order from worst to best:

```auto

Team	Wins	Losses	Percentage

TBA	3	8	0.272727273
HOU	55	79	0.410447761
TOR	43	60	0.417475728
ANA	57	76	0.428571429
SEA	28	36	0.4375
ATL	89	111	0.445
CHN	92	114	0.446601942
DET	95	113	0.456730769
MIL	107	125	0.461206897
COL	14	16	0.466666667
CLE	140	153	0.4778157
NYN	126	137	0.479087452
TEX	92	100	0.479166667
CHA	108	117	0.48
OAK	94	98	0.489583333
SDN	97	100	0.492385787
PHI	114	114	0.5
MON	119	118	0.502109705
CIN	87	82	0.514792899
BAL	297	278	0.516521739
KCA	100	91	0.523560209
SFN	91	82	0.526011561
LAN	51	45	0.53125
MIN	97	83	0.538888889
BOS	114	96	0.542857143
SLN	99	78	0.559322034
PIT	138	105	0.567901235
ARI	4	3	0.571428571
NYA	132	80	0.622641509
FLO	14	8	0.636363636

```

---

<div class="post-metadata">

### Author: ![World\_Eater](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@World\_Eater](https://boards.straightdope.com/u/World_Eater)
#### Post date: [October 18, 2005, 8:13pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/9 "2005-10-18T20:13:49Z")

</div>

Well as usual the Mets are losers. 😛 Since I’ve been riding Yankee coattails for sometime though, this is good news. I wonder what the correlation, if any, is.

---

<div class="post-metadata">

### Author: ![Jackknifed\_Juggernaut](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Jackknifed\_Juggernaut](https://boards.straightdope.com/u/Jackknifed_Juggernaut)
#### Post date: [October 18, 2005, 11:07pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/10 "2005-10-18T23:07:58Z")

</div>

There was a game this year in which the Yankees beat the Devil Rays 20 - 11. I noticed that in that game, both teams had 8-run leads at some point. In another thread, I asked if anyone knew the last time there a was a game in which both teams had 8-run leads. **Rufus Xavier** pointed me to a 1999 game between Cleveland and Tampa Bay in which this happened. I guess there’s something about Tampa Bay.

Can you give me get me stats on how often this has happened in MLB history? I suppose a good start is to look at games in which at least 24 runs were scored, with at least 16 by one of the teams.

---

<div class="post-metadata">

### Author: ![Freddy\_the\_Pig](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@Freddy\_the\_Pig](https://boards.straightdope.com/u/Freddy_the_Pig)
#### Post date: [October 18, 2005, 11:54pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/11 "2005-10-18T23:54:54Z")

</div>

Can you provide a complete list of games since 1973, in AL parks, where a manager elected not to use a DH at the start of the game and allowed the pitcher to bat? I’m aware that Ken Brett did it a couple of times for the White Sox and I think Fergie Jenkins did it at least once but I don’t know if there were more.

---

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 19, 2005, 12:02am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/12 "2005-10-19T00:02:23Z")

</div>

> [@Jackknifed Juggernaut](#):
>
> There was a game this year in which the Yankees beat the Devil Rays 20 - 11. I noticed that in that game, both teams had 8-run leads at some point. In another thread, I asked if anyone knew the last time there a was a game in which both teams had 8-run leads. **Rufus Xavier** pointed me to a 1999 game between Cleveland and Tampa Bay in which this happened. I guess there’s something about Tampa Bay.
> 
> Can you give me get me stats on how often this has happened in MLB history? I suppose a good start is to look at games in which at least 24 runs were scored, with at least 16 by one of the teams.

It’s a difficult thing to do because of the way that the inning by inning stats are laid out. They are in a single cell, as one long number. For example, the home team line score will be in one cell, and might look like 41000301x, with the visiting team line score in another cell saying 200030110. Because of this layout, i don’t know how to track the inning by inning swings within each game.

I did look for all games in which the winning team scored at least 16 runs and the losing team scored at least 8. That gave me about 700 games in total. Now, the number that i had to look through was reduced by the fact that very few of the games before WWI have inning by inning line scores available. When you only have the final result, it’s impossible to say what the in-game swings were.

For the games where i did have the line scores, i scanned them one by one, looking for cases where the losing team went up by a big margin early in the game. So i basically looked for line scores in which the losing team had big numbers early, and the winning team had small numbers early.

I don’t claim that this method was perfect, or that i couldn’t have missed something, but as far as i could see the only game in which both teams led by 8 runs or more was the Tampa-Cleveland game you mentioned.

There were some games in which the losing team jumped out early, but the winning team were never actually eight runs behind. For example, on July 11, 1947, St. Louis scored 9 in the first two innings and ended up losing to the New York Giants 17-9. But St. Louis never led by 8, because the Giants scored 11 of their 17 runs in the first two innings also.

Sorry i can’t be more definitive. If anyone knows how i might extract this sort of data from _within_ those line score categories, i’d love to hear it.

---

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 19, 2005, 12:30am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/13 "2005-10-19T00:30:24Z")

</div>

> [@Freddy the Pig](#):
>
> Can you provide a complete list of games since 1973, in AL parks, where a manager elected not to use a DH at the start of the game and allowed the pitcher to bat? I’m aware that Ken Brett did it a couple of times for the White Sox and I think Fergie Jenkins did it at least once but I don’t know if there were more.

Well, if i’ve done this right, then i’ve come up with four games. You were correct about Breet and Jenkins. But there was one more.

```auto

Date Teams Pitcher/Team No. in Batting Order

July 6, 1976 CHA@BOS Ken Brett (CHA) 9
Sept. 23, 1976 MIN@CHA Ken Brett (CHA) 8
Sept. 27, 1975 CAL@OAK Ken Holtzman (OAK)	9
Oct. 2, 1974 TEX@MIN Fergie Jenkins (TEX)	9

```

---

<div class="post-metadata">

### Author: ![Killerjoke](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@Killerjoke](https://boards.straightdope.com/u/Killerjoke)
#### Post date: [October 19, 2005, 12:49am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/14 "2005-10-19T00:49:36Z")

</div>

OK, this got me out of Lurker mode. I agree this is fascinating.

I just downloaded the All Star game data so I could see what it looked like.

I have a couple of requests for you:

How many games did Willie Mays (maysw101) start, but not in centerfield (position code 8)? We could do this for any number of players. In fact, how many games did Babe Ruth start at 1st base (position code 3)?

How many games in each year 1900-1930 were won by a pitcher other than the starting pitcher? My accuracy challenged perception is that there were not a whole lotta relief pitchers back in the day, so pitchers were starters and they either won or lost. Actually that same stat for the years 2000-2004 would be an interesting counterpoint, too.

Thanks,  
Killerjoke

---

<div class="post-metadata">

### Author: ![Julius\_Henry](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@Julius\_Henry](https://boards.straightdope.com/u/Julius_Henry)
#### Post date: [October 19, 2005, 1:01am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/15 "2005-10-19T01:01:03Z")

</div>

> [@mhendo](#):
>
> Well, if i’ve done this right, then i’ve come up with four games. You were correct about Breet and Jenkins. But there was one more.

Mmmm. All three were pitchers, all three played for one or the other Chicago team. I don’t think that’s a coincidence.

---

<div class="post-metadata">

### Author: ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)
#### Post date: [October 19, 2005, 1:23am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/16 "2005-10-19T01:23:21Z")

</div>

> [@Killerjoke](#):
>
> OK, this got me out of Lurker mode. I agree this is fascinating.
> 
> I just downloaded the All Star game data so I could see what it looked like.
> 
> I have a couple of requests for you:
> 
> How many games did Willie Mays (maysw101) start, but not in centerfield (position code 8)? We could do this for any number of players. In fact, how many games did Babe Ruth start at 1st base (position code 3)?
> 
> How many games in each year 1900-1930 were won by a pitcher other than the starting pitcher? My accuracy challenged perception is that there were not a whole lotta relief pitchers back in the day, so pitchers were starters and they either won or lost. Actually that same stat for the years 2000-2004 would be an interesting counterpoint, too.
> 
> Thanks,  
> Killerjoke

Unfortunately, gaps in the data provided by Retrosheet means that i was only able to answer parts of your questions.

I put together a query asking how many games Willie Mays started at a position other than center field. Then, just to be sure, i also put together a query asking how many games he DID start in center.

The totals were:

1691 in center  
80 in a different position.

But this gives a total well short of Mays’ total of 2992.

The problem is that all position players are only listed from 1960 onwards. Those fields are completely blank for the period before. So my figures for Mays’ positions miss the first nine years of his career.

For the same reason, i can’t tell you how many games the Babe started at first.

Also, the only listing for pitchers in the early 20th century is for starting pitchers. Winning and losing pitchers aren’t listed for that period, so i’m afraid i can’t answer that question either. Sorry.

This spreadsheet/database really is strongest for the period since 1960. Retrosheet is adding new data all the time, but there are still many gaps for the earlier years.

I was able to answer the last part, though:

For the period 2000-2004, there 12,142 games played altogether in the majors.

Of these, 3,652 (~30%) were won by a pitcher other than a starting pitcher.

---

<div class="post-metadata">

### Author: ![World\_Eater](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@World\_Eater](https://boards.straightdope.com/u/World_Eater)
#### Post date: [October 19, 2005, 1:45am UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/17 "2005-10-19T01:45:25Z")

</div>

> [@Killerjoke](#):
>
> OK, this got me out of Lurker mode. I agree this is fascinating.
> 
> I just downloaded the All Star game data so I could see what it looked like.
> 
> I have a couple of requests for you:
> 
> How many games did Willie Mays (maysw101) start, but not in centerfield (position code 8)? We could do this for any number of players. In fact, how many games did Babe Ruth start at 1st base (position code 3)?
> 
> How many games in each year 1900-1930 were won by a pitcher other than the starting pitcher? My accuracy challenged perception is that there were not a whole lotta relief pitchers back in the day, so pitchers were starters and they either won or lost. Actually that same stat for the years 2000-2004 would be an interesting counterpoint, too.
> 
> Thanks,  
> Killerjoke

Now this is what I call a delurk. 16 posts in 5 years, wow!

---

<div class="post-metadata">

### Author: ![Killerjoke](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@Killerjoke](https://boards.straightdope.com/u/Killerjoke)
#### Post date: [October 19, 2005, 12:43pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/18 "2005-10-19T12:43:38Z")

</div>

> [@World Eater](#):
>
> Now this is what I call a delurk. 16 posts in 5 years, wow!

And I pay!

Thanks **mhendo**. 80 games at some position other than Center for Mays is very interesting. And I am surprised that only 30% are won by other than the starter. Really fascinating data.

Killerjoke

---

<div class="post-metadata">

### Author: ![Trunk](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Trunk](https://boards.straightdope.com/u/Trunk)
#### Post date: [October 19, 2005, 12:54pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/19 "2005-10-19T12:54:49Z")

</div>

What percentage of double headers are split?

---

<div class="post-metadata">

### Author: ![Jackknifed\_Juggernaut](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Jackknifed\_Juggernaut](https://boards.straightdope.com/u/Jackknifed_Juggernaut)
#### Post date: [October 19, 2005, 1:06pm UTC](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663/20 "2005-10-19T13:06:20Z")

</div>

Thanks mhendo. I certainly appreciate the effort.

[Next page](https://boards.straightdope.com/t/ask-the-guy-whos-downloaded-at-the-retrosheet-baseball-data-into-a-database/326663.md?page=2)
