Lab 01 - OLAP
Lab 01 - OLAP
Lab 01 - OLAP
Given schema:
Requirements:
1. Find all students who attended a class in California taught by an instructor outside
of the student's major department and received a score above 80. Return the
student name, university, and score.
2. Calculate the average scores, grouped by student and instructor, for courses taught
in Quebec.
3. "Roll up" your result from problem 2 so it's grouping by instructor only.
4. Determine the average scores grouped by student major.
6. Use "WITH ROLLUP" on the attributes of the Class table to get average scores at
all geographical levels: by country, region, and university, including the overall
average.
7. Create a table with the results from problem 6. Use this table to compare how
much better students from the USA perform on average compared to students from
Canada.
8. Verify your results for problem 7 by writing the same query on the original tables
without using "WITH ROLLUP".
9. Create the following table that simulates the unsupported "WITH CUBE"
operator. Using table Cube instead of table Took, and taking advantage of the
special tuples with NULLs, find the average score of CS major students taking a
course at MIT.
10. Verify your result for problem 9 by writing the same query over the original
tables.
11. Whoops! Did you get a different answer for problem 10 than you got for problem
9? What went wrong? Assuming the answer on the original tables is correct, create
a slightly different data cube that allows you to get the correct answer using the
special NULL tuples in the cube. Hint: Change what dependent value(s) you store
in the cells of the cube; no change to the overall structure of the query or the cube
is needed.