Skip to content

samuadesina/P02-manufacturing-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏭 Manufacturing SQL Analysis

Data Analyst Portfolio


📌 Project Overview

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.


🏢 Business Context

  • 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.

🎯 Success Criteria Met

  • 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.py to generate data/raw-data.csv.
  • Code structured, documented, and pushed to GitHub.

🗂️ Database Schema

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

🛠️ Tech Stack

Category Tools
Language Python 3.x, SQL
Database Supabase (PostgreSQL)
Client DBeaver / VS Code Terminal
Automation Python pandas, sqlalchemy (or similar)
Export CSV Format

🚀 Getting Started

Prerequisites

  • Python installed on your local machine
  • A valid .env file configured with your Supabase Connection String
  • Dependencies listed in requirements.txt

Installation

  1. Clone the repository:
    git clone https://github.com/samuadesina/P02-manufacturing-sql/blob/main/README.md.git
    cd MANUFACTURING-SQL

About

**Manufacturing SQL Extraction Pipeline** — connects to a Supabase PostgreSQL database, queries production and quality data across multiple tables using CTEs and window functions, and exports a joined dataset to CSV for downstream ETL processing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages