Download Data Warehouse Schema and OLAP Operations and more Summaries Mathematics in PDF only on Docsity!
Chapter 4 Tutorial
Q
- (^) 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.
- Star schema
- Snowflake schema
- Fact constellation schema
Q3 cont.
Star Schema
time_key day day_of_the_week month quarter year
time_key day day_of_the_week month quarter year
time^ time
Fact Table
Measures
doctor_id doctor_name phone # address gender
doctor_id doctor_name phone # address gender
doctor^ doctor
patient_id patient_name phone # address gender
patient_id patient_name phone # address gender
patient^ patient
time_key
doctor_id
patient_id
Charge
Count
.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 cont.
Snowflake Schema
course_id Course_name department
course_id Course_name department
Course^ Course
Sales
Fact Table student_id
student_name area_id Major status university
student_id student_name area_id Major status university
Student^ Student
semester_id semester year
semester_id semester year
Semester^ Semester
course_id student_id instructor_id semester_id Count Avg. grade instructor_id depatment rank
instructor_id depatment rank
Instructor^ Instructor
area_id City State country
Area^ Area
.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 cont.
Star Schema
date_id day month quarter year
date_id day month quarter year
date^ date
Sales
Fact Table
spectator_id spectator_name phone # address Status Charge rate
spectator_id spectator_name phone # address Status Charge rate
spectator^ spectator
game_id game_name description producer
game_id game_name description producer
game^ game
date_id spectator_id location_id game_id Charge Count
location_id phone # Street city province country
location_id phone # Street city province country
location^ location
.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.