University of Manitoba Asper School of Business 3500 DBMS Bob Travica Business Analytics and Decision Making OLTP, OLAP & SAP Chapter 9 & SAP Materials Updated 2015
DBSYSTEMS 2 of 20 OLTP vs. OLAP Online Transaction Processing (OLTP) = relational database systems Online Analytical Processing (OLAP)
DBSYSTEMS 3 of 20 OLAP via Data Warehousing Online Transaction Processing (OLTP): Querying Databases with 3NF tables Operations’ data Predefined reports Online Analytical Processing (OLAP); Data warehousing; Data Mining. Usually de-normalized data. Periodical transfers Interactive data analysis Flat files MIS 3500
DBSYSTEMS OLTP & OLAP in Enterprise Systems Enterprise Systems (Enterprise Resource Planning Systems) support both. Example: An SAP-based system can be a TPS, MIS and DSS for the entire organization. DSS capability draws on data warehousing & cubing. Process approach to organization with data flowing smoothly end-to-end. Process link up horizontally (department-to- department) and vertically (process-sub-process). Business process* is for the most part the system process. More... More... 4 of 20
DBSYSTEMS 5 of 20 Date Warehousing Goals Data warehouse (DW) yields multidimensional view of data (cubing): Integrate data from different sources to get a larger picture of business Data aggregations (summaries on different dimensions) DW expands scope of data analysis: Statistical analysis (test hypotheses on relationships between pieces of data) Discover new relationships by querying cubes or applying data mining software.
DBSYSTEMS 6 of 20 Extraction, Transformation, and Loading Data warehouse: All data must be consistent. Customers Convert “Client” to “Customer” Apply standard product numbers Convert currencies Fix region codes Transaction data from diverse systems. Preparations performed on data – ETL process Extract Transform (Transport) Load
DBSYSTEMS 7 of 20 Three-Dimensional View of Data: Cube Product Sales at Location Sales Date Logic similar to crosstab query And pivot table. Created in a datawarehouse Days in year P5 P1 P2 P4 P3
DBSYSTEMS 8 of 20 Data Hierarchy Year Quarter Month Week Day Levels Roll-up To get higher-level totals Drill-down To get lower-level details
DBSYSTEMS Location LocationID Detail 9 of 20 Datawarehouse Tables: Star Design Revenue=Price*Quantity Fact Table * Sale SaleDate Quantity Discount Dimension Inputted from Product and Sale Revenue broken down by product, sales location, and desired time period (time column/s – day of year, or even smaller; basis for rollup). Product ProductID Price Customer CustomerID Detail Dimension Design is: - Hierarchical (dimension tables have no direct association) - De-normalized (fact table): Price & Quantity inputted to Fact table; New keys usually used in the fact table (e.g., SaleTbl#-Row#). Sale SaleDate Quantity Discount StoreID Calculated fact
DBSYSTEMS 10 of 20 Datawarehouse Tables: Snowflake Design MerchTblRow SaleTblRow Price Quantity OLAPItems ItemID Description Price Category Product SaleID SaleDate CustomerID Discount SalesTax Sale CustomerID Phone FirstName LastName Address ZipCode CityID Customer CityID ZipCode City State City Design is: -Network-like (dimension tables can connect directly) -Still partly normalized (Sale- Customer-City) Fact Table Dimension Tables Advantage: Design simplified in the Fact table part.
DBSYSTEMS SAP Datawarehouse 11 of 20 More on SAP Datawarehouse Datawarehouse Cube Details Can also be Dimensions
DBSYSTEMS 12 of 20 Multidimensional View of Data – Precursors to DW: Excel Pivot Table Can place data in rows or columns. By grouping months, can instantly get quarterly or monthly totals. Time hierarchy “Dimensions” “Facts” (Measures)
DBSYSTEMS 13 of 20 Multidimensional View of Data: CUBE Option in SQL 99 Bird Bird … Bird(null) Bird(null) Cat Cat … Cat(null) (null) (null) (null) … (null)(null) CategoryMonthAmountGcGm SELECT Category, Month, Sum, GROUPING (Category) AS Gc, GROUPING (Month) AS Gm FROM … GROUP BY CUBE (Category, Month...)
DBSYSTEMS 14 of 20 GROUPING SETS: Hiding Details Bird(null) Cat(null) … (null) (null) (null) … (null)(null) CategoryMonthAmount SELECT Category, Month, Sum FROM … GROUP BY GROUPING SETS (ROLLUP (Category), ROLLUP (Month), ( ) )
DBSYSTEMS 15 of 20 SQL RANK Functions SELECT Employee, SalesValue RANK() OVER (ORDER BY SalesValue DESC) AS rank DENSE_RANK() OVER (ORDER BY SalesValue DESC) AS dense FROM Sales ORDER BY SalesValue DESC, Employee; EmployeeSalesValuerankdense Jones18,00011 Smith16,00022 Black16,00022 White14,00043 DENSE_RANK does not skip numbers Therefore, advances in SQL motivate DBMS vendors to support OLAP and data warehousing.
DBSYSTEMS 16 of 20 Broader Data Analysis with Data Mining Goal: To discover unknown relationships in the data that can be used to make better decisions. Exploratory analysis. A bottom-up approach that scans the data to find relationships Some statistical routines, but they are not sufficient Statistics relies on averages Sometimes the important data lies in more detailed pairs Supervised by developer vs. unsupervised (self-organizing artificial neural networks)
DBSYSTEMS 17 of 20 Common Techniques 1. Classification/Prediction 2. Association Rules/Market Basket Analysis 3. Clustering
DBSYSTEMS 18 of Classification (Prediction) Purpose: “Classify” things that are causes and those that are effects. Examples Which borrowers/loans are most likely to be successful? Which customers are most likely to want a new item? Which companies are likely to file bankruptcy? Which workers are likely to quit in the next six months? Which startup companies are likely to succeed? Which tax returns are fraudulent?
DBSYSTEMS 19 of 20 Classification Process Clearly identify the outcome/dependent variable. Identify potential variables that might affect the outcome. Use sample data to test and validate the model. Regression/correlation analysis, decision tables and trees, etc. IncomeCredit HistoryJob StabilityCredit Success 50000Good Yes 75000MixedBadNo
DBSYSTEMS 20 of Association/Market Basket Purpose: Determine what events or items go together/co-occur. Examples: What items are customers likely to buy together? (Business use: Consider putting the two together to increase cross-selling.)
DBSYSTEMS 21 of 20 Association Challenges If an item is rarely purchased, any other item bought with it seems important. So combine items into categories. Some relationships are obvious. Burger and fries. Some relationships are puzzling/meaningless. Hardware store found that toilet rings sell well only when a new store first opened. But what does it mean?
DBSYSTEMS 22 of Cluster Analysis Purpose: Determine groups of people or some entities. Examples Are there groups of customers? (If so, we could target them; market segmentation) Do the locations for our stores have elements in common? (If so, we can search for similar clusters for new locations.) Do employees have common characteristics? (If so, we can hire similar, or dissimilar, people.) Small intra- cluster distance Large inter- cluster distance