Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Question / Problem
One big company has 6 departments such as marketing, inventory, purchasing,
Finance, IT and HR Departments. The company want to setup data warehouse
environment for their HR Department as their 4 departments such as Marketing,
Inventory, Finance and Purchasing which have been setup with data warehouse
environment.
Answer / Solution
Revised Diagram
Additional field is added to revise some undefined relation regarding Manager of
Department and to ease the logical relation among Employee, Position and
Department.
Emp_Dep
Department
Emp_Pos
Position
Attendance
Emp_Leave
Leave
Emp_Depen
Dependent
Emp_Degree
Degree
column
Emp_ID
Emp_firstName
Emp_lastName
Emp_DOB
Emp_phone
Emp_email
Emp_hiredate
Emp_status
Emp_Mgr_ID
Emp_ID
Dep_ID
Dep_Start
Dep_finish
Dep_ID
Dep_name
Dep_Mgr_ID
Emp_ID
Pos_Code
Pos_start
Pos_Finish
Pos_salary
Pos_code
Pos_name
Emp_ID
Att_Date
Att_timeIN
Att_timeout
Emp_ID
Leave_code
Leave_start
Leave_Finish
Leave_code
leave_type
Emp_ID
Depen_Code
Depen_Name
Depen_DOB
Depen_code
Depen_type
Emp_ID
Deg_code
Name_univ
Deg_start
Deg_finish
Deg_GPA
Deg_code
Deg_type
key
PK
join key
values
SK
active, inactive
FK
FK
PK
Employee.Emp_ID
Employee.Emp_ID
Department.Dep_ID
PK
FK
CK
CK
PK
CK
CK
Employee.Emp_ID
CK
CK
Employee.Emp_ID
PK
CK
CK
PK
CK
CK
PK
The most suitable architecture would be With a Staging Area and Data Marts
Citation:
https://docs.oracle.com/cd/B10500_01/server.920/a96520/concept.htm
work hours=8
Emp_Leave
Leave
EmployeeID (PK)
Dep_Start
PosInfo
DepartmentName
ManagerName
EmployeeID (PK)
DepartmentName
ManagerName
Pos_start
Pos_Finish
AttendInfo
PositionName
EmployeeID (PK)
Att_Date
Att_timeIN
Att_timeIN
Att_timeout
Emp_ID
Leave_code
Att_timeout
Leave_start
Leave_start
Leave_Finish
Leave_code
leave_type
Leave_Finish
PositionName
AttendHour =
sum(Att_timeout
Att_timeIN) in
month(Att_Date)
LeaveHour =
(Leave_Finish LeaveStart) in
month(Att_Date)
leave_type=04 (unpaid)
TotalHourInMonth =
AttendHour LeaveHour
with Star Schema, the report will involved 4 Dimension and 1 Fact Tables
extracted from 8 original table from Transactional Processing System. Each
Dimension will have 1 Primary key as a result of denormalization process of the
original tables
Star Schema Diagram will be as follow:
DeptInfo
EmployeeID (PK)
Dep_Start
DepartmentName
ManagerName
PosInfo
EmployeeID (PK)
Pos_start
Pos_Finish
PositionName
DMAReport
EmployeeID
EmployeeName
EmployeeEmail
ReportMonth
DepartmentName
ManagerName
ReportMonth
PositionName
AttendHour
LeaveHour
TotalHourInMonth
EmplyInfo
EmployeeID (PK)
EmployeeName
EmployeeEmail
AttendInfo
EmployeeID (PK)
Att_Date
Att_timeIN
Att_timeout
Leave_start
Leave_Finish
leave_type=04
Assumption
Purposes
It can be use to Count Total Dependent of Employee as well as Count of Employee's
Dependent grouped by
Department
Employee Position
Dep_ID
Pos_Code
Depen_Code
Depen_Count
with Snowflakes Schema, this report will involved 7 Dimension and 1 Fact Tables
extracted from 7 original tables in Transactional Processing System with simplified
column list to keep the performance high. Each Dimension will have Several keys of
Primary keys and Composite Keys as a result of minimum denormalization process
of the original tables and to minimize redundancy
Snowflakes Schema Diagram will be as follow:
`
Employee
Emp_ID (PK)
Emp_status=Active
Position
Pos_code (PK)
Pos_name
Emp_Pos
Emp_ID (CK)
Pos_code (CK)
Pos_start
Pos_Finish
DependentCountDept
EmployeeID
Dep_ID
Pos_Code
Depen_Code
Depen_Count
Emp_Dep
Emp_ID (CK)
Dep_ID (CK)
Dep_Start
Dep_finish
Department
Dep_ID (PK)
Dep_name
Emp_Depen
Emp_ID (CK)
Depen_Code (CK)
Depen_Name
Depen_DOB
Dependent
Depen_code (PK)
Depen_type