Search code examples
modeling

How to model more that one product in a classic star schema?


I am building a classic star schema in a data warehouse for reporting.

My measure is Data(MB) per phone number per month.

My dimensions are Time, Product, Customer and Supplier.

My problem is that some customers have bought more than one product per phone number in some month.

Any ideas on how to implement this in a classic star schema?

Adding these columns to my fact table?

  • PRODUCT_1_FK
  • PRODUCT_2_FK
  • PRODUCT_3_FK

Regards,

Christian


Solution

  • Let's imagine this scenario :

    • Customer with ID =101 bought the product with ID=100 by phone , on 25 Jan 2021
    • The same Customer with ID=101 bought another product with ID=120 by phone, on 28 Jan 2021

    How would be in your Fact table?

    CustomerSK ProductSK SupplierSK TimeSK
    101        100       122        25-01-2021 09:00:30
    101        120       189        28-01-2021 16:08:11
    

    enter image description here