尝试设计涉及"租赁类型"的星型模式



我正在设计一个电影租赁数据仓库

我希望事实表包含电影租赁/退货,但我感到困惑。

电影可以在任何商店退货,所以我需要展示出来。

我有这些维度:时间、客户信息、电影信息和商店

如果它们是单独的记录,我看不到我会在哪里显示它是租赁还是退货?

我设计星形模式以显示此信息的选项是什么,我不知道该把它放在哪里,我的头快要爆炸了。

从事务级别开始,然后从那里构建...

FactMovieTransaction
    CustomerKey
    TransactionTypeKey
    StoreKey
    MovieKey
    DateKey
    TimeKey
    <fact 1>
    <fact 2>

DimCustomer
    CustomerKey
    CustomerID (ex. 0000123478)
    CustomerName (ex. Peter Anderson)
DimTransactionType
    TransactionTypeKey 
    TransactionType (ex. Return, Rental)
DimStore
    StoreKey
    StoreID (ex. 234, 212)
    StoreName (ex. BlockBuster#243, BlockBuster#212)
DimMovie
    MovieKey
    MovieName (ex. StarWars)
    MovieDescription
    Genere
DimDate
    DateKey
    Date (ex. 1/1/900 - 1/1/2999)
DimTime
    TimeKey
    Time (ex. 00:00 - 23:59)

最新更新