Professional Documents
Culture Documents
Week 11 - Tut 10 Solutions
Week 11 - Tut 10 Solutions
7
Week 11 Wang Lipo elpwang@ntu.edu.sg 7
3. Assuming that the college stated in Question 2 now wants to include the following new data
about course sections:
• The department offering the course (each course is offered by only one department)
• The school to which the department reports (each department reports to only one school)
Change the star schema designed in Question 2 to cater for the new data.
8
Week 11 Wang Lipo elpwang@ntu.edu.sg 8
4. A manufacturing company needs a data warehouse to store
data for each fiscal period and summarize facts about the
following types of goods movement:
a) Transfer goods internally, i.e., between plants, and from
plants to storages;
b) Orders by customers from storages;
c) Returns of goods from customers to storages;
d) Purchases from vendors to plants
The company needs to treat customers, vendors, plants, and
storages as distinct dimensions that may be involved at either
end or both ends of a movement event, i.e., destination and/or
origin. For each type of destination or origin, the company
wants to know the name, city, and state. Facts about each
movement include dollar and volume moved, cost of movement,
and revenue collected from the move (if any, and this can be
negative for a return). Design a star schema to represent this
data warehouse directly (without generalization). Simplify the
resulting star schema through generalization.
The generalized fact table describes movements from one location to another,
and contains an origin key and a destination key. For example, if a customer
orders some items, the origin key would be a storage ID and the destination key
would be the CustomerID. TxnType (transaction type) will label the type of
transaction that occurred (i.e., order, return, transfer, purchase).
13
Week 11 Wang Lipo elpwang@ntu.edu.sg 13
5. An international pharmaceutical company operates a network of 300 chain drug
stores all over the world. The company is setting up a drug data warehouse to store
daily information for a period of 10 years for drug sales analysis. The total sales of
drugs (Total_Cost_Value and Total_Sales_Value) per day for each drug and for each
store should be kept in the data warehouse. There is an average of 50 different drugs
sold by each store per day. There are a total of 500 different drugs. On average, each
drug is sold 30 times per day. Data for the data warehouse are extracted from the
company database. There are three relevant tables in the database:
DRUG (Drug_ID, Drug_Name, Unit_Price, Unit_Cost)
SALES (Drug_ID, Store_ID, Sales_Date, Qty_Sold)
STORE (Store_ID, Address, Country)
b) Estimate the number of rows in the fact table in part 5(a).
Considering the stores, the estimated no of rows in the fact table = 300 stores *
50 drugs per store per day * 365 days per year * 10 years = 54,750,000 rows.
Alternatively, considering the drugs, the estimated no of rows in the fact table =
500 drugs * 30 times per day * 365 days per year * 10 years = 54,750,000 rows.