Professional Documents
Culture Documents
Suppose that a data warehouse contains three dimensions date, doctor and patient. There
is only measure – charge where charge is the fee that a doctor charges to a patient for a
visit. Design a star schema for the data warehouse, assuming some concept hierarchy for
each dimension. Starting with the base cuboid [date, doctor, patient], which sequence of
OLAP operations do you need to list the total fee collected by each doctor in the year
2002?
Exercise-II
With respect to the above business scenario, answer the following questions. Clearly state
any reasonable assumptions you make.
a. Design a star schema for the data warehouse clearly identifying the fact table(s),
dimensional table(s), their attributes and measures along with the primary key and
foreign key relationships.
b. Write an SQL query by which you can display region-wise, bank-wise, year-wise total
amount of loans disbursed from your schema.
c. Starting with the base cuboid, if we want to see the amount of loan disbursed during
the year 2000 for the state of Maharashtra, which sequence of OLAP operations would
you need to perform?
Exercise-III
Consider the following business scenario. A telecom company plans to maintain a CRM
data warehouse. There are 10 million customers of the company. Besides the usual
attributes, the company wants to maintain additional demographic information like
literacy percentage, male/female ratio, average life expectancy and average income of the
people belonging to the state to which each customer belongs. The company also wants
to maintain information about the age group, income level and marital status of its
customers. They also need to run queries like the number of married and unmarried
customers they have at any point in time.
a. Design an efficient data warehouse schema that satisfies the above business scenario.
Clearly identify the fact table(s), dimension table(s), primary key(s) and foreign key(s).
b. Write an SQL statement that generates the number of married and unmarried
customers that the company has today.
Exercise-IV
An insurance company, with branches all over the country, wants to develop a data
warehouse for effective decision-making about their insurance policies. There are a
number of different types of insurance like Auto insurance, Home insurance, Industrial
insurance, etc. The entire country is categorized into four regions, namely, North, South,
East and West. Each region consists of a set of states. There may be different types of
customers like individuals, institution, industry, etc. The data warehouse should record an
entry for each policy issued to each customer along with the premium paid.
With respect to the above business scenario, answer the following questions. Clearly state
any reasonable assumptions you make.
Exercise-V
A chain of departmental stores called “India-Mart” having operations only in India, plans
to develop a data warehouse for effective decision-making about their sales and different
promotion schemes. India-Mart puts some of their products on promotional sales from
time to time. There may be a large number of different types of promotions like coupon
sales, end-of-the-aisle display, buy-two-get-one-free, etc.
India-Mart would like to analyze how item sale is affected by the promotions at
each store, in each state and across the entire country.
With respect to the above business scenario, answer the following questions.
[15+5+5+5+5+5]
a. Design a star schema for the data warehouse clearly identifying the fact table(s),
dimension table(s), their attributes and measures along with the primary key and foreign
key relationships.
b. Write an SQL query by which you can display year-wise, promotion-wise, product-
wise total sales in the entire country from your schema.
c. Draw a cuboid that would display the result of the query specified in Q. b above.
d. From the cuboid of Q. c above, if we want to find the total amount of promotional
sales made during the years 2002 and 2003 for the states of Karnataka and Maharashtra,
which sequence of OLAP operations would you need to perform?
e. Draw possible schema hierarchies for each dimension that you have designed.
f. Based on the schema hierarchies drawn in Q. e above, determine the total number of
cuboids, considering all the aggregation levels.
Exercise-VI
A university plans to build a data warehouse that would help them in analyzing the
peformance of the students in various courses in different academic sessions. They want
to analyze if there is any relation between the average grade of a course and the number
of students attending it. They would also like to know if there were some courses offered
but did not have any students registered for them. Relative performance among boys and
girls and average grades of students from various states and cities of the country for each
course must be analyzed for each course and also overall CGPA.
(a) Design a star schema for such a data warehouse clearly identifying the fact table(s)
and dimension table(s), their primary key(s) and foreign key(s). Your schema should at
least be able to satisfy the above mentioned analysis requirements. You may consider
other suitble attributes for thedimension table(s).
(b) Write an SQL query that runs on your schema and returns the average SGPA of boys
from the state of Karnataka for each spring semester during the years 2002-2005.
[15+5=20]
Exercise-VII
Exercise-VIII