A modern SQL Server data warehouse project built with a Medallion architecture (Bronze → Silver → Gold) to consolidate sales data from ERP + CRM source systems and deliver analytics-ready datasets for reporting and insights.
- Ingests raw CSV extracts from ERP and CRM source systems
- Loads raw data into a Bronze landing zone (traceability + debugging)
- Cleans and standardizes data in a Silver layer (ready for analysis)
- Publishes Gold reporting objects (views) with business logic and analytics models
- Source format: CSV files (files-in-folder interface)
- Object type: Tables
- Load method: Batch processing, full load (TRUNCATE + INSERT)
- Transformations: None (raw as-is)
- Object type: Tables
- Load method: Batch processing, full load (TRUNCATE + INSERT)
- Transformations include:
- Data cleansing
- Data standardization
- Data normalization
- Data enrichment
- Derived columns
In this project, the Gold layer is implemented as SQL views (no physical load step). It is where the warehouse becomes business-ready for BI/reporting and ad-hoc analysis.
Gold layer characteristics
- Object type: Views (semantic/reporting layer)
- Load method: None (views)
- Transformations: data integration, aggregations, business logic
Your Gold layer is designed to support three different data modeling outputs:
.png)
Gold objects
gold.dim_customersgold.dim_productsgold.fact_sales
This pattern keeps dimensions separate and connects them to a central fact table (standard star schema build).
This option produces one wide dataset where customer + product attributes are already joined onto each sales row.
Flat schema = “Star schema flattened” (fact + dims joined in one for BI convenience) excluding duplicated surrogate/dim keys
Typical Gold object examples
gold.vw_sales_wide(view)- or
gold.sales_wide(table)
Build Options
- Method 1: (2 LEFT JOINs in Gold):
Join
silver.crm_sales_detailswithgold.dim_customersandgold.dim_products - Method 2: (5 LEFT JOINs from Silver)
Join
silver.crm_sales_detailswithsilver.crm_cust_info(+ ERP customer/location tables as needed) andsilver.crm_prd_info(+ ERP category tables as needed) - Output one wide Gold object for BI tools and ad-hoc analysis
This option produces pre-aggregated reporting objects for faster dashboards (for example: by day/week/month, by product category, by customer segment, by country).
Typical Gold object examples
gold.vw_sales_dailygold.vw_sales_monthly_by_productgold.vw_customer_summary
These objects apply grouping/aggregation logic in Gold (still typically as views).
This project integrates two source systems:
- CRM (CSV extracts)
- ERP (CSV extracts)
From the data flow diagram, the pipeline follows this structure:
- CRM:
crm_sales_details,crm_cust_info,crm_prd_info - ERP:
erp_cust_az12,erp_loc_a101,erp_px_cat_g1v2
crm_sales_details,crm_cust_info,crm_prd_infoerp_cust_az12,erp_loc_a101,erp_px_cat_g1v2
- Dimensions:
dim_customers,dim_products - Fact:
fact_sales
The Gold layer is designed to support SQL-based analytics and reporting, including:
- Customer behavior insights
- Product performance analysis
- Sales trend reporting
Typical layout:
datasets/– source CSV files (ERP + CRM extracts)scripts/– DDL + stored procedures for Bronze/Silver/Golddocs/– diagrams and documentationtests/– validation scripts (optional)
- SQL Server (local or dev instance)
- SQL Server Management Studio (SSMS)
- Source CSV files for ERP + CRM
- Clone the repository.
- Place your ERP/CRM CSV files into the folder location expected by your load scripts.
- Run the DDL scripts to create schemas and tables for:
- Bronze tables
- Silver tables
- Gold views
- Execute the load stored procedures for Bronze and Silver (names may vary in your repo). Example:
EXEC bronze.load_bronze;EXEC silver.load_silver;
- Query the Gold views (star schema) for reporting and analytics.
- Bronze and Silver use full refresh loads (TRUNCATE + INSERT) to keep the warehouse aligned with the latest source extracts.
- Gold uses views (no physical load) to keep reporting logic centralized and easy to change.
MIT (see LICENSE).

