04 Handout 1
04 Handout 1
Star Schema
A star schema is a data-modeling technique used to
map multi- dimensional decision support data into a
relational database.
It has two (2) common components:
Facts table – are data that will be included in
04 Handout 1 *Property of STI
[email protected] Page 4 of 12
IT2003
Dimension table – are attributes that qualify and OLAP OLTP
provide more information about facts. It contains Provides historical data for Manages day to day
dimensions of a fact and they are joined to fact table reporting and planning operations
via foreign key. Uses complex queries for Uses standard queries for
Example: retrieving a large amount of data
data such as inserting, deleting,
and updating
Types of OLAP
OLAP operations
Example:
Assume that we have a table named Enrolled_Students (see
04 Handout 1 *Property of STI
[email protected] Page 7 of 12
IT2003
Table 1. Enrolled_Students
Output:
Explanation:
ROLLUP operator creates an additional row that
represents subtotals for each campus. In the last
row, it represents the grand total for all values in
the NumberOfStudents column.
(Note: To make the output more readable, you can use the COALESCE()
function to substitute the appropriate value representing subtotal and
grand total to the NULL values.)
Using the CUBE operator, we will display all possible
combinations of columns in the Enrolled_Students table
(see Table 1).
SELECT COALESCE(Program, 'All Program') AS 'Program',
Output:
Explanation:
The first query specifies the column for cross-
tabulation results. We want to display the first column
Explanation:
as the identifier of the remaining column (second and
We use the COALESCE function to specify the returning
third columns).
text of NULL values in a specific column.
As for the source table, we specify the returning data
It has similar output to ROLLUP, but it returns two (2)
that will be used for the pivot statement.
additional rows below the grand total. This is because the
In the pivot statement, we used the SUM() function to get
ROLLUP operator generates aggregated results for the
the total number of students that are enrolled.
selected columns like Campus in a hierarchical way, while
We need to specify what rows/values to include from the
the CUBE operator generates an aggregated result that
Program
contains all the possible combinations for the selected
column as it will become our column headings in our pivot
columns.
table.
Using the PIVOT operator, we will turn the unique values/rows
C. Data Mining
in the
Data mining refers to analyzing massive amounts of data
Program column into multiple columns.
in a data warehouse or other sources to uncover hidden
SELECT 'Total students in all campus:' AS 'Program:', [BSIT], [BSCS] trends, patterns, and relationships. This explains the
FROM past and predicting the future for analysis.
( Data Mining Implementation Process
04 Handout 1 *Property of STI
[email protected] Page 9 of 12
IT2003
1. Business Understanding: In this step, the goals of
the businesses are set, and the important
factors that will help in achieving the goal are
discovered.
REFERENCES
Coronel, C. and Morris, S. (2018). Database systems design, implementation, &
management (13th ed.). Cengage Learning.
Elmasri, R. & Navathe, S. (2016). Fundamentals of Database Systems (7th ed.). Pearson
Higher Education.
Kroenke, D. & Auer, D. Database Processing: Fundamentals, Design, and Implementation
(12th ed.). Pearson Higher Education.
Silberschatz A., Korth H.F., & Sudarshan, S. (2019). Database system concepts (7th ed.).
McGraw-Hill Education.