Skip to content

aa4958/sql-python-chicago-crime-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL + Python: Chicago Database Analysis (SQLite)

This repository demonstrates SQL + Python skills by:

  • loading 3 real-world CSV datasets into a SQLite database
  • running analysis queries (filters, joins, grouping, ordering)
  • pulling results into pandas for inspection

Project structure

sql-python-chicago-crime-analysis/
  README.md
  requirements.txt
  .gitignore
  data/
    ChicagoCensusData.csv
    ChicagoCrimeData.csv
    ChicagoPublicSchools.csv
  scripts/
    build_sqlite_db.py
  sql/
    queries.sql
  notebooks/
    01_sql_python_chicago.ipynb
  outputs/
    (generated locally; ignored by git)

Key skills demonstrated

  • SQLite database creation from CSVs (pandas.to_sql)
  • SQL: JOIN, GROUP BY, ORDER BY, LIMIT, LIKE, COUNT, AVG, CAST
  • Handling messy / non-standard column names (e.g., "Elementary, Middle, or High School")

Quick start (local)

  1. Create a virtual environment (optional) and install dependencies:

    pip install -r requirements.txt
  2. Build the database:

    python scripts/build_sqlite_db.py

    This creates outputs/Final.db.

  3. Run the notebook:

    jupyter notebook

    Open: notebooks/01_sql_python_chicago.ipynb

Notes for GitHub

  • outputs/ and *.db are ignored so your repo stays clean.
  • The CSVs in data/ are small enough to commit; if you ever add larger datasets, keep them out of git and document how to obtain them.

About

SQL + Python project: loading Chicago datasets into SQLite and querying them via SQL & Pandas

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors