Overview
This notebook is intended to provide a non-comprehensive introduction to SQL and relational database concepts.
Specifically, it was created to show a person with some technical background but no familiarity with SQL everything needed to construct queries to address use cases like:
- Given a table of event logs associated with users, I need to see events triggered by a specific set of users
- Given a table of event logs associated with users, I need the set of users assocaited with a specific event recorded during a given period of time
To address these use cases, the document will cover:
- Basic relational database structure
SELECT
ing columns from a tableORDER
ing andLIMIT
ing column dataGROUP
ing and aggregating column data- Filtering results to show only columns
WHERE
the value matches one or more criteria, including beingIN
a given list JOIN
ing tables together
Setup
- Install JupyterLab if you haven't already
- Clone this repo
- Install other dependencies:
pip install -r requirements.txt
- Start the notebook:
jupyter-lab SQLBasics.ipynb
Viewing the notebook
Best viewed in (be patient, it will take a while for this link to fully load!)