Vous êtes sur la page 1sur 11

Tugas Kelompok Ke - 2

Week 9 Session 10

An new online store has been recognizing for online retail system which handle their
customer order from all over cities around the world. They need your expertise in order to
setup their OLAP application to help their high level management to make fast reports.
Based on their four monthly product sales reports as shown down below, please describe
and explain your expertise regarding with :
1.
2.
3.
4.
5.

database design for Datawarehouse with star concept (score : 20%)


database design for Datawarehouse with snowflaking concept (score :20%)
OLTP/TPS database design (score : 20%)
SQL statement to create report number 1 from OLTP/TPS database (score : 20%)
SQL statement to create report number 2 from Datawarehouse snowflake schema
database (score 10%)
6. SQL statement to create report number 2 from Datawarehouse star schema database
(score 10%)
Nb: for example these reports only print out 4 products (Laptop, Server, Printer and Scanner)
which part of 2 type of product (Computer and Office) where Laptop and Server are
Computer type of product, while Printer and scanner are Office type of product. Moreover,
these reports are only shown their customer origin from 4 cities such as Jakarta, Bandung,
Manchester and London, where Jakarta and Bandung are from Indonesia, while Manchester
and London are from United Kingdom.

Team 4 :
Alexander Gunawan

1701497840

Alpha Epsilon

1701498383

Armandha Aria

1701497903

Ghema Nusa Persada

1701497885

Ricomalibu

1701497872

Report 1:
Monthly Product Sales
Month : 02

Year : 2013

Product

Customer origin
City

Products Sale
to customers
Country Amoun Total
t
Price
($)
Indonesi
a
Indonesi
a

N
o

Name

Type

Laptop

Jakarta

Server

Compute
r
Compute
r

Printer

Office

Jakarta

Scanne
r

Office

Jakarta

Laptop

Compute
r
Compute
r

Bandung

Printer

Office

Bandung

Scanne
r

Office

Bandung

Laptop

Compute
r
Compute
r

Mancheste
r
Mancheste
r

UK

Printer

Office

UK

Scanne
r

Office

Mancheste
r
Mancheste
r

Jakarta

Indonesi
a
Indonesi
a

.
Server

Bandung

Indonesi
a
Indonesi
a

Indonesi
a
Indonesi
a

.
Server

UK

UK

Laptop
Server

Compute
r
Compute
r

London

UK

London

UK

Office
Office

London
London

UK
UK

Printer
Scanne
r
Report 2:
Monthly Product Sales
Month : 02

N
o
1
2

Produc
t
Type

Year : 2013
Customer
origin
Country

Compu
ter
Office

Indonesia

Compu
ter
Office

UK

Products Sale to
customers
Amou Total Price
nt
($)

Indonesia

UK

Report 3:
Monthly Product Sales
Month : 02

N
o
1

Produc
t
Type
Compu
ter

Year : 2013
Customer
origin
City
Jakarta

Products Sale to
customers
Amou Total Price
nt
($)

2 Office

.
Compu
ter
Office

.
Compu
ter
Office

.
Compu
ter
Office

Jakarta
Bandung
Bandung
Manchester
Manchester
London
London

Report 4:
Monthly Product Sales
Month : 02
Produc
t
Name

N
o
1 Laptop
2 Server

.
Printer
Scanner

Laptop
Server

Printer
Scanner

.
Laptop

Year : 2013
Customer
origin
City
Jakarta
Jakarta
Jakarta
Jakarta
Bandung
Bandung
Bandung
Bandung
Manchester

Products Sale to
customers
Amou Total Price
nt
($)

Server

Manchester

.
Printer Manchester
Scanner Manchester

Laptop
Server

London
London

Printer London
Scanner London

Answer :
Database design for Datawarehouse with star concept (score : 20%)

Database design for Datawarehouse with snowflaking concept (score :20%)

OLTP / TPS database design (score : 20%)

OLTP / TPS database design (score : 20%)

SQL statement to create report number 1 from OLTP/TPS database (score : 20%)
- Database = oltp_report1/oltp_report1.sql
- Report =
oltp_report1 /oltp_report1.jrxml
oltp_report1/oltp_report1.pdf
- Query =
SELECT
MONTH(s.TransactionDate) AS Month,
YEAR(s.TransactionDate) AS Year,
p.ProductName,

pt.ProductTypeName,
cg.City,
cg.Country,
sd.Quantity,
sd.TotalLine
FROM
Sales s
LEFT JOIN Customer c
ON c.CustomerID = s.CustomerID
LEFT JOIN CustomerOrigin cg
ON cg.CustomerOriginID = c.CustomerOriginID
LEFT JOIN SalesDetail sd
ON sd.SalesID = s.SalesID
LEFT JOIN Product p
ON p.ProductID = sd.ProductID
LEFT JOIN ProductType pt
ON pt.ProductTypeID = p.ProductTypeID
ORDER BY c.CustomerID
SQL statement to create report number 2 from Datawarehouse snowflake schema
database (score 10%)
- Database = snowflake_report2/snowflake_report2.sql
- Report =
snowflake_report2/snowflake_report2.jrxml
snowflake_report2/snowflake_report2.pdf
- Query =
SELECT
MONTH(fs.TransactionDate) AS Month,

YEAR(fs.TransactionDate) AS Year,
pt.ProductTypeName,
co.CountryName,
SUM(fs.Amount) AS Amount,
SUM(fs.TotalPrice) AS TotalPrice
FROM
FactSales fs
LEFT JOIN CustomerOrigin cg
ON cg.CustomerOriginID = fs.CustomerOriginID
LEFT JOIN Country co
ON co.CountryID = cg.CountryID
LEFT JOIN Product p
ON p.ProductID = fs.ProductID
LEFT JOIN ProductType pt
ON pt.ProductTypeID = p.ProductTypeID
GROUP BY
MONTH(fs.TransactionDate),
YEAR(fs.TransactionDate),
pt.ProductTypeName,
co.CountryName
ORDER BY co.CountryName,pt.ProductTypeName
SQL statement to create report number 2 from Datawarehouse star schema database
(score 10%)
- Database = star_report2/star_report2.sql
- Report =
star_report2/star_report2.jrxml

star_report2/star_report2.pdf
- Query =
SELECT
MONTH(fs.TransactionDate) AS Month,
YEAR(fs.TransactionDate) AS Year,
p.ProductType,
cg.Country,
SUM(fs.Amount) AS Amount,
SUM(fs.TotalPrice) AS TotalPrice
FROM
FactSales fs
LEFT JOIN CustomerOrigin cg
ON cg.CustomerOriginID = fs.CustomerOriginID
LEFT JOIN Product p
ON p.ProductID = fs.ProductID
GROUP BY
MONTH(fs.TransactionDate),
YEAR(fs.TransactionDate),
p.ProductType,
cg.Country
ORDER BY cg.Country,p.ProductType

Vous aimerez peut-être aussi