1 All Powder Board and Ski Oracle 9i Workbook Chapter 8: Data Warehouses and Data Mining Jerry Post Copyright © 2003.

Slides:



Advertisements
Similar presentations
All Powder Board and Ski
Advertisements

1 All Powder Board and Ski Microsoft Access Workbook Chapter 9: Data Warehouses and Data Mining Jerry Post Copyright © 2007.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 5: Advanced Queries Jerry Post Copyright © 2007.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms and Reports Jerry Post Copyright © 2007.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 10: Database Administration Jerry Post Copyright © 2007.
Chapter 10 Excel: Data Handling or What do we do with all that data?
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
CC SQL Utilities.
© 2007 by Prentice Hall10-1 Introduction to Oracle 10g Chapter 10 Creating and Modifying Reports James Perry and Gerald Post.
1 All Powder Board and Ski SQL Server Workbook Chapter 4: Queries Jerry Post Copyright © 2003.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
SUNY Morrisville-Norwich Campus- Week 7 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
Pasewark & Pasewark 1 Access Lesson 6 Integrating Access Microsoft Office 2007: Introductory.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Chapter 2 Querying a Database
Chapter 05 Lecture Notes (CSIT 104) Exploring Microsoft Office Excel 2007 Chapter 5 Data to Information.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
Working with a Database
October 2003Bent Thomsen - FIT 3-21 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
CITY UNIVERSITY / Vysoká Škola Manažmentu.:IS Information Systems :. © Martina Cesalova, 2005 MS ACCESS 1 Start Microsoft Access – New - Blank Database.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Import Data From Text Files and Other Sources Importing is the process of inserting data.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 4: Queries Jerry Post Copyright © 2007.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Microsoft Access 2010 Building and Using Queries.
Working with Reports in Microsoft Excel Session Version 1.0 © 2011 Aptech Limited.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 7: Integrity and Transactions Jerry Post Copyright © 2003.
1 All Powder Board and Ski SQL Server Workbook Chapter 2: Database Design Jerry Post Copyright © 2004.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 7: Integrity and Transactions Jerry Post Copyright © 2003.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Analysing Data with Excel Viewing Help To view Help 1.On the Start menu, point to Programs, and then click Microsoft Excel. 2.On the Help menu,
1 All Powder Board and Ski Oracle 9i Workbook Chapter 4: Queries Jerry Post Copyright © 2003.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
1 All Powder Board and Ski Oracle 9i Workbook Chapter 10: Distributed Databases Jerry Post Copyright © 2003.
A Skills Approach Access 2010 Working with Tables © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 2.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003.
All Powder Board and Ski Microsoft Access Workbook Chapter 2: Database Design Jerry Post Copyright © 2003.
CERTIPORT EXCEL PRACTICE. EDITING SORT/FILTER/FIND & REPLACE In the Summary worksheet, sort the data in descending order by Order Number, and then in.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 8: Data Warehouses and Data Mining Jerry Post Copyright © 2003.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 4: Queries Jerry Post Copyright © 2003.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
With Microsoft Excel 2007Comprehensive 1e© 2008 Pearson Prentice Hall1 Chapter 4: PowerPoint Presentation GO! with Microsoft Excel ® 2007 Comprehensive.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 5: Advanced Queries Jerry Post Copyright © 2003.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
1 All Powder Board and Ski SQL Server Workbook Chapter 5: Advanced Queries Jerry Post Copyright © 2003.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 10: Distributed Databases and the Internet All Powder.
Excel Tutorial 8 Developing an Excel Application
Chapter 6: Forms, Reports and Applications All Powder Board and Ski
GO! with Microsoft Office 2016
Chapter 7: Database Integrity and Transactions
Chapter 2: Database Design All Powder Board and Ski
GO! with Microsoft Access 2016
All Powder Board and Ski
All Powder Board and Ski
Microsoft Office Illustrated
Exchanging Data with Other Programs
Building and Using Queries
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Exploring Microsoft® Office 2016 Series Editor Mary Anne Poatsy
Bent Thomsen Institut for Datalogi Aalborg Universitet
Presentation transcript:

1 All Powder Board and Ski Oracle 9i Workbook Chapter 8: Data Warehouses and Data Mining Jerry Post Copyright © 2003

2 Oracle Relational Approach Customer Sale SaleItem Item Relational Tables Fact Measure Dimension Star Design Meta-Data Sale + Customer Materialized Views

3 Desired Sales Cube Dimensions Sales Dimensions State (ship) Month Category Style SkillLevel Size Color Manufacturer BindingStyle WeightMax? ItemMaterial? WaistWidth?

4 Early Data: Spreadsheets

5 External Tables: Attach to CSV create table OldSale_Ext ( SaleIDINTEGER, SaleDateDATE, ShipStateVARCHAR2(50), ShipZIPVARCHAR2(50), PaymentMethodVARCHAR2(50), SKUVARCHAR2(50), QuantitySoldINTEGER, SalePriceNUMBER(10,2) ModelIDVARCHAR2(250), ItemSizeNUMBER, ManufacturerIDINTEGER, create or replace directory csv_dir as ‘D:\students\BuildAllPowder\AllPowderSampleDataCSV'; CategoryVARCHAR2(50), ColorVARCHAR2(50), ModelYearINTEGER, GraphicsVARCHAR2(50), ItemMaterialVARCHAR2(50), ListPriceNUMBER(10,2), StyleVARCHAR2(50), SkillLevelINTEGER, WeightMaxNUMBER, WaistWidthNUMBER, BindingStyleVARCHAR2(50) ) Continued on next slide Warning: currency columns cannot have $ symbols or commas

6 External File Definition organization external ( type oracle_loader default directory csv_dir access parameters ( records delimited by newline fields terminated by ',' optionally enclosed by '"' lrtrim missing field values are null ( SaleID, SaleDate char date_format date mask "mm/dd/yyyy", ShipState, ShipZIP, PaymentMethod, SKU, QuantitySold, SalePrice, odelID, ItemSize, ManufacturerID, Category, Color, ModelYear, Graphics, ItemMaterial, ListPrice, Style, SkillLevel, WeightMax, WaistWidth, BindingStyle ) location ('Lab Early Sales.csv') ) reject limit unlimited;

7 Create Customer and Employee CustomerID and EmployeeID are missing from the old data. Instead of relying on blank cell values, create a new customer called “Walk-in” and a new employee called “Employee” Write down the ID numbers generated for these anonymous entries. If you use SQL, you can assign a value of zero to these entries. INSERT INTO Customer (CustomerID, LastName) Values (0,'Walk-in') INSERT INTO Employee (EmployeeID, LastName) Values (0,'Staff')

8 Extract Model Data SELECT DISTINCT OldSale_ext.ModelID, OldSale_ext.ManufacturerID, OldSale_ext.Category, OldSale_ext.Color, OldSale_ext.ModelYear, OldSale_ext.Graphics, OldSale_ext.ItemMaterial, OldSale_ext.ListPrice, OldSale_ext.Style, OldSale_ext.SkillLevel, OldSale_ext.WeightMax, OldSale_ext.WaistWidth, OldSale_ext.BindingStyle FROM OldSale_ext;

9 UNION Query for Models SELECT DISTINCT ModelID, ManufacturerID, Category, … FROM OldSales_ext UNION SELECT DISTINCT ModelID, ManufacturerID, Category, … FROM OldRentals_ext

10 Insert Model Data into ItemModel INSERT INTO ItemModel (ModelID, ManufacturerID, Category, Color, ModelYear, Graphics, ItemMaterial, ListPrice, Style, SkillLevel, WeightMax, WaistWidth, BindingStyle) SELECT DISTINCT qryOldModels.ModelID, qryOldModels.ManufacturerID, qryOldModels.Category, qryOldModels.Color, qryOldModels.ModelYear, qryOldModels.Graphics, qryOldModels.ItemMaterial, qryOldModels.ListPrice, qryOldModels.Style, qryOldModels.SkillLevel, qryOldModels.WeightMax, qryOldModels.WaistWidth, qryOldModels.BindingStyle FROM qryOldModels;

11 Insert SKU Data into Inventory INSERT INTO Inventory (ModelID, SKU, ItemSize, QuantityOnHand) SELECT DISTINCT qryOldInventory.ModelID, qryOldInventory.SKU, qryOldInventory.ItemSize, 0 As QuantityOnHand FROM qryOldInventory; Note the use of the column alias to force a zero value for QuantityOnHand for each row CREATE VIEW qryOldInventory AS SELECT DISTINCT ModelID, SKU, ItemSize FROM OldSale_ext UNION SELECT DISTINCT ModelID, SKU, ItemSize FROM OldRental_ext;

12 Copy Sales Data INSERT INTO Sale (SaleID, SaleDate, ShipState, ShipZIP, PaymentMethod) SELECT DISTINCT OldSales_ext.SaleID, OldSales_ext.SaleDate, OldSales_ext.ShipState, OldSales_ext.ShipZIP, OldSales_ext.PaymentMethod FROM OldSales_ext; Note that if you have added data to your Sales table, your existing SaleID values might conflict with these You can solve the problem by adding a number to these values so they are all larger than your highest ID INSERT INTO Sale (SaleID, SaleDate, ShipState, ShipZIP, PaymentMethod) SELECT DISTINCT OldSales_ext.SaleID+5000, OldSales_ext.SaleDate, OldSales_ext.ShipState, OldSales_ext.ShipZIP, OldSales_ext.PaymentMethod FROM OldSales_ext;

13 Copy SaleItem Rows INSERT INTO SaleItem (SaleID, SKU, QuantitySold, SalePrice) SELECT DISTINCT OldSale_ext.SaleID+5000, OldSale_ext.SKU, OldSale_ext.QuantitySold, OldSale_ext.SalePrice FROM OldSale_ext; If you transformed the SaleID in the prior step for the Sale data, you must do the exact same calculation for SaleID in the SaleItem table

14 Copy Rental Data INSERT INTO Rental (RentID, RentDate, ExpectedReturn, PaymentMethod) SELECT DISTINCT OldRental_ext.RentID+5000, OldRental_ext.RentDate, OldRental_ext.ExpectedReturn, OldRental_ext.PaymentMethod FROM OldRental_ext; INSERT INTO RentItem (RentID, SKU, RentFee, ReturnDate) SELECT DISTINCT OldRental_ext.RentID+5000, OldRental_ext.SKU, OldRental_ext.RentFee, OldRental_ext.ReturnDate FROM OldRental_ext;

15 Discoverer Administrator: Load Business Area Schema Select tables Tables and views

16 Load Wizard Options: LOV Most options are selected by default Select the LOV option to have Discoverer build lookup lists

17 Discoverer: Business Area Tables shown as folders and named so managers understand them Columns shown as items Add a calculated item

18 Create a Data Hierarchy Select Category and Style from the SkiBoardStyle lookup table

19 Discoverer Desktop: New Workbook Select the dimensions and the fact item

20 Initial Crosstab Layout Row area Column area Page area

21 Discoverer Crosstab Browser Select all items Format options Totals

22 Time Series Analysis: Moving Average

23 Time Series Analysis: Discoverer

24 Sales by State for Regression Note that some states are missing from the list.

25 Regression Data Query CREATE VIEW StateSales2004 AS SELECT StateName, Income2001, Pop2002, Sum(SalePrice*QuantitySold) AS Sales2004 FROM Sale INNER JOIN StateDemographics ON Sale.ShipState = StateDemographics.StateCode INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleID WHERE ShipState IS NOT NULL AND SaleDate Between '01-Jan-2004' And '31-Dec-2004' GROUP BY StateName, Income2001, Pop2002 ORDER BY StateName;

26 Regression Setup You should include the label row but be sure to check the box to show you included it

27 Regression Results Relatively high R-square Population is a significant predictor, Income is not

28 Association Rules/Market Basket Item to findPossible location Data mining samplesD:\Oracle\ora92\dm\demo\sample ORACLE_HOMED:\Oracle\ora92 JAVA_HOMEC:\OracleData\Ora92DS\jdk Locate folders

29 Copy Files to Protect Original compileSampleCode.bat executeSampleCode.bat Sample_AssociationRules.java Sample_AssociationRules_Transactional.property Sample_Global.property

30 Edit Sample_Global.property File miningServer.userName=odm miningServer.password=password inputDataSchemaName=powder outputSchemaName=powder timeout=120 If necessary, use enterprise manager to unlock and assign new passwords to accounts: odm and odm_mtr

31 Create New Table To Hold Transaction Basket Data CREATE TABLE MARKET_BASKET_TX_BINNED ( SEQUENCE_IDINTEGER, ATTRIBUTE_NAMEVARCHAR2(35), VALUENUMBER ); GRANT SELECT ON MARKET_BASKET_TX_BINNED TO odm; commit; If you use these names, you do not have to edit the Transactional.property file

32 Copy SaleItem Data INSERT INTO MARKET_BASKET_TX_BINNED (SEQUENCE_ID, ATTRIBUTE_NAME, VALUE) SELECT SaleID, ItemModel.Category || '_' || ItemModel.Style AS AName, 1 As Value FROM SaleItem Inner Join Inventory ON SaleItem.SKU = Inventory.SKU Inner Join ItemModel ON Inventory.ModelID = ItemModel.ModelID GROUP BY SaleID, ItemModel.Category || '_' || ItemModel.Style;

33 Copy Sale Data INSERT INTO MARKET_BASKET_TX_BINNED (SEQUENCE_ID, ATTRIBUTE_NAME, VALUE) SELECT SaleID, 'ID', SaleID FROM Sale; commit;

34 Remove Dashes from Attribute UPDATE MARKET_BASKET_TX_BINNED SET ATTRIBUTE_NAME = substr(ATTRIBUTE_NAME,1,instr(ATTRIBUTE_NAME,'-')-1) || '_' || substr(ATTRIBUTE_NAME,instr(ATTRIBUTE_NAME,'-')+1) WHERE instr(ATTRIBUTE_NAME,'-') > 0; commit; Run at least twice—until you get zero changes. Because a row might have more than one dash.

35 Limit Size of Attribute_Name UPDATE MARKET_BASKET_TX_BINNED SET ATTRIBUTE_NAME = substr(ATTRIBUTE_NAME,1,20); commit; This is critical—but is probably due to a bug in Oracle’s code. There is a slight chance it arises because of the 30 character name limitation in Oracle.

36 Compile and Run the Code SET ORACLE_HOME = D:\Oracle\ora92 SET JAVA_HOME = C:\OracleData\ora92DS\jdk compileSampleCode.bat Sample_AssociationRules.java executeSampleCode.bat Sample_AssociationRules Sample_AssociationRules_Transactional.property Type as all one line—do not hit until the end To redirect the output to a file, at the end, add: >myfile.txt

37 Sample Results Getting top 5 rules for model: Sample_AR_Model_tx sorted by support. Rule 124: If Boots_=1 then Clothes_=1 [support: , confidence: ] Rule 38: If Clothes_=1 then Boots_=1 [support: , confidence: ] Rule 101: If Board_Half_Pipe=1 then Clothes_=1 [support: , confidence: ] Rule 9: If Clothes_=1 then Board_Half_Pipe=1 [support: , confidence: ] Rule 100: If Ski_Freestyle=1 then Clothes_=1 [support: , confidence: ] Get rules by support: Sample_AR_Model_tx, with minimum support of Rule 124: If Boots_=1 then Clothes_=1 [support: , confidence: ] Rule 38: If Clothes_=1 then Boots_=1 [support: , confidence: ] Get rules by confidence: Sample_AR_Model_tx, with confidence of 0.56 or more. Investigate and think about the results. Do you have too many clothes targeted to half-pipe boards and freestyle skiers, or not enough?

38 GIS: Microsoft MapPoint The Discoverer worksheet places the data into rows and columns A dynamic copy of this sheet is used to remove the top rows

39 MapPoint Data Wizard

40 GIS Analysis of Sales