多到多维表库数据库

时间:2022-05-07 07:41:42

I need to find which category of books were the most borrowed. So, I have the following UML diagram.多到多维表库数据库

我需要找到哪一类的书是借得最多的。因此,我有下面的UML图。

So when making the dimension tables and fact table I've come up up with the following: 多到多维表库数据库

因此,在制作维度表和事实表时,我有以下几点:

But the Auth (dimension)association table doesn't seem right. Is there a mistake and how can I correct it? Edit: Probably Category and Publisher dimension tables shouldn't be there. They should be attached with book.

但是Auth(维度)关联表似乎不正确。有错误吗?我怎么改正?编辑:可能类别和发布者维度表不应该在那里。他们应该附在书里。

1 个解决方案

#1


2  

your dimensional model needs to be redesigned.

您的维度模型需要重新设计。

Fact table must be "Auth" with the following fields:

事实表必须包含以下字段:

  • Staff_ID
  • Staff_ID
  • Student_ID
  • Student_ID
  • Book_ID
  • Book_ID
  • Issued_Date
  • Issued_Date
  • Borrowed_Till
  • Borrowed_Till

Then you need 4 dimension tables:

然后需要4维表:

  • Staff (contains Staff key, Staff attributes, Library attributes)
  • Staff(包含人员密钥、员工属性、库属性)
  • Student (Student key, Student attributes)
  • 学生(学生钥匙,学生属性)
  • Book (Book key, Book attributes, Publisher, Category)
  • 图书(图书键、图书属性、出版商、类别)
  • Calendar (Date key, calendar attributes) you might need a second Calendar for Borrowed_Till.
  • 日历(日期键、日历属性)您可能需要Borrowed_Till的第二个日历。

#1


2  

your dimensional model needs to be redesigned.

您的维度模型需要重新设计。

Fact table must be "Auth" with the following fields:

事实表必须包含以下字段:

  • Staff_ID
  • Staff_ID
  • Student_ID
  • Student_ID
  • Book_ID
  • Book_ID
  • Issued_Date
  • Issued_Date
  • Borrowed_Till
  • Borrowed_Till

Then you need 4 dimension tables:

然后需要4维表:

  • Staff (contains Staff key, Staff attributes, Library attributes)
  • Staff(包含人员密钥、员工属性、库属性)
  • Student (Student key, Student attributes)
  • 学生(学生钥匙,学生属性)
  • Book (Book key, Book attributes, Publisher, Category)
  • 图书(图书键、图书属性、出版商、类别)
  • Calendar (Date key, calendar attributes) you might need a second Calendar for Borrowed_Till.
  • 日历(日期键、日历属性)您可能需要Borrowed_Till的第二个日历。