Relational databases and SQL

University of California, Santa Barbara


Feb 4, 2022

9:00 am - 12:00 pm

Instructors: Greg Janée, Amanda Ho

Helpers: Sam Csik, Kat Le, Jamie Montgomery, Amelia Meyer

Some adblockers block the registration window. If you do not see the registration box below, please check your adblocker settings.

General Information

Software Carpentry aims to help researchers get their work done in less time and with less pain by teaching them basic research computing skills. This hands-on workshop will cover basic concepts and tools, including program design, version control, data management, and task automation. Participants will be encouraged to help one another and to apply what they have learned to their own research problems.

For more information on what we teach and why, please see our paper "Best Practices for Scientific Computing".

Who: The course is aimed at graduate students and other researchers. You don't need to have any previous knowledge of the tools that will be presented at the workshop.

Where: This training will take place online. The instructors will provide you with the information you will need to connect to this meeting.

When: Feb 4, 2022. Add to your Google Calendar.

Requirements: Participants must have access to a computer with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.) that they have administrative privileges on. They should have a few specific software packages installed (listed below).

Accessibility: We are dedicated to providing a positive and accessible learning environment for all. Please notify the instructors in advance of the workshop if you require any accommodations or if there is anything we can do to make this workshop more accessible to you.

Contact: Please email for more information.

Roles: To learn more about the roles at the workshop (who will be doing what), refer to our Workshop FAQ.

Code of Conduct

Everyone who participates in Carpentries activities is required to conform to the Code of Conduct. This document also outlines how to report an incident if needed.

Collaborative Notes

We will use this collaborative document for chatting, taking notes, and sharing URLs and bits of code.


Please be sure to complete these surveys before and after the workshop.

Pre-workshop Survey

Post-workshop Survey


Day 1

Before Pre-workshop survey
9:00 Zoom Intro
9:15 Relational Database Model
09:25 Selecting Data
09:35 Sorting and Removing Duplicates
09:45 Filtering
09:55 Calculating New Values
10:05 Missing Data
10:35 Aggregation
10:55 Combining Data
11:15 Data Hygiene
11:30 Creating and Modifying Data
11:30 Programming with Databases - R
11:50 Wrap-up
12:00 END
After Post-Workshop Survey


To participate in a Software Carpentry workshop, you will need access to software as described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.

Install the videoconferencing client

If you haven't used Zoom before, go to the official website to download and install the Zoom client for your computer.

Set up your workspace

Like other Carpentries workshops, you will be learning by "coding along" with the Instructors. To do this, you will need to have both the window for the tool you will be learning about (a terminal, RStudio, your web browser, etc..) and the window for the Zoom video conference client open. In order to see both at once, we recommend using one of the following set up options:

This blog post includes detailed information on how to set up your screen to follow along during the workshop.


For this course you will need the UNIX shell and SQLite3.

If you are running macOS you should already have SQLite installed. You can run `sqlite3 --version` in a terminal to confirm that it is available.

If you are running Linux, you may already have SQLite3 installed, please use the command `which sqlite3` to see the path of the program, otherwise you should be able to get it from your package manager (on Debian/Ubuntu, you can use the command `apt install sqlite3`).

If you are running Windows, run installers as administrator. You may find the latest release of SQLite on their website. Additionally, make sure you select the right installer version for your system. We recommend that you use git for Windows. This is described in the UNIX Shell lesson. If the installer asks to add the path to the environment variables, check yes, otherwise you have to manually add the path of the executable to the `PATH` environmental variables. This path informs the system where to find the executable program. Once Git for Windows is installed, you can open a terminal by running the program "Git Bash" from the Windows start menu.

If installing SQLite3 using Anaconda, refer to the anaconda sqlite docs.

After the installation and the setting of the paths, close the terminal and reopen a new terminal. This enables paths and configurations to be loaded.

Files and Libraries

Please download the database we’ll be using:

If you wish to access a database from R during the Workshop, ensure you have a recent version of RStudio (3.1 or greater): In RStudio, go to the Help tab and select Check for Updates. You also need to install the RSQLite Package: In RStudio, go to the Tools tab and select Install Packages….

From Repository (CRAN), search for and install “RSQLite”.