1

リレーショナル ソースから 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
4

1 に答える 1