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
SELECTing columns from a tableORDERing andLIMITing column dataGROUPing and aggregating column data- Filtering results to show only columns
WHEREthe value matches one or more criteria, including beingINa given list JOINing tables together
- 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
Best viewed in (be patient, it will take a while for this link to fully load!)