I have the following dataset ready to load to a data warehouse:
CUSTOMER_KEY | PRODUCT_KEY | PRODUCT_DESCRIPTION | DATE | VOLUME | AMOUNT
I am confused with the Date dimension. The date format in the dataset is 'YYYY-MM-DD'. I want to create a dimension for date with year, month and day instead of having just the date in the FACT_SALES table.
For example, would this star schema work?
FACT_SALES: CUSTOMER_KEY (PK), PRODUCT_KEY (FK), DATE (FK), VOLUME, AMOUNT
DIM_PRODUCT: PRODUCT_KEY (PK), PRODUCT_DESCRIPTION
DIM_DATE: DATE (PK), YEAR, MONTH, DAY
When I load my dataset to the data warehouse (where the Date column is in 'YYYY-MM-DD' format), will the YEAR, MONTH and DAY be automatically populated based on the star-schema design I created?
Or do I need to create YEAR, MONTH and DAY columns in the dataset before loading it to the data warehouse?