Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Sports blogs for fans, by fans.
Around SBN: Fedor vs Rogers Results and Live Coverage

Saberizing a Mac: Installing the Baseball Databank Database

Well, crew, I think we tackled the question raised in Part One pretty well.  To summarize, here's how to get the necessary free software onto your Mac in order to work with databases:

  1. Download MAMP and install it.
  2. Download Sequel Pro and install it.
  3. Open MAMP and make sure the servers start.
  4. Open Sequel Pro.
  5. Type the login information from the web page opened by MAMP into the login screen of Sequel Pro, including the hostname, user, password, port and socket directory link.
  6. Admire your tech geek skills.

If you want to know some specifics about the programs you just installed, here you go: MAMP is actually three things -- a server, a MySQL database program, and a web-based interface all rolled into one (Mac-Apache-MySql-PHP).  Sequel Pro is also different user-interface, but one that's a stand-alone application instead of a web interface, and has a Mac-style look to it (which is important to keeping up the image of Mac superiority.)  Feel free to ask further questions in the comments and hopefully the pros will answer them.

The Next Step

Anyway, with our software ready to go, the next step is to grab some data.  Let's start with the Baseball Databank, located here.  The baseball databank has a lot of basic stats and biographical information.  Colin's already written about how to get that going on a PC, and I'm guessing the steps are similar on a Mac.  But feel free to share your successes and failures in the comments below.

To help give you some idea of where we're head after this, I was thinking of tackling some SQL coding basic using the examples Colin's already written about, letting people play around with creating some new queries for interesting projects and sharing them, then looking at getting a retrosheet database or a pitch f/x database up and running.  (Note: due to size, informat format, and updating issues, being able to start using those databases productively will likely be much more complex than the BDB.)

0 recs  |  Comment 17 comments |

Story-email Email Printer Print

Comments

Display:

OK, how do you do that?

if you’re using MAMP and Sequel Pro…

by RFK on Jun 5, 2009 6:53 PM EDT up reply actions   0 recs

That's a good question.

Anyone installed the BDB successfully yet? I haven’t tried…

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 5, 2009 7:49 PM EDT up reply actions   0 recs

I did that part

…and it was pretty easy. I even did Colin’s exercises, including the pitching question at the end. Did you know that Slim Sallee has the 50th lowest career earned run average, minimum 1000 innings pitched?

by RFK on Jun 5, 2009 8:02 PM EDT up reply actions   0 recs

Okay the MAMP link died on me...

anyone else having trouble?

Decrease runs scored?
Maybe.

Decrease winning? Never seen that proven.
-SFTU

by hazel on Jun 5, 2009 11:08 PM EDT reply actions   0 recs

Weird, it's not loading right now.

Here’s the direct link to download it. Gotta love Firefox’s in-line search for URLs.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 5, 2009 11:48 PM EDT up reply actions   0 recs

that's for a pc

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 6, 2009 2:17 AM EDT up reply actions   0 recs

go here

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 6, 2009 2:38 AM EDT up reply actions   0 recs

The baseball-databank is a ZIP file, so it doesn't work for mac

Has anyone else got it up?

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 6, 2009 2:39 AM EDT reply actions   0 recs

just double-click on the ZIP file

or unzip it in some other way. It worked for me.

by RFK on Jun 6, 2009 2:45 AM EDT up reply actions   0 recs

Then how do you add it to Sequel

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 6, 2009 2:57 AM EDT up reply actions   0 recs

nevermind I got it thanks

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 6, 2009 3:16 AM EDT up reply actions   0 recs

This is pretty cool

I downloaded the DBD and it’s very user friendly. I’ll have to work on writing queries, but I’m pretty sure my analysis capabilities just increased a ton.

St. Louis Cardinals... defying win expectancy since 2008

by vivaelpujols on Jun 6, 2009 4:39 AM EDT reply actions   0 recs

I should note:

Part II of the tutorial is here.

More sample code available here. And I have a lot of available sample code on my hard drive that I can try to clean up and present, so if you have any requests let me know.

by cwyers on Jun 6, 2009 2:16 PM EDT reply actions   0 recs

Notes as I do this:

Open up MAMP and Sequel Pro.
Sign in and save sign-in as “MAMP Default” in Sequel Pro.
Download .zip file of .sql file from Colin’s direct link.
Unzip (automatically) into a newly created folder called “Databases” within my baseball stuff.
Drop-down SPro menu: select “Add Database…”
Name it BDB and leave other choice as “Default”.
Under File, choose “Import…”
Navigate to Databases folder, select the .sql file and form the drop-down select “.sql”. This happened automatically, but the original default choice was .csv.
Wait for about 20 seconds as SPro imported.
Crack adult beverage.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 7, 2009 3:38 PM EDT reply actions   0 recs

This might be self-evident, or maybe not, to database newbies:

At the top of SPro, there are three views. Structure view tells you about each table in the database; ignore this for now. Content will show you the actual data in each table, which is only mildly interesting on its own. Query view lets you write SQL code which lets you retrieve data from the database in the way you want to see it, either by performing calculations on the data in one table, or by combining data from multiple tables using links between tables.

Beyond the Boxscore // Calling BJ Upton lazy is lazy.

by Sky Kalkman on Jun 7, 2009 5:27 PM EDT up reply actions   0 recs

Comments For This Post Are Closed


User Tools

We use numbers and stuff.
Community Guidelines
Why be a member?
Start posting on Beyond the Box Score »

Join SB Nation and dive into communities focused on all your favorite teams.

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Small
PZR-based Win Values 2001-2006

Recent FanPosts

Small
The "30 parks on a budget" challenge
Sunflower_small
World Series Simulation, Game #6
Small
JT20 Dynasty League
E52205a2_small
New Look
Sth70021_small
Exploring Hit f/x, Albeit Badly
Redcap_small
Ricky Nolasco: 4 WAR or 1 WAR?
Redcap_small
Apparently I can't do park adjustments
Small
Which tells us more: The last 7 at bats or 7 at bats against this pitcher?
Sleepy_jeff_small
How Efficient and Effective Were the Rockies in 2009?

+ New FanPost All FanPosts >

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recent FanShots

The Mistake Lottery
On the Field, the Yankees Are The Team of the Decade. Off It? The Red Sox.
Tigers' all-time WAR leaders
Primer on Runs Created
How to improve basketball
LB Keith Bulluck uses a sabermetric analogy to explain the Titans' quarterback situation.
Alcides Escobar "abandoned his daughter before she was born"
UZR, Scouting, and the Fans
Not-So-Lousy Lineup Optimizer, Playoff Edition: New York Yankees

+ New FanShot All FanShots >

BtB on Twitter

Main Feed: @BtBScore

Tommy B: @tommy_bennett
Sky: @BtB_Sky
Dan: @dturkenk
Harry: @harrypav
Jinaz: @jinazreds
Jack: @jh_moore
Erik: @Erik_Manning
Tommy R: @trancel
Justin: @justinbopp

Subscribe to BtB via Email

Enter your email address:

Delivered by FeedBurner

Most Commented

Limes_125_small
Time To Move On
Aviles_small
Minnesota: Fielding TargetView Before & After JJ Hardy
Nando_small
A Complete and Lenghty List of Baseball-Related Things Miguel Olivo is Good At
770insig_small
Negative Team WAR - 2009 Edition
E52205a2_small
New Look

Managers

Nando_small R.J. Anderson

Limes_125_small Sky Kalkman

E52205a2_small Tommy Bennett

Editors

Face_small Harry Pavlidis

Rawlings_baseball_bigger_small Dan Turkenkopf

770insig_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Authors

Banny_small erik

Raysring1_small Tommy Rancel

Jinaz-reds-avatar_small JinAZ

Jmlogo_small Jack Moore

1753738656_110919ebe9_o_small vivaelpujols

1_small Graham

Baseball_small Mike Rogers

Redcap_small SFiercex4

Small Patrick Clark

Walter_album_small Walter Fulbright