For October, I worked through the Programming Historian lesson “Introduction to MySQL with R.” It covers setting up a MySQL database, loading data into it from R, and querying it. I picked it because I wanted real SQL practice, and because structured data shows up all over digital humanities work, like Omeka metadata and ArcGIS attribute tables.
The lesson uses a dataset of Welsh newspaper search results from World War I. I created the database and a user, wrote an R script to load two CSVs (stories matching “German submarine” and stories matching “allotment and garden”), and then used SQL to count how many stories were published each month. The graph shows the two topics peaking at different times – submarine coverage spikes in early 1915, while allotment and garden coverage climbs later and peaks in 1918.
The most useful thing I learned is that tutorials age. The lesson was written in 2018 and the R package it uses is outdated, so I used RMariaDB instead.
This was a lot less SQL and a lot more R than I expected… but my favorite part was seeing a query turn a pile of rows into something readable! A GROUP BY on year and month does the heavy lifting, and the graph is just the result. That’s something I can explain to other Fellows working with messy spreadsheets, and it’s a skill I’ll keep using after Grinnell.
Next, I think I want to write queries on a dataset of my own instead of the lesson’s.

