Intro to SQL

Intro to SQL

Course Description

Data that we need to utilize and query is often stored in data sources such as databases or data warehouses. In this course, you will learn how to connect and query databases using Structured Query Language (SQL). In particular, we will focus on querying data in a commonly used data model for storing patient data called OMOP. By the end of this course, you will be prepared to construct complex queries to retrieve large data sets and automate these queries to produce automated reports and dashboards.

Learning Objectives

  • Explain data sources such as Databases and how to connect to them
  • Query data sources using database engines and Structured Query Language (SQL) to filter, join, and aggregate data
  • Construct and calculate new fields using SELECT or CASE WHEN
  • (optional) Read and explain a sample OMOP query: https://github.com/OHDSI/OMOP-Queries/tree/master

Instructors

If you need to schedule some time to talk, please schedule with Ted.

  • Ted Laderas, Director of Training and Community, Office of the Chief Data Officer
  • Vivek Sriram, Data Scientist, Office of the Chief Data Officer

Introductions

In chat, please introduce yourself:

  • Your Name & Your Group
  • What you want to learn in this course
  • Favorite Winter activity

Tentative Schedule

All classes are on Fridays from 12:00-1:30 PM PST. Connection details will be provided. Office hours related to each class day are posted below, and the invite will be sent to you.

In class we will be going through the Quarto Notebooks that are hosted on Posit.cloud. No knowledge of R is necessary, we’ll show you what you need to know in class.

Classes will be recorded, and those recordings will be sent to you after each class.

Week Date Subject Office Hours
Pre-class —- Concepts of Databases
1 Feb 7 Intro to SQL; SHOW TABLES, DESCRIBE, SELECT, WHERE Feb 11
2 Feb 14 JOINing tables, more WHERE Feb 25
- Feb 21 No class (school break week) No office hours
3 Feb 28 Calculating new fields, GROUP BY, CASE WHEN, HAVING Mar 4
4 Mar 7 Subqueries/Views, Recap of course / review OMOP queries No office hours

Format of Class

I will teach online only, though you have the option of attending in the DaSL Lounge (Arnold M1-B406), which will have snacks and drinks available. Either Chris Lo or Vivek Sriram will host in person.

We will spend the first 20-25 minutes of each class on catching up on last week’s exercises if you haven’t had the opportunity to work on them. Followed by that, we will have a short lecture/lab, where we will go through the notebooks for the week.

First Class Survey

First Class Survey - Please fill out. We mostly want to see how confident you are before and after class. We will share these results with everyone (anonymized).

Weekly Check In

Weekly Check In Form - please fill out to let us know if you have any issues or want to share what you’ve learned. We look at the answers in aggregate and we anonymize responses (unless you want us to know).

Posit Cloud Intro

Here is a short video introducing you to the Posit Cloud interface.

Culture of the course

  • Learning on the job is challenging
    • I will move at learner’s pace; we are learning together.
    • Teach not for mastery, but teach for empowerment to learn effectively.

We sometimes struggle with our data science in isolation, unaware that someone two doors down from us has gone through the same struggle.

  • We learn and work better with our peers.
  • Know that if you have a question, other people will have it.
  • Asking questions is our way of taking care of others.

We ask you to follow Participation Guidelines and Code of Conduct.

Available Course Formats

This course is available in multiple formats which allows you to take it in the way that best suites your needs.

  • The material for this course can be viewed without login requirement on this website. This format might be most appropriate for you if you rely on screen-reader technology.
  • The material is also available to Fred Hutch Consortia students via Posit Cloud.
  • Our courses are open source, you can find the source material for this course on GitHub.