Data Analyst Portfolio
This project simulates a real-world analytics task for PrecisionCraft Industries. As part of an internal data engineering workflow, this repository contains the SQL logic and Python automation required to extract, transform, and prepare operational data for downstream machine learning modeling.
My responsibility was to design complex SQL queries connecting production, quality, and equipment logs, and automate the generation of a raw dataset ready for ETL pipelines.
- Company: PrecisionCraft Industries
- Department: Operations & Data Science
- Goal: Provide a consolidated dataset combining production runs, quality checks, and equipment maintenance logs to support a defect prediction model.
- Environment: Supabase (PostgreSQL) hosted database.
- All five core tables queried individually for validation.
- Aggregation queries calculated defect rates and efficiency by plant/shift.
- Complex JOIN query combined production runs with quality check results.
- Implemented CTEs and Window Functions to rank production runs by efficiency within each plant.
- Automated export via
python run.pyto generatedata/raw-data.csv. - Code structured, documented, and pushed to GitHub.
All queries target the manufacturing schema within the Supabase environment.
| Table | Description |
|---|---|
plants |
Location and capacity metadata |
products |
Product SKU information |
equipment |
Machine status and maintenance logs |
production_runs |
Batch records including efficiency metrics |
quality_checks |
Inspection results and defect flags |
| Category | Tools |
|---|---|
| Language | Python 3.x, SQL |
| Database | Supabase (PostgreSQL) |
| Client | DBeaver / VS Code Terminal |
| Automation | Python pandas, sqlalchemy (or similar) |
| Export | CSV Format |
- Python installed on your local machine
- A valid
.envfile configured with your Supabase Connection String - Dependencies listed in
requirements.txt
- Clone the repository:
git clone https://github.com/samuadesina/P02-manufacturing-sql/blob/main/README.md.git cd MANUFACTURING-SQL