Professional Documents
Culture Documents
Exercise 1
1. Select only one answer for the following questions. (0.5 point per question)
1
(C) Surrogate keys essentially buffer the data warehouse from the operational environment
by making it immune to any operational changes.
(D) A factless fact table is a fact table that only contains foreign keys and no measurement
data.
2. Define the following terms: OLAP (online analytical processing), ROLAP (relational OLAP),
MOLAP (multidimensional OLAP). (2 point)
2
3. Consider the following Students table, write SQL statements.
(1) Write a SQL statement with CUBE keywords to build a cube for Age and Study_track
dimensions to calculate the average score. Use a database (e.g. PostgreSQL) you are familiar
with to insert the above data and then run your SQL statement and copy the results here. (2
points)
(2) Write a SQL statement to use ROLLUP keywords with Age and Study_track dimensions to
calculate the average score. Use a database to run your SQL statement and copy the results here.
(2 points)
(3) Write a SQL statement to use GROUPING SETS keywords for Age and Study_track
dimensions to calculate the average scores. Use a database to run your SQL statement and copy
the results here. (2 points)
4. Consider the following example of a relational table. What are the possible errors and
inconsistencies you can detect in this table? (3 points)
5. Write three SQL statements to perform the schema mapping: Source schema: Takes (course,
student), Courses (prof, course), Time (course, time); Target schema: Teaches( prof, course, time),
Study(student, course, time), ST(prof, student). That is, write SQL statements to define the three
tables in the target schema using the three tables in source schema. (3 points)