customer: cid, cust_name, city, state

Kingdom of Saudi Arabia
Ministry of higher education
Princess Norah Bent Abdul Rahman University
Information technology department
Data Warehouse and Data Mining
Assignment #1
Student Name:_______________________________________________
Student ID:__________________________________________________
Class Section:________________________________________________
Instructor: __________________________________________________
Q1
Q2
Q3
Q4
Q5
Total
Instruction:




Assignment should be done in groups of 3 students.
Submission due date Tuesday 3rd November.
Your Assignment is not accepted after the due date.
Each Group is expected to do their own Assignment. Otherwise, the penalty for
cheating is a grade of zero and you will be referred to Disciplinary Committee.
Question 1:
Consider the following E/R diagram, modeling data about patients in a hospital:
The executive manager at hospital said that he wants to have analysis about patient’s
registration system to support their strategic marketing plan.
He wants to know how many patients have resided in their hospital for specific period
of time such as by day, month, quarter and year.
1. Create a complete information package diagram for the information given in the ER
diagram.
2. Create a star schema for the information showing all dimension tables, fact tables,
attributes, and the relationships between the tables. Identify key attributes and
relationship cardinalities, you may add new attributes for each dimension if
necessary.
3. Suppose patient Omar Hassan was entered as Amer Hassan, and we want to update
his data. What type of update is this? How would you update the patient dimension
table? Show the new dimension table and its attributes.
4. Suppose that patient named Ahmad was transferred from a single-typed room to
double-typed room due to another emergency which has required a single-typed
room due to the critical status of patient named Zaid. How would you update the
bed dimension table. Show the new dimension table and its attributes.
5. How many joins (based on the star schema) would be needed to answer the
following query: What is the total number of patients who have Diabetes and
treated by Dr.Salem? Explain briefly.
6. How many joins (based on the star schema) would be needed to answer the
following query: What is the total number of patients who have been treated by
Dr.Salem at the last 5 month? Explain briefly.
Question 2:
Find the errors in the following diagram
ABC Company has a legacy sales system with the following relations:
CUSTOMER: CID, CUST_NAME, CITY, STATE
PRODUCT: PID, PROD_NAME
ORDER: OID, ORDER_DATE, CID
PAYMENT: PAY_ID, PAY_NAME (Note: PAYMENT includes cash, credit, and
check etc.)
ORDER_LINE: OID, ORDER_LINE#, QUANTITY, PRICE, PID, PAY_ID
The company has developed a DW with star schema as illustrated above.
From the DW, managers of ABC want to know:


In any year, how much sales ($) get paid by Check?
In any month, what is the total amount of sales ($) for product A?
Question 3:
In a Shipment tracking for a distribution company, the following dimension tables were
created: (1) time, (2) customer ship-to, (3) ship-from, (4) product, (5) type of deal, and
(6) mode of shipment. Review these dimensions and list the possible attributes for each
dimension table. Also, designate a primary key for each table.
Question 4:
abcd-
What is the name of the following schema?
How many data mart are there? Explain your answer?
Draw the individual snowflakes represented in this schema.
Draw the star schema (de-normalized) for each data mart.
Question 5:
Look to the following star schema then answer the questions below:
1. Suppose Market dimension has 30 rows , Market product dimension has 100 rows
and promotion has 12 rows,
a. What is the maximum number of rows that will be added to the fact table each
day?
b. What is the maximum number of rows that will be added to the fact table each
year?
2. For the following queries, what is the maximum number of rows that will be
displayed/returned?
a. Units of products that have been sold at specific day from a specific market.
b. Units for specific product that have been sold with promo ID 3322 at specific
region each weekday.
c. Dollars amount for each region at specific date.