I'm new in DW and I need to create a very simple warehouse for an e-commerce website.
Dimension tables
- date dimension table (id, year, quarter, month, day)
- time dimension table (id, hour, minute)
- product dimension table (id, product name, price, category id)
- product category dimension table (id, category name)
Fact table
- sales per product (date id, product id, sales count, price sum)
This fact table is suitable for questions like "How much products were sold in June" etc.
But I will need answer questions like "In which category were sold the most products in June?" or "What is the most business successful hour of the day on wednesdays?".
I see two possibilities:
- I can add new column (category id or time id) into product fact table. But this id will change table's granularity
- I can create another fact table for categories which will contains facts about categories. But this (in my opinion) is wasting disk space, isn't it?
Which possibility is correct?