7023T - TK2 - W9 - S10 - R1

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. database design for Datawarehouse with star concept (score : 20%) 2. database design for Datawarehouse with snowflaking concept (score :20%) 3. OLTP/TPS database design (score : 20%) 4. SQL statement to create report number 1 from OLTP/TPS database (score : 20%) 5. 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

description

7023T - TK2 - W9 - S10 - R1Advanced Database System

Transcript of 7023T - TK2 - W9 - S10 - R1

Page 1: 7023T - TK2 - W9 - S10 - R1

Tugas Kelompok Ke - 2

Week 9 – Session 10

An new online store has been recognizing for online retail system which handle theircustomer order from all over cities around the world. They need your expertise in order tosetup 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 describeand explain your expertise regarding with :

1. database design for Datawarehouse with star concept (score : 20%)2. database design for Datawarehouse with snowflaking concept (score :20%)3. OLTP/TPS database design (score : 20%)4. SQL statement to create report number 1 from OLTP/TPS database (score : 20%)5. 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 areComputer 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 Manchesterand London are from United Kingdom.

Team 4 :

Alexander Gunawan 1701497840

Alpha Epsilon 1701498383

Armandha Aria 1701497903

Ghema Nusa Persada 1701497885

Ricomalibu 1701497872

Page 2: 7023T - TK2 - W9 - S10 - R1

Report 1:

Monthly Product Sales

Month : 02 Year : 2013

Product Customer origin Products Saleto customers

No

Name Type City Country Amount

TotalPrice($)

1 Laptop Computer

Jakarta Indonesia

2 Server Computer

Jakarta Indonesia

…Printer Office Jakarta Indonesi

aScanner

Office Jakarta Indonesia

….

Laptop Computer

Bandung Indonesia

Server Computer

Bandung Indonesia

…Printer Office Bandung Indonesi

aScanner

Office Bandung Indonesia

….

Laptop Computer

Manchester

UK

Server Computer

Manchester

UK

…Printer Office Mancheste

rUK

Scanner

Office Manchester

UK

Page 3: 7023T - TK2 - W9 - S10 - R1

Laptop Computer

London UK

Server Computer

London UK

…Printer Office London UKScanner

Office London UK

Report 2:

Monthly Product Sales

Month : 02 Year : 2013

Product

Customerorigin

Products Sale tocustomers

No

Type Country Amount

Total Price ($)

1 Computer

Indonesia

2 Office Indonesia….….

Computer

UK

Office UK

Report 3:

Monthly Product Sales

Month : 02 Year : 2013

Product

Customerorigin

Products Sale tocustomers

No

Type City Amount

Total Price ($)

1 Computer

Jakarta

Page 4: 7023T - TK2 - W9 - S10 - R1

2 Office Jakarta….

Computer

Bandung

Office Bandung….

Computer

Manchester

Office Manchester….

Computer

London

Office London

Report 4:

Monthly Product Sales

Month : 02 Year : 2013

Product

Customerorigin

Products Sale tocustomers

No

Name City Amount

Total Price ($)

1 Laptop Jakarta2 Server Jakarta….

Printer JakartaScanner Jakarta

…Laptop BandungServer Bandung

…Printer BandungScanner Bandung

….

Laptop Manchester

Page 5: 7023T - TK2 - W9 - S10 - R1

Server Manchester….

Printer ManchesterScanner Manchester

…Laptop LondonServer London

…Printer LondonScanner London

Page 6: 7023T - TK2 - W9 - S10 - R1

Answer :

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

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

Page 7: 7023T - TK2 - W9 - S10 - R1

OLTP / TPS database design (score : 20%)

Page 8: 7023T - TK2 - W9 - S10 - R1

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,

Page 9: 7023T - TK2 - W9 - S10 - R1

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,

Page 10: 7023T - TK2 - W9 - S10 - R1

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

Page 11: 7023T - TK2 - W9 - S10 - R1

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