Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Ex1 :

Q1. Schema of the data warehouse tables:

Fact Table:

 Sales:
 Date_key (foreign key to Date dimension)
 Customer_key (foreign key to Customer dimension)
 Product_key (foreign key to Product dimension)
 Turnover
 Quantity
 Rating

Dimension Tables:

 Date:
 Date_key (primary key)
 Date
 Day
 Month
 Year
 Customer:
 Customer_key (primary key)
 Customer_number
 Name
 Telephone_number
 Address
 Product:
 Product_key (primary key)
 Reference
 Name
 Price

Justification:

 The fact table is "Sales" because it contains the measures (turnover, quantity,
rating) and foreign keys to the related dimensions (Date, Customer, Product).
 The dimensions are Date, Customer, and Product. These dimensions provide
context to the sales data and are used for slicing, dicing, and analyzing the
sales information from different perspectives.

Q2. Analyzing the additivity of measurements:


 Turnover: This measurement is additive because you can sum up the turnover
for different sales transactions to get the total turnover for a given period or
across all periods.
 Quantity: Similar to turnover, quantity is also additive because you can sum up
the quantities sold across different transactions to get the total quantity sold.
 Rating: Rating is not directly additive. It represents an average or aggregate
measure of customer satisfaction. While you can calculate averages of ratings,
you cannot simply sum up ratings across transactions to get meaningful
insights.

Q3. Star diagram of the data warehouse:

In the star diagram:

 The fact table "Sales" sits at the center.


 The dimensions (Date, Customer, Product) are connected to the fact table,
forming a star-like structure.
 Each dimension connects to the fact table via foreign keys.
 This design simplifies queries and analysis as each dimension can be directly
joined to the fact table without needing to join multiple dimension tabl

Q4. Modified model to a snowflake model to explicitly model dimension


hierarchies:

In a snowflake schema, dimension tables are normalized into multiple related tables,
creating a hierarchical structure. Here's how the schema can be modified:

Dimension Tables:

 Date:
 Date_key (primary key)
 Date
 Day
 Month
 Year
 Customer:
 Customer_key (primary key)
 Customer_number
 Name
 Telephone_number
 Address
 Product:
 Product_key (primary key)
 Reference
 Name
 Price

Normalized Dimension Tables:

 Date:
 Date_key (primary key)
 Date
 Day_key (foreign key to Day dimension)
 Month_key (foreign key to Month dimension)
 Year_key (foreign key to Year dimension)
 Day:
 Day_key (primary key)
 Day
 Month:
 Month_key (primary key)
 Month
 Year:
 Year_key (primary key)
 Year

In the snowflake model:

The Date dimension is normalized into Day, Month, and Year tables to explicitly
model the hierarchy of date attributes.

Each level of the date hierarchy has its own dimension table, linked through foreign
key relationships.

This allows for more efficient storage and potentially better performance for queries
involving date hierarchies.

Ex2 :

Q1. Schema of the data warehouse tables:

Fact Table:

 Exam Results:
 Date_key (foreign key to Date dimension)
 Student_key (foreign key to Student dimension)
 Course_key (foreign key to Course dimension)
 Exam_type
 Grade

Dimension Tables:

 Date:
 Date_key (primary key)
 Date
 Day
 Month
 Year
 Student:
 Student_key (primary key)
 idEtu
 Last_name
 First_name
 Date_of_birth
 Address
 Specialty_of_Baccalaureate
 Course:
 Course_key (primary key)
 idC
 Course_name
 Training_course_associated
 Teacher:
 Teacher_key (primary key)
 idEns
 Last_name
 First_name
 Specialty
 Number_of_hours

Justification:

 The fact table is "Exam Results" because it contains the measures (grade) and
foreign keys to the related dimensions (Date, Student, Course).
 The dimensions are Date, Student, Course, and Teacher. These dimensions
provide context to the exam results data and are used for slicing, dicing, and
analyzing the exam results from different perspectives.

Q3. Star diagram of the data warehouse:


In this star diagram:

 The fact table "Exam Results" sits at the center.


 The dimensions (Date, Student, Course, Teacher) are connected to the fact
table, forming a star-like structure.
 Each dimension connects to the fact table via foreign keys.

Q4. Modified model to a snowflake model to explicitly model dimension


hierarchies:

In a snowflake schema, dimension tables are normalized into multiple related tables,
creating a hierarchical structure. Here's how the schema can be modified:

Dimension Tables:

 Date:
 Date_key (primary key)
 Date
 Day_key (foreign key to Day dimension)
 Month_key (foreign key to Month dimension)
 Year_key (foreign key to Year dimension)
 Student:
 Student_key (primary key)
 idEtu
 Last_name
 First_name
 Date_of_birth
 Address
 Specialty_of_Baccalaureate
 Course:
 Course_key (primary key)
 idC
 Course_name
 Training_course_associated
 Teacher:
 Teacher_key (primary key)
 idEns
 Last_name
 First_name
 Specialty
 Number_of_hours

In this snowflake schema:


 The dimensions (Date, Student, Course, Teacher) are normalized into multiple
related tables, creating a hierarchical structure for each dimension.
 This allows for more efficient storage and potentially better performance for
queries involving dimension hierarchies.

EX3 :

A. Multidimensional operations to display the following multidimensional


tables:

1. The balance per customer and per month:


 Multidimensional Operation: Slice by customer and drill down by month.
2. The balance by first name in alphabetical order of customers and by month:
 Multidimensional Operation: Slice by first name (in alphabetical order) and drill
down by month.
3. The balance by first name (Thierry before Théo) and by month:
 Multidimensional Operation: Sort by first name (Thierry before Théo) and then
drill down by month.
4. Balance by Name and month:
 Multidimensional Operation: Drill down by customer name and month.
5. The balance per account and per month:
 Multidimensional Operation: Slice by account and drill down by month.
6. The balance per account and per month for customers called Jean:
 Multidimensional Operation: Slice by customer name (Jean) and month, then
drill down by account.
7. Average balance and credit per account per month:
 Multidimensional Operation: Aggregate balance and credit measures by
account and month.

B. Corresponding MDX statements:

1. SELECT {[Measures].[Balance]} ON COLUMNS, {[Customer].


[idClient].MEMBERS} ON ROWS FROM [BalanceCube] WHERE ([Time].
[Month].MEMBERS)
2. SELECT {[Measures].[Balance]} ON COLUMNS, ORDER([Customer].[First
Name].MEMBERS, [Customer].[First Name].CURRENTMEMBER.NAME, ASC) ON ROWS
FROM [BalanceCube] WHERE ([Time].[Month].MEMBERS)
3. SELECT {[Measures].[Balance]} ON COLUMNS, ORDER([Customer].[First
Name].MEMBERS, [Customer].[First Name].CURRENTMEMBER.NAME, BDESC) ON
ROWS FROM [BalanceCube] WHERE ([Time].[Month].MEMBERS)
4. SELECT {[Measures].[Balance]} ON COLUMNS, {[Customer].[Name].MEMBERS}
ON ROWS FROM [BalanceCube] WHERE ([Time].[Month].MEMBERS)
5. SELECT {[Measures].[Balance]} ON COLUMNS, {[Account].
[AccountNumber].MEMBERS} ON ROWS FROM [BalanceCube] WHERE ([Time].
[Month].MEMBERS)
6. SELECT {[Measures].[Balance]} ON COLUMNS, {[Account].
[AccountNumber].MEMBERS} ON ROWS FROM [BalanceCube] WHERE ([Time].
[Month].MEMBERS, [Customer].[Name].&[Jean])
7. SELECT {[Measures].[Balance], [Measures].[Credit]} ON COLUMNS,
{[Account].[AccountNumber].MEMBERS} ON ROWS FROM [BalanceCube] WHERE
([Time].[Month].MEMBERS)

Ex4 :
To draw the graph of the cuboids from the multidimensional diagram provided, we
need to identify the dimensions and hierarchies involved. Based on the description,
the dimensions are "Machine Component" and "Factory Unit". Let's represent the
possible cuboids:

1. Cuboids involving only one dimension:


 Machine Component
 Factory Unit
2. Cuboids involving both dimensions:
 Machine Component x Factory Unit

The hierarchy within each dimension can lead to additional levels of granularity in the
cuboids. However, without specific details about the hierarchies within each
dimension, we can represent the basic structure of the cuboids as follows:

Ex5
To perform the analysis operations described using OLAP operators, we can use
operations such as slicing, dicing, and drilling down. Let's express each operation and
display the resulting tables:

1. Analysis Operations:
 The duration of outages per month, per component, and per unit:
 OLAP Operation: Slice by month, component, and unit.
 Resulting Table:
Month Component Unit Outage Duration (minutes)
January C1 Unit 1 xxx
February C1 Unit 1 xxx
... ... ... ...
Month Component Unit Outage Duration (minutes)
December C3 Unit 2 xxx
 The duration of breakdowns per year, per component, and per unit:
 OLAP Operation: Slice by year, component, and unit.
 Resulting Table:
Year Component Unit Breakdown Duration (minutes)
2015 C1 Unit 1 xxx
2015 C2 Unit 1 xxx
... ... ... ...
2016 C3 Unit 2 xxx
 The duration of breakdowns per year and per unit:
 OLAP Operation: Slice by year and unit.
 Resulting Table:
Year Unit Breakdown Duration (minutes)
2015 Unit 1 xxx
2016 Unit 1 xxx
... ... ...
2015 Unit 2 xxx
 The duration of outages per unit:
 OLAP Operation: Slice by unit.
 Resulting Table:
Unit Outage Duration (minutes)
Unit 1 xxx
Unit 2 xxx
... ...
 The duration of breakdowns per machine:
 OLAP Operation: Drill down by machine (Component).
 Resulting Table:
Component Breakdown Duration (minutes)
C1 xxx
C2 xxx
C3 xxx
... ...
 The duration of breakdowns per component:
 OLAP Operation: Drill down by component.
 Resulting Table:
Component Breakdown Duration (minutes)
C1 xxx
C2 xxx
C3 xxx
... ...
 The duration of outages per month, per component, and per unit:
 OLAP Operation: Slice by month, component, and unit.
 Resulting Table:
Month Component Unit Outage Duration (minutes)
January C1 Unit 1 xxx
February C1 Unit 1 xxx
... ... ... ...
December C3 Unit 2 xxx
 The duration of breakdowns of components C1 and C3 during the month
January 2015 of the first unit:
 OLAP Operation: Slice by month (January 2015), component (C1, C3), and unit
(first unit).
 Resulting Table:
Component Unit Breakdown Duration (minutes)
C1 Unit 1 xxx
C3 Unit 1 xxx
2. Modifying the Display:
 Present the component machines above the units:
 OLAP Operation: Pivot the table to have the Component column above the
Unit column.
 Resulting Table:
Component Unit Outage Duration (minutes)
C1 Unit 1 xxx
C2 Unit 1 xxx
C3 Unit 1 xxx
... ... ...
 Present the units vertically in place of the dates and place the dates
below the machines:
 OLAP Operation: Pivot the table to have the Unit column vertical and the
Date (Month) column below the machines (Components).
 Resulting Table:
Unit C1 - Outage C2 - Outage C3 - Outage ...
Unit 1 xxx xxx xxx ...
Unit 2 xxx xxx xxx ...
... ... ... ... ...
Month January January January ...

These OLAP operations and resulting tables allow us to analyze and visualize the data
from the multidimensional cube C effectively.

You might also like