Thursday, September 4, 2008

Same grain of facts

In the sales_fact table we have two facts: sales_amount and order_quantity. They're both numeric. The first one is in dollars; the second, a count.

For your reference I'm showing the DDL of the table here:

CREATE TABLE sales_fact (order_sk INT, customer_sk INT, product_sk INT, date_sk INT, sales_amount DEC(10,2), order_quantity INT);

The sales_amount fact is the total dollar amount of daily sales of each order, each customer, and each product, which is the grain of the fact. The other fact, the order_quantity, in the table must have the same grain.

No comments: