Skip to content

analysislessons/Article_SQLitePractice

Repository files navigation

SQLite Practice – Traffic Violations Analysis

This project demonstrates how to work with a local SQLite database using Python. It covers creating schemas (DDL), loading data from CSV files, and performing SQL queries to analyze traffic violations. It includes both a Python script for automated data processing and a Jupyter Notebook for interactive exploration.

The project explores three entities:

  • Drivers: Information about individuals and their vehicle registration.
  • Traffic Violations: A log of violation events linking drivers to specific offenses.
  • Violations Details: A reference table for types of offenses, points, and fines.

🛠️ Technologies Used

  • Python 3.12
  • SQLite3: Built-in Python library for database operations.
  • Pandas: Data manipulation and analysis.
  • Anaconda/Conda: For environment and package management.
  • Jupyter Notebook: For interactive data exploration.

⚙️ Installation & Environment Setup

This project was created using Anaconda. To ensure all dependencies (like pandas and sqlite) are correctly installed and to avoid version conflicts, please use the provided environment.yml file to rebuild the virtual environment.

1. Rebuild the Environment

Open your terminal or Anaconda Prompt and run:

conda env create -f environment.yml

2. Activate the Environment

Once the installation is complete, activate the new environment:

conda activate sqlite_practice

(Optional) Register the Kernel for Jupyter

If you want to use this environment specifically within a global Jupyter installation, you can register it as a kernel:

python -m ipykernel install --user --name sqlite_practice --display-name "Python (sqlite_practice)"

3. Launch the Project

You can run the analysis script:

python sqlite_practice_script.py

Or explore the data interactively using the Jupyter Notebook:

jupyter notebook sqlite_practice.ipynb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors