简体   繁体   中英

How to set up a data warehouse using mysql

I have been trying to set up a data warehouse using ralph kimballs technique but I am having difficulty actually understanding how to load data into my tables. I have a sales_filev1.csv that contains the columns:

CUST_CITY_NM CUST_STREET_ADD CUST_POSTAL_CD CUST_STATE_CD CUST_NM CUST_NO CUST_PHONE_NO PROD_CAT_CD PROD_LN_CD PROD_NM PROD_PACKAGE_SIZE_NO SLS_PROMO_IN SLS_QTY_NO SLS_UNIT_PRICE_AM STORE_CITY_NM STORE_ESTABLISH_DT STORE_ID STORE_LVL_CD STORE_MGR_NM STORE_MGR_PHONE_NO STORE_NM STORE_NO STORE_POSTAL_CD STORE_STATE_CD STORE_STREET_AD SALES_DT

Then I have a CUST_LOOKUP.csv containing CUST_NO CUST_ID CUST_INCOME_AM CUST_CD

Then the last file is a product lookup: PROD_NM PROD_SKU_NO SLS_UNIT_COST_AM PROD_INTRO_DT PROD_ID

I understand that I need to do have a sales_fact table as well. However, would my sales_filev1 not be the sales fact since it contains all of the information about the customers, store and products purchased and when? Then I would just use a join and insert to add the data together?

You need to model your data dimensionally (if you are going to use a star schema) and decide the grain of your data, determine the measures that will go into the fact table(s) and the attributes that will reside in the dimension table(s).

A datawarehouse is not joining all the data you have together in one table. It is optimal for storage and reporting.

Have a read of Dimensional Modelling and perhaps purchase the excellent book by Ralph Kimball's DWH Toolkit .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM