Data for Journalists Chapter Seven

Chapter Seven

Database Managers, Part 2

Here are exercises for this chapter and links to resources for using database managers to join two or more tables together, whether tables are supposed to be joined or not, and then analyzing the data.

Also, here are links to some of the datasets used in the chapter. They include the campaign finance data from the previous chapter.

  • Exercises

Suggested exercises include:

1. Using the sample database from the book, join the tables in the database.

2. Group and sum amounts by candidate name. 

3. Group and sum amounts by candidate name and occupation.

To import a CSV file into DB Browser, first create a new database. Click “New Database” and give it a name, then choose “Cancel”  for the “Edit table definition” prompt. Now you have a database ready to import the CSV data. To do so, click on the “File” menu in the top left corner, highlight “Import” and choose the “Table from CSV file” option.

Alternatively, to create a database from an SQL file, click on the “File” menu in the top left corner, highlight “Import” and choose the “Database from SQL file” option.

  • Data (same data as chapter six)

CSV file for Chapter 7 data: Candidates

CSV file for Chapter 7 data: Givers

SQL file for Chapter 7 data: Political Contributions

Alternative Downloads:

CSV file for Chapter 7 data: Candidates (Alternative Download)

CSV file for Chapter 7 data: Givers (Alternative Download)

SQL file for Chapter 7 data: Political Contributions (Alternative Download)

© Brant Houston