CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/Data Engineering & Analytics

πŸ“Š Data Engineering & Analytics Β· Database ERD

Sales Star Schema

A classic star schema for sales analytics: one fact table of order lines surrounded by date, customer, product, store and promotion dimensions.

More Data Engineering & Analytics templates

Drawing diagram…

What this diagram shows

  • Facts hold numbers, dimensions hold descriptions
  • Customer history is kept with slowly changing dimension fields
  • A date dimension makes fiscal-year reporting easy

Prompt used

Star schema for retail sales: a fact_sales table with one row per order line (quantity, net amount, discount, cost) linked to dim_date, dim_customer (with valid_from and valid_to for history), dim_product, dim_store and dim_promotion.

Mermaid code
erDiagram
  DIM_DATE ||--o{ FACT_SALES : "sold on"
  DIM_CUSTOMER ||--o{ FACT_SALES : buys
  DIM_PRODUCT ||--o{ FACT_SALES : "sold as"
  DIM_STORE ||--o{ FACT_SALES : "sold at"
  DIM_PROMOTION ||--o{ FACT_SALES : applies
  FACT_SALES {
    bigint sales_key PK
    int date_key FK
    int customer_key FK
    int product_key FK
    int store_key FK
    int promotion_key FK
    int quantity
    decimal net_amount
    decimal discount
    decimal cost
  }
  DIM_DATE {
    int date_key PK
    date full_date
    string month
    string fiscal_quarter
    boolean is_holiday
  }
  DIM_CUSTOMER {
    int customer_key PK
    string customer_id
    string city
    string segment
    date valid_from
    date valid_to
  }
  DIM_PRODUCT {
    int product_key PK
    string sku
    string category
    string brand
  }
  DIM_STORE {
    int store_key PK
    string name
    string region
  }
  DIM_PROMOTION {
    int promotion_key PK
    string name
    string type
  }

Related templates

C4 ArchitectureProData Engineering & Analytics

Modern Data Platform Architecture

A typical modern data stack: data is loaded from apps and SaaS tools into a cloud warehouse, modelled with dbt, orchestrated with Airflow and served to BI dashboards.

Data FlowData Engineering & Analytics

Change Data Capture Pipeline

How every insert, update and delete in an operational database is streamed to the data lake and search index in near real time using change data capture.

FlowchartData Engineering & Analytics

Nightly Batch ETL Workflow

The steps of a nightly batch pipeline with data quality gates: extract, validate, transform, load and publish, stopping safely when checks fail.

DeploymentProData Engineering & Analytics

Real-time Streaming Analytics Deployment

Where a real-time analytics stack runs: Kafka for events, Flink for stream processing, a real-time OLAP database and live dashboards.

State MachineData Engineering & Analytics

Data Pipeline Run States

The states of a single pipeline run in an orchestrator like Airflow, including retries, upstream failures and manual reruns.

Data FlowData Engineering & Analytics

Data Lake Zones (Bronze, Silver, Gold)

The medallion pattern for a data lake: raw data lands in bronze, is cleaned in silver, and turned into business-ready tables in gold.