An end-to-end SQL Server Data Warehouse solution built using the Medallion (Bronze → Silver → Gold) Architecture. This project integrates disparate data from CRM and ERP source systems, cleanses and standardizes raw inputs, models data into an optimized Star Schema, and generates analytical views for business decision-making.
CRM & ERP CSV Files
│
▼
🥉 Bronze Layer
(Raw Data Ingestion)
│
▼
🥈 Silver Layer
(Cleansing & Standardization)
│
▼
🥇 Gold Layer
(Dimensional Modeling / Star Schema)
│
▼
📊 Customer & Product Analytics
- Database Engine: Microsoft SQL Server
- Language: T-SQL
- Interface / IDE: SQL Server Management Studio (SSMS)
- Data Modeling: Star Schema (Dimensional Modeling)
- Database Objects: Stored Procedures, Views, DDL/DML Scripts
- Data Ingestion:
BULK INSERT/ CSV Handling
├── data/
│ ├── source_crm/ # Raw CRM source files
│ └── source_erp/ # Raw ERP source files
│
└── scripts/
├── init_database.sql # Database & schema initialization
├── script_bronze/ # Bronze layer DDL & ingestion procedures
│ ├── ddl_bronze.sql
│ └── proc_load_bronze.sql
├── script_silver/ # Silver layer DDL & transformation procedures
│ ├── ddl_silver.sql
│ └── proc_load_silver.sql
├── script_gold/ # Gold layer dimensional views
│ └── ddl_gold.sql
└── script_analytical/ # Business analytics & KPI reports
└── basic_data_analysis.sql
└── advance_data_analysis.sql
└── reports_data_analysis.sql
- Purpose: Ingests raw data from source systems (CRM & ERP) without altering data types or applying business rules.
- Method: Automated loading via
BULK INSERTthrough stored procedures. - Key Files:
script_bronze/ddl_bronze.sqlscript_bronze/proc_load_bronze.sql
- Purpose: Transforms raw data into clean, structured, and consistent tables.
- Operations Performed:
- Trimming whitespace and standardizing casing.
- Handling missing, null, and duplicate values.
- Date format parsing and data type validation.
- Normalizing customer, product, and transactional attributes.
- Key Files:
script_silver/ddl_silver.sqlscript_silver/proc_load_silver.sql
- Purpose: Exposes analytics-ready reporting views structured into a Star Schema.
- Schema Design:
- Dimensions:
gold.dim_customersgold.dim_products
- Fact:
gold.fact_sales
- Dimensions:
- Key Files:
script_gold/ddl_gold.sql
The reporting layer computes high-level executive KPIs and deep customer/product intelligence:
| Category | Key Metrics & Reports |
|---|---|
| Sales Performance | Total Revenue, Total Orders, Units Sold, Average Order Value (AOV) |
| Customer Insights | Customer Lifespan, Recency/Frequency, Average Monthly Spend, Customer Segmentation |
| Product Analytics | Product Performance, Top/Bottom Selling Items, Category Revenue Contribution |
- Initialize Database:
- Run
scripts/init_database.sqlto create the warehouse database and required schemas (bronze,silver,gold).
- Run
- Setup Bronze Layer:
- Execute
script_bronze/ddl_bronze.sqlto create raw staging tables. - Execute
script_bronze/proc_load_bronze.sqland run the procedure to ingest raw CSV data.
- Execute
- Setup Silver Layer:
- Execute
script_silver/ddl_silver.sqlto create cleansed tables. - Execute
script_silver/proc_load_silver.sqlto transform, standardize, and load clean data.
- Execute
- Setup Gold Layer:
- Execute
script_gold/ddl_gold.sqlto create dimension and fact views.
- Execute
- Run Analytics:
- Execute the scripts in
script_analytical/to generate business reports and analytical insights.
- Execute the scripts in
Chethan Prabhas
Data Engineering | SQL | Python | Azure | Databricks