我是數據倉庫的新手,所以請容易在我身上。找出我的數據倉庫中的維度表的數量
我想弄清楚在這種情況下的維數。
在我的交易數據庫:
我有一個表,該表存儲位置代碼。列是
location_code int not null primary key, short_description varchar(10) not null, long_description varchar(100) not null
。我有一個存儲區域代碼的表。列是
region_code int not null primary key, short_description varchar(10) not null, long_description varchar(100) not null
。我有一個關聯位置和區域的表格。列是
assoc_id int not null primary key, location_code int not null, region_code int not null
。 1位置僅屬於1個地區。
在我的數據倉庫數據庫用戶可能希望按位置或按地區查找數據。
現在我期待在這種情況下,以創建維度表(一個或多個)。
想知道我應該創建2個維表(1位置和1區)這樣?
創建1代維度表的位置也有地區與這些列:
region_code int not null primary key, region_short_description varchar(10) not null, region_long_description varchar(100) not null, location_code int not null, location_short_description varchar(10) not null, location_long_description varchar(100) not null
OR:location_code int not null primary key, location_short_description varchar(10) not null, location_long_description varchar(100) not null, region_code int not null, region_short_description varchar(10) not null, region_long_description varchar(100) not null
的區域,該區域也具有與這些列位置創建1個維度表我要創建(對於地點區關聯,1區域的定位協會1位置,1區,1)這樣4個維度表?
與這些列創建位置1個維度表:
location_code int not null primary key, short_description varchar(10) not null, long_description varchar(100) not null
與這些列創建1代維度表的地區:
region_code int not null primary key, short_description varchar(10) not null, long_description varchar(100) not null
與這些列的位置區關聯創建1個維度表:
location_code int not null, region_code int not null
創建1代維度表與這些列區域的定位協會:
region_code int not null, location_code int not null
還是有另一種方式,也更有意義?如果是,請一定要告訴
在數據倉庫的世界裏,什麼樣的關係是這樣叫,什麼是處理它的標準方式?
感謝
這是哪個流程的業務視圖?要獲得有意義的答案,您應該解釋「數據」是什麼以及位置和區域是什麼。例如銷售是「數據」嗎?位置是屬於某個位置的地理位置嗎?地點可能重疊嗎? – momobo
@momobo數據是所有員工在特定位置工作的小時數。因此,例如位置L1的1500小時和位置L2的2400小時。位置是地理位置,位置不能重疊。一個地區有一個或多個地點。 1位置只能屬於1個地區。 – ChumboChappati