{"id":50547343,"url":"https://github.com/royungar/datawarehouse_waste_management_project","last_synced_at":"2026-06-04T00:01:34.286Z","repository":{"id":306434083,"uuid":"1025082199","full_name":"royungar/DataWarehouse_Waste_Management_Project","owner":"royungar","description":"PostgreSQL-based data warehouse project for a Brazilian solid waste management company. Uses a star schema, advanced SQL (GROUPING SETS, ROLLUP, CUBE), and materialized views for multidimensional reporting.","archived":false,"fork":false,"pushed_at":"2025-07-28T00:53:36.000Z","size":1852,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T02:35:07.001Z","etag":null,"topics":["analytical-queries","data-analytics","data-engineering","data-modeling","data-warehouse","etl","ibm","pgadmin","postgresql","sql","star-schema"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/royungar/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/royungar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-23T17:34:48.000Z","updated_at":"2025-07-28T00:53:39.000Z","dependencies_parsed_at":"2025-07-28T01:02:48.861Z","dependency_job_id":null,"html_url":"https://github.com/royungar/DataWarehouse_Waste_Management_Project","commit_stats":null,"previous_names":["royungar/waste_management_datawarehouse_project","royungar/datawarehouse_waste_management_project"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/royungar/DataWarehouse_Waste_Management_Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royungar%2FDataWarehouse_Waste_Management_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royungar%2FDataWarehouse_Waste_Management_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royungar%2FDataWarehouse_Waste_Management_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royungar%2FDataWarehouse_Waste_Management_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/royungar","download_url":"https://codeload.github.com/royungar/DataWarehouse_Waste_Management_Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royungar%2FDataWarehouse_Waste_Management_Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33884734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytical-queries","data-analytics","data-engineering","data-modeling","data-warehouse","etl","ibm","pgadmin","postgresql","sql","star-schema"],"created_at":"2026-06-04T00:01:33.490Z","updated_at":"2026-06-04T00:01:34.278Z","avatar_url":"https://github.com/royungar.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Warehouse – Solid Waste Management Project – IBM Data Engineering Professional Certificate\n\n## Overview\n\nThis project demonstrates the design and implementation of a data warehouse for a Brazilian solid waste management company.\nThis warehouse supports waste collection performance analysis across time, geography, and vehicle dimensions.\nThe project models operational waste collection data using a star schema in PostgreSQL, enabling analytical queries across time, location, and vehicle dimensions.\nIt was completed as the final project for **Course 9 – Data Warehouse Fundamentals** in the [IBM Data Engineering Professional Certificate](https://www.coursera.org/professional-certificates/ibm-data-engineer).\n\n---\n\n## Objectives\n\n- Design a star schema optimized for analytical queries\n- Create dimension and fact tables in PostgreSQL using pgAdmin\n- Load operational data from CSV files into the database\n- Write analytical SQL queries using `GROUPING SETS`, `ROLLUP`, and `CUBE`\n- Create a materialized view to improve query performance\n\n---\n\n## Tools \u0026 Technologies\n\n| Category         | Tools/Technologies  |\n| ---------------- | ------------------- |\n| **Database**     | PostgreSQL, pgAdmin |\n| **Languages**    | SQL                 |\n| **File Formats** | CSV                 |\n\n---\n\n## Data Warehouse Schema\n\nThe schema uses a star design with one fact table and four dimension tables:\n\n### Dimension Tables\n\n- **DimDate**: Stores date breakdowns (year, month, day, weekday, etc.)\n- **DimTruck**: Stores truck identifiers and types\n- **DimStation**: Stores collection station IDs and associated cities\n- **DimWaste**: Stores waste category types\n\n### Fact Table\n\n- **FactTrips**: Captures waste collection trips with date, station, truck, and amount of waste collected\n\n---\n\n## Data Files\n\nAll CSVs were provided through IBM Skills Network:\n\n- `DimDate.csv`\n- `DimTruck.csv`\n- `DimStation.csv`\n- `FactTrips.csv`\n\n---\n\n## Implementation Steps\n\n### 1. Database Setup\n\n- Created a PostgreSQL database in pgAdmin\n- Defined tables with `PRIMARY KEY` and `FOREIGN KEY` constraints to maintain referential integrity\n\n### 2. Schema Creation\n\n- Created `DimDate`, `DimTruck`, `DimStation`, and `DimWaste` tables using SQL `CREATE TABLE` statements\n- Defined `FactTrips` with foreign keys referencing each dimension\n\n### 3. Data Loading\n\n- Imported all CSV files using pgAdmin's Import feature\n- Validated successful data loads and relationships\n\n### 4. Aggregation Queries\n\nUsed SQL aggregation clauses for multidimensional reporting:\n\n#### GROUPING SETS\n\n- Summarized total waste collected by combinations of station and truck type\n- Enables flexible reporting across one or multiple dimensions\n\n#### ROLLUP\n\n- Produced hierarchical aggregates (year \u003e city \u003e station)\n- Supports drill-down reports by time and geography\n\n#### CUBE\n\n- Generated average waste metrics across all combinations of year, city, and station\n- Facilitates full cross-dimensional waste analysis\n\n### 5. Materialized View\n\n- Created `max_waste_stats` to precompute the maximum waste collected per city, station, and truck type\n- The view enables faster reporting on high-volume collection combinations\n\n---\n\n## Results \u0026 Benchmarks\n\n- **Warehouse query performance:** Reduced “maximum waste collected per city/station/truck” query time from ~73.8 ms to ~1 ms by using a PostgreSQL materialized view (**~98.6% faster**).\n- **Warehouse scale (repo data):** 106,400 fact rows; 350 dates; 71 trucks; 19 stations.\n- **Repro notes:** Times measured locally with `\\timing on` in psql; materialized view defined as `max_waste_stats`.\n\n---\n\n## Sample Reports Enabled by Warehouse\n\n- Total waste collected per truck type and station\n- City-wide waste collection trends across time\n- Highest volume truck/station combinations\n- Average waste collected per station\n\n---\n\n## Repository Structure\n\n```plaintext\nDataWarehouse_Waste_Management_Project/\n├── README.md                        # Project overview, schema, SQL tasks, and usage\n├── data/\n│   ├── DimDate.csv                  # Calendar and weekday data\n│   ├── DimTruck.csv                 # Truck type identifiers\n│   ├── DimStation.csv               # Station and city mapping\n│   └── FactTrips.csv                # Waste collection fact data\n├── images/                          # Screenshots showing schema, queries, and output\n│   ├── schema_erd.png               # ERD showing all 5 tables and relationships\n│   ├── grouping_sets_query.png      # GROUPING SETS query output\n│   ├── rollup_query.png             # ROLLUP query output\n│   ├── cube_query.png               # CUBE query output\n│   └── mview_creation.png           # Materialized view creation confirmation\n├── sql/\n│   ├── schema/                      # CREATE TABLE scripts for all dimension and fact tables\n│   │   ├── DimDate.sql              # Creates DimDate table\n│   │   ├── DimStation.sql           # Creates DimStation table\n│   │   ├── DimTruck.sql             # Creates DimTruck table\n│   │   ├── DimWaste.sql             # Creates DimWaste table\n│   │   └── FactTrips.sql            # Creates FactTrips table with foreign keys\n│   ├── aggregation_queries/         # GROUPING SETS, ROLLUP, and CUBE queries\n│   │   ├── grouping_sets.sql        # Aggregates waste by station ID and truck type\n│   │   ├── rollup.sql               # Summarizes waste hierarchically by year, city, and station\n│   │   └── cube.sql                 # Computes average waste across all dimensions\n│   └── materialized_views/          # Materialized view creation script\n│       └── max_waste_stats.sql      # Computes max waste by city, station, and truck\n```\n\n---\n\n## License\n\nThis project was completed as part of the IBM Data Engineering Professional Certificate and is intended for educational use.\n\n## Links\n\n- Course Page - [Data Warehouse Fundamentals](https://www.coursera.org/learn/data-warehouse-fundamentals)\n- [GitHub Profile](https://github.com/royungar)\n- [GitHub Repository](https://github.com/royungar/DataWarehouse_Waste_Management_Project)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyungar%2Fdatawarehouse_waste_management_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyungar%2Fdatawarehouse_waste_management_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyungar%2Fdatawarehouse_waste_management_project/lists"}