我是数据仓库的新手,所以请容易在我身上。找出我的数据仓库中的维度表的数量
我想弄清楚在这种情况下的维数。
在我的交易数据库:
我有一个表,该表存储位置代码。列是
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