This repository contains the materials for D-Lab’s SQL Fundamentals workshop series.
No prior experience with SQL or Python is required.
Check D-Lab's Learning Pathways to figure out which of our workshops to take!
This workshop introduces the fundamentals of SQL, with a focus on using SQLite (the most ubiquitous database on the planet) for data science tasks. We'll explore how SQL can be used to query and manipulate relational databases. This hands-on workshop includes exercises based on real-world datasets.
After completing SQL Fundamentals, you will be able to:
- Navigate and understand the structure of a relational database.
- Become familiar with relational database concepts.
- Have basic understanding of SQL syntax (e.g.,
SELECT
,FROM
,WHERE
clauses). - Write SQL queries to select, filter, and sort data.
- Perform complex joins between tables to retrieve related data.
- Use aggregate functions to summarize data.
This workshop does not cover the following:
- Cloud Databases or Database Servers. This is covered in Cloud SQL Databases for Social Media Data.
SQL Fundamentals is a 2 hour workshop, and is delivered in a lecture-style coding walkthrough interrupted by challenge problems and a break. Instructors and TAs are dedicated to engaging you in the classroom and answering questions in plain language.
- Part 1: SQLite Installation
- Part 2: Simple SQLite Queries
- Part 3: Northwind Database Overview
- Part 4: Northwind SQLite Exercises
Before attending the workshop, you should install Python and Jupyter to your computer. If you need help, please submit a consulting request with D-Lab prior to the start of the workshop.
Then follow the steps in the installation instructions notebook
If you do not have Anaconda installed and the materials loaded on your workshop by the time it starts, we strongly recommend using the UC Berkeley Datahub to run the materials for these lessons. You can access the DataHub by clicking this button:
The DataHub downloads this repository, along with any necessary packages, and allows you to run the materials in a Jupyter notebook that is stored on UC Berkeley's servers. No installation is necessary from your end - you only need an internet browser and a CalNet ID to log in. By using the DataHub, you can save your work and come back to it at any time. When you want to return to your saved work, just go straight to DataHub, sign in, and you click on the SQL-Fundamentals
folder.
If you don't have a Berkeley CalNet ID, you can still run these lessons in Binder, which is another cloud-based option. Click this button:
Note: Using Binder, you unfortunately cannot save your work.
D-Lab works with Berkeley faculty, research staff, and students to advance data-intensive social science and humanities research. Our goal at D-Lab is to provide practical training, staff support, resources, and space to enable you to use R for your own research applications. Our services cater to all skill levels and no programming, statistical, or computer science backgrounds are necessary. We offer these services in the form of workshops, one-to-one consulting, and working groups that cover a variety of research topics, digital tools, and programming languages.
Visit the D-Lab homepage to learn more about us. You can view our calendar for upcoming events, learn about how to utilize our consulting and data services, and check out upcoming workshops.
Here are other Python workshops offered by the D-Lab:
- Aaron Culich