Chapter 4 Tutorial

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Chapter 4 Tutorial

Q3
• Suppose that a data warehouse consists of the three
dimensions time, doctor, and patient, and the two
measures count and charge, where charge is the fee
that a doctor charges a patient for a visit.
(a) Enumerate three classes of schemas that are popularly
used for modeling data warehouses.
1. Star schema
2. Snowflake schema
3. Fact constellation schema
.Q3 cont
(b) Draw a schema diagram for the above data warehouse
using one of the schema classes listed in (a).
Using a star schema.
Q3 cont.
Star Schema
time
time_key doctor
day doctor_id
day_of_the_week Fact Table doctor_name
month phone #
time_key
quarter address
year doctor_id gender
patient_id
patient
Charge
patient_id
patient_name Count Measures
phone #
address
gender
.Q3 cont
(c) Starting with the base cuboid [day, doctor, patient], what
specific OLAP operations should be performed in order
to list the total fee collected by each doctor in 2010?
The operations to be performed are:
o Roll-up on time from day to year.
o Slice for time = 2010.
o Roll-up on patient from individual patient to all.
Q4
• Suppose that a data warehouse for Big-University
consists of the following four dimensions: student,
course, semester, and instructor, and two measures
count and avg. grade. When at the lowest conceptual
level (e.g., for a given student, course, semester, and
instructor combination), the avg grade measure stores
the actual course grade of the student. At higher
conceptual levels, avg grade stores the average grade
for the given combination.
Q4 cont.
Snowflake Schema
Course Student Area
course_id
Sales
Fact Table student_id area_id
Course_name
student_name City
department course_id area_id State
student_id Major country
instructor_id status
university
semester_id
Semester
Count
semester_id Instructor
Avg. grade
semester instructor_id
year depatment
rank
.Q4. cont
• Starting with the base cuboid [student, course, semester,
instructor], what specific OLAP operations (e.g., roll-up
from semester to year) should one perform in order to list
the average grade of CS courses for each Big
University student.
• Roll-up on course from course id to department.
• Roll-up on semester from semester id to all.
• Slice for course=“CS” .
Q5
Suppose that a data warehouse consists of the four
dimensions, date, spectator, location, and game, and
the two measures, count and charge, where charge
is the fare that a spectator pays when watching a
game on a given date. Spectators may be students,
adults, or seniors, with each category having its own
charge rate.
Draw a star schema diagram for the data warehouse.
Q5 cont.
Star Schema
date
date_id spectator
day Sales spectator_id
month Fact Table spectator_name
quarter phone #
date_id
year address
spectator_id Status
location_id Charge rate
game game_id location
Charge location_id
game_id phone #
game_name Count
Street
description city
producer province
country
.Q5. cont
• Starting with the base cuboid [date, spectator, location,
game], what specific OLAP operations should one
perform in order to list the total charge paid by student
spectators at GM Place in 2010?
The specific OLAP operations to be performed are:
• Roll-up on date from date id to year.
• Roll-up on game from game id to all.
• Roll-up on location from location id to location name.
• Roll-up on spectator from spectator id to status.
• Dice with status=“students”, location name=“GM Place”,
and year = 2010.

You might also like