{"id":29916496,"url":"https://github.com/shiven424/dth-data-warehouse","last_synced_at":"2025-08-02T05:02:45.578Z","repository":{"id":307348137,"uuid":"1029211245","full_name":"shiven424/DTH-Data-Warehouse","owner":"shiven424","description":"This repository provides a sample star‑schema data warehouse for Direct‑to‑Home (DTH) television services built for SQL Server Management Studio. It contains SQL scripts, CSV datasets, and example analytics queries for exploring subscriptions, churn, engagement, and advertising effectiveness.","archived":false,"fork":false,"pushed_at":"2025-07-30T18:45:51.000Z","size":9823,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T20:57:29.080Z","etag":null,"topics":["analytics","data-modeling","data-warehouse","etl","sql","sql-server","ssms","star-schema"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiven424.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-30T17:29:25.000Z","updated_at":"2025-07-30T18:45:54.000Z","dependencies_parsed_at":"2025-07-30T21:07:41.521Z","dependency_job_id":null,"html_url":"https://github.com/shiven424/DTH-Data-Warehouse","commit_stats":null,"previous_names":["shiven424/dth-data-warehouse"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/shiven424/DTH-Data-Warehouse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiven424%2FDTH-Data-Warehouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiven424%2FDTH-Data-Warehouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiven424%2FDTH-Data-Warehouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiven424%2FDTH-Data-Warehouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiven424","download_url":"https://codeload.github.com/shiven424/DTH-Data-Warehouse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiven424%2FDTH-Data-Warehouse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268337911,"owners_count":24234537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"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":["analytics","data-modeling","data-warehouse","etl","sql","sql-server","ssms","star-schema"],"created_at":"2025-08-02T05:00:46.931Z","updated_at":"2025-08-02T05:02:45.535Z","avatar_url":"https://github.com/shiven424.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# DTH Data Warehouse Analytics (SQL Server Edition)\n\nThis project provides a comprehensive sample data warehouse designed for Direct‑to‑Home (DTH) television service analytics. It includes SQL Server scripts to build a star schema, sample CSV datasets, analytical queries, and diagrams to explore churn analysis, customer engagement, advertising performance, and more.\n\n---\n\n## Table of Contents\n\n1. [Features](#features)\n2. [Project Structure](#project-structure)\n3. [Data Model](#data-model)\n4. [Setup Guide](#setup-guide)\n5. [Example Analytics](#example-analytics)\n6. [Diagrams](#diagrams)\n\n---\n\n## Features\n\n* **Self-contained SQL Scripts**\n\n  * `DW_Tables.sql` creates all required dimension, fact, and aggregated tables and includes ETL logic for monthly summaries.\n\n* **Sample Data for Instant Use**\n\n  * CSV files aligned with the schema enable direct loading without external data dependencies.\n\n* **Analytics Query Library**\n\n  * `Queries.sql` includes pre-built queries for churn analysis, customer loyalty scoring, content feedback, promotion impact, and cohort-based retention.\n\n* **Presentation \u0026 Documentation**\n\n  * ER diagrams, schema images, and a PowerPoint/PDF report describe the overall architecture and information flow.\n\n---\n\n## Project Structure\n\n```\nDTH-Data-Warehouse/\n├── DW_Tables.sql              # Schema creation \u0026 ETL\n├── Queries.sql                # Sample analytics queries\n├── customer_dimension.csv     # Sample dimension data\n├── plan_dimension.csv         # More CSVs for each table\n├── DWdiagrams/                # ER diagrams and visuals\n├── Schema.png                 # Star schema overview\n├── Report_Slides.pdf          # Documentation/presentation\n└── README.md                  # This file\n```\n\n\u003e All scripts and datasets are placed in the root directory for ease of use.\n\n---\n\n## Data Model\n\nThis project uses a **star schema** centered around subscription and engagement activities with rich supporting dimensions.\n\n### 📘 Dimension Tables\n\n| Table Name              | Description                                |\n| ----------------------- | ------------------------------------------ |\n| `Customer_dimension`    | Subscriber demographics \u0026 contact info     |\n| `Plan_dimension`        | Plan names, pricing, and included channels |\n| `Time_dimension`        | Date hierarchy (day, week, month, quarter) |\n| `Channel_dimension`     | Channel metadata and genres                |\n| `Content_dimension`     | Program or episode details                 |\n| `Reason_dimension`      | Reasons for churn or unsubscription        |\n| `Promotion_dimension`   | Promotional campaign metadata              |\n| `Event_dimension`       | Major events or seasonal triggers          |\n| `Ad_exposure_dimension` | Advertisement details and impressions      |\n| `Genre_dimension`       | Genre category mapping                     |\n\n### 📊 Fact Tables\n\n| Table Name                      | Description                              |\n| ------------------------------- | ---------------------------------------- |\n| `Subscription_fact`             | Subscription records and plan history    |\n| `Unsubscription_fact`           | Customer churn details with reasons      |\n| `Feedback_fact`                 | Feedback mapped to plans and channels    |\n| `Customer_engagement_fact`      | Ad exposure, content viewing, engagement |\n| `Monthly_aggregate_fact`        | Pre-computed monthly KPIs                |\n| `Series_monthly_aggregate_fact` | Series-level monthly summaries           |\n\n### Sample CSV Structure\n\nExample: `customer_dimension.csv`\n\n```\ncustomer_id, customer_name, customer_email, customer_address, customer_city, customer_zipcode\n```\n\nExample: `plan_dimension.csv`\n\n```\nplan_id, plan_name, plan_price, channel_package, plan_duration\n```\n\nThese column structures match insert orders used in the SQL scripts.\n\n---\n\n## Setup Guide\n\n### 1. Clone or Download the Repository\n\n```bash\ngit clone https://github.com/shiven424/DTH-Data-Warehouse\n```\n\nAlternatively, download the ZIP and extract it locally.\n\n---\n\n### 2. Create the Database\n\n* Open **SQL Server Management Studio (SSMS)**.\n* Execute `DW_Tables.sql` to:\n\n  * Create all dimension, fact, and aggregate tables.\n  * Optionally populate them with sample data.\n\n---\n\n### 3. Load CSV Data\n\nYou can load the sample CSVs into their respective tables using:\n\n* **SSMS Import Data Wizard**, or\n* `BULK INSERT` statements (included in `DW_Tables.sql`).\n\nExample tables:\n\n* `Customer_dimension`\n* `Plan_dimension`\n* `Channel_dimension`\n\n---\n\n### 4. Run ETL Logic\n\nRun the ETL section in `DW_Tables.sql` to populate:\n\n* `Monthly_aggregate_fact`\n* `Series_monthly_aggregate_fact`\n\nThese contain pre-computed KPIs for faster analytics.\n\n---\n\n### 5. Execute Analytics\n\n* Open `Queries.sql` in SSMS.\n* Run any of the provided analytical queries.\n\nExample analyses include:\n\n* Churn timing\n* Feedback sentiment\n* Promotion lift\n* Viewer engagement trends\n\n---\n\n### 6. Connect to BI Tools (Optional)\n\nYou can connect the database to a BI tool such as:\n\n* **Power BI**\n* **Tableau**\n* **Google Data Studio**\n\nUse them to create dashboards and visualize key metrics using the sample data.\n\n---\n\n## Example Analytics\n\n**Query: Average Days to Churn by Reason**\n\n```sql\nSELECT\n  r.reason_category,\n  r.reason_description,\n  ROUND(AVG(DATEDIFF(day, s.subscription_start_date, u.unsubscription_date)), 1) AS avg_days_to_unsub\nFROM Unsubscription_fact u\nJOIN Subscription_fact s\n  ON u.customer_id = s.customer_id\n  AND u.unsubscription_date BETWEEN s.subscription_start_date AND s.subscription_end_date\nJOIN Reason_dimension r\n  ON u.reason_id = r.reason_id\nGROUP BY r.reason_category, r.reason_description\nORDER BY avg_days_to_unsub DESC;\n```\n\nOther queries compute:\n\n* Channel loyalty scores\n* Promotion effectiveness\n* Viewer cohort behavior\n* Feedback trends by genre or content\n\n---\n\n## Diagrams\n\nNavigate to the `DWdiagrams/` folder to explore:\n\n* Star schema diagram\n* Information package visualizations\n* `Schema.png` for a quick overview\n\nThese assets assist in understanding relationships and metric derivations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiven424%2Fdth-data-warehouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiven424%2Fdth-data-warehouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiven424%2Fdth-data-warehouse/lists"}