如何從關係源填充Dim_tbls?加載維度表後的邏輯
這些例子表給出:
tbl_sales: id_sales, fk_id_customer, fk_id_product, country, timestamp
tbl_customer: id_customer, name, adress, zip, city
tbl_product: id_product, price, product
我的目標是讓這些屬性進入啓動模式。我遇到的問題是加載維度表的邏輯。我的意思是,我會將什麼數據加載到Dim_Product中?所有tbl_product產品?但是,我怎麼知道有多少銷售是用特定的產品完成的?
分析我想這樣做是:
How many people bought product x.
How many sales are made from city x.
How many sales were made between Time x and y.
示例數據:
tbl_sales: id_sales | fk_id_customer | fk_id_product | country | timestamp
1 | 2 | 1 | UK | 19.11.2013 10:23:22
2 | 1 | 2 | FR | 20.11.2013 06:04:22
tbl_customer: id_customer | name | adress | zip | city
1 | Frank|Street X| 211 | London
2 | Steve|Street Y| 431 | Paris
tbl_customer: id_product| Price | product
1 | 100,00| Hammer
2 | 50,00| Saw
是的。正如我所說,這只是一個例子。 – user2428207