onionflower
作者onionflower·2012-03-30 21:07
软件开发工程师·HD

什么是Fact,什么是Dimension,来自KSR

字数 1377阅读 2537评论 0赞 0

原文地址:

http://cognosteacher.blogspot.com/2010/11/what-is-fact-table.html

http://cognosteacher.blogspot.com/2010/11/dimension-tables-are-also-tables-and.html

What is a Fact Table?
A fact table is also a Table in the database contains Facts (Measures such as quantity sold, revenue, account balance)  and foreign keys. ( These keys will be used to connect to various dimension tables such as Product, Time, Customer, Staff  to get information like product name, staff name, customer name etc..)

 

Take a look at the following Image.. The yellow shaded columns are fact columns and the remaining columns are key columns , which will be used to connect to dimension tables..

 

 

 


What are Dimensional Tables..?
Dimension Tables are also tables and contains descriptive information used to describe the rows in the fact table. look at the following fact table row....

 


There is no product Name, no staff name, no Customer name. With out  having these names, how do you describe the qty_sold as 1 and unit_sales_price as 200..?  We can't..!
By  looking prod_id (3), customer_id (5) in the product dimension and Customer dimension, we will get product name as "Santoor" and customer name  as "Jhon". So, by using dimensional tables we can describe fact rows with information such as product name, customer name etc..

 

 

 

 

 

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关问题

相关资料

X社区推广