Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Project report aditi paul1


Published on

presentation on Online Analytical Processing for a Masters Level examination

  • Be the first to comment

  • Be the first to like this

Project report aditi paul1

  2. 2. WHAT IS OLAP ?<br />Basic idea: <br /><ul><li>Quickly answer multi-dimensional analytical queries.
  3. 3. Convert data into information that decision makers need
  4. 4. It is a continuous , iterative, and preferably interactive process.</li></li></ul><li>WHO USES OLAP ?<br />It is used in an organization to carry out the different ORGANIZATIONAL FUNCTIONS in :<br />Finance departments <br />Sales analysis and forecasting <br />Marketing departments <br />Cardinal Goal <br />“ Provide managers with the information they need to make effective decisions ”<br />
  5. 5. Understanding Online Analytical Processing - OLAP<br />3 part description<br />Part 1 – Online<br />Part 2 – Analytical<br />Part 3 – Processing<br />
  6. 6. PART 1 – ONLINE <br />
  7. 7. FLASH BACK<br />
  8. 8. Data Stored in a Database<br />TYPE 1<br /><ul><li>Operational Data</li></ul>Data that “works”.<br />Frequent Updates and Queries.<br />Normalized for efficient search and updates.<br />Fragmented & local relevance.<br />Point Queries .<br />
  9. 9. Examples of Operational Data<br />Account Details of a Customer in a Bank<br />Student Details in a College/School Database<br />Employee Records<br />Etc.<br />
  10. 10. Example Queries on Operational Data<br />What is the salary of Mr.Chatterjee? ( point query)<br />What is the address and phone number of the person in charge of the hardware department ?<br />How many students have received an “distinction” credential in the latest exam?<br />
  11. 11. Operational Data pertain to what we call<br />“ONLINE TRANSACTION PROCESSING”<br />As the name suggests these sorts of data are used for day to day ‘operations’ like data entry /retrieval .<br />For example : An ATM is a commercial online transaction system.<br />
  12. 12. Types of Data in a Database<br />Type 2<br /><ul><li>Historical Data
  13. 13. Data that “tells”.
  14. 14. Very Infrequent updates.
  15. 15. Integrated data set with global relevance.
  16. 16. Analytical queries that require huge amounts of aggregation.
  17. 17. Performance issues mainly in query response time.</li></li></ul><li>Examples of Historical Data<br />Last set of 10 transactions on a particular bank account of a customer<br />Record of sales of a product in the last 15 years in a company’s database<br />The profits incurred by a company stored month wise in a whole fiscal year.<br />
  18. 18. Example Queries on Historical Data<br />How is the student marks percentage scene changing over the years in college?<br />Is there a correlation between the geographical location of a company unit and excellent employee appraisals?<br />How is the employee attrition changing over the years across the company?<br />
  19. 19. Historical Data pertains to the phenomenon that is <br />“Online Analytical Processing”<br /> where queries thus do not just depend on seeing one part of a tuple .<br /> For example to find out the employee attrition, we have to find out some aggregate employee attrition and then map it against time. Thus these queries require “analyzing” certain facts and then producing a correct output . <br />
  20. 20. The necessity that these queries be ONLINE means that the queries need to be responded to in an <br />“ONLINE INTERACTIVE RESPONSE TIME”<br />as the waiting time of users is of the order of a few seconds. <br />
  21. 21. The differences Between OLAP and OLTP thus are<br />
  22. 22. PART 2 - ANALYTICAL<br />
  23. 23. Analysis of the Data<br />In order to “Analyze” this Historical Data , it needs to be stored in a certain formatted and organized manner.<br />This is accomplished by a Data Warehouse.<br />Data warehouse is an infrastructure to manage historical data from various sources.<br />It is designed to support OLAP Queries involving gratuitous use of aggregation.<br />Subject Oriented , Integrated ,Time-Variantand Non Volatile collection of data in support of management’s decision making process.<br />
  25. 25. Dimensions of Data Warehouse Modeling<br />Measures –<br />Key performance indicator that we want to evaluate.<br />Typically numerical , including volume, sales and cost.<br />A Rule of Thumb : if a number makes(business) sense when aggregated, then it is a measure.<br />Affects what should be stored in Data Warehouse.<br />Example : Aggregate daily volume to month , quarter and year<br />
  26. 26. Dimensions –<br />Categories of data analysis<br />Typical dimensions include product, time, region.<br />A Rule of Thumb : when a report is requested “by” something, that something is usually a dimension.<br />Example :In sales report , view sales by month,byregion,so the two dimensions needed are time and region.<br />
  27. 27. Dimensions and measures are physically represented by a STAR SCHEMA.<br />
  28. 28. The Data Model Which is adhered to while handling Historical Data to populate a Data Warehouse is a <br />“MULTIDIMENSIONAL DATA MODEL.”<br />One way to look at a multidimensional data model is to view it as a cube.<br />
  29. 29. CUBE  <br />It is a data structure that allows fast analysis of data. <br />It can also be defined as the capability of manipulating and analyzing data from multiple perspectives.<br />
  30. 30. BASIC STRUCTURE OF A CUBE<br />The response time of the multidimensiona-l query still depends on how many cells have to be added on the fly<br />
  31. 31.
  32. 32. n-D base cube is called a BASE CUBOID. The top most 0-D cuboid, which holds the highest-level of summarization, is called the APEX CUBOID. The lattice of cuboids forms a data CUBE.<br />
  33. 33. PART 3 - PROCESSING<br />
  34. 34. PROCESSING DATA TO INFORMATION<br />Now that we have the Required Data in the Requisite form , how do we get the Desired output to a Query which requires analyzing of the data?<br /> This is Accomplished by <br />OLAP Operations<br />OLAP Functions <br />SQL Extensions for OLAP.<br />
  35. 35. OLAP OPERATIONS<br />Dimension Tables <br />Market (Market_ID, City , Region)<br />Product (Product_ID,Name,Category,Price)<br />Time(Time_ID,Week,Month,Quarter)<br />Fact table<br />Sales(Market_ID, Product_ID,Time_ID,Amount)<br />
  36. 36. OLAP OPERATIONS<br />Aggregation – doing the ‘total’ of a measure over one or more dimensions.<br />
  37. 37. QUERY :<br />Find the Total Sales<br />(over time) of <br />each product in each<br />market<br />SELECT Market_ID ,Product_ID ,SUM(AMOUNT)FROM SalesGROUP BY Market_ID , Product_ID;<br />
  38. 38. OLAP OPERATIONS<br />2. ROLL UP<br />Specific grouping on one dimension where we go from lower level of aggregation to a higher.<br />Example :<br />“ROLL UP sales on MARKET from CITY to REGION”<br />
  39. 39. Firsty, the TOTAL SALE of a PARTICULAR Product in a city at a given time is done.Then,we use the CITY and Product ID of a city belonging to a REGION to project sales in that region<br />Select S.Product_Id,M.City,SUM(S.Amount)<br />INTO City_Sales<br />FROM Sales S,Market M<br />WHERE<br />M.Market_ID = S.Market_ID<br />GROUP BY S.Product_ID,M.City<br />
  40. 40. OLAP OPERATIONS<br />3.DRILL DOWN<br />Finer –grained view on aggregated data,i.e. going from higher to lower aggregation<br />Converse of Roll-up<br />E.g disaggregate county sales by region/city.<br />
  41. 41. OLAP OPERATIONS<br />4.PIVOTING<br />Select A different dimension(orientation) for analysis<br />
  42. 42. OLAP OPERATIONS<br />5. SLICE and DICE<br />Slicing : Selection on one or more dimensions<br />Example : “Choosing sales only in week 12”<br /> Slicing the data cube in the Time Dimension<br />SELECT S.*<br />FROM Sales S,Time T<br />WHERE T.Time_ID = S.Time_ID<br />AND T.WEEK=’Week 12’<br /> <br />
  43. 43. OLAP OPERATIONS<br />Dicing: A range selection in a hypercube. Partition or group on one or more dimensions.<br />Example :<br />“ Total sales for each product in each quarter “<br /> Dicing sales in the time dimension : <br />SELECT S.Product_ID,T.Quarter,SUM(S.Amount)<br />FROM Sales S,Time T<br />WHERE T.Time_ID=S.Time_ID<br />Group BY T.Quarter,S.Product_ID<br />
  45. 45. ROLL UP thus provides subtotals of aggregate rows.<br />
  46. 46. SQL EXTENSIONS<br />2.CUBE<br />SELECT SEM,<br />SUM(MARKS)<br />FROM TEACHERS <br />GROUP BY <br />CUBE(SEM)<br />
  47. 47. The CUBE operator provides subtotals of aggregate values in the result set<br />
  48. 48. SQL EXTENSIONS<br /> 3. GROUPING SETS lets us compute groups on several different sets of grouping columns in the same query.<br />This Query returns subtotal rows for each year, but not for the individual quarters.<br />
  50. 50. OLAP FUNCTIONS<br />1. RANK FUNCTION – Lets us compile a list of<br />values from your data set in<br />ranked order.<br />Example : The SQL query that follows finds the male and female employees from Kolkata<br />and ranks them in descending order according to salary.<br />
  51. 51. SELECT emp_lname, salary, sex,RANK () OVER (ORDER BY salary DESC) "Rank"FROM employeeWHERE city IN (’KOL’)<br />
  52. 52. OLAP FUNCTIONS<br />2.REPORTING FUNCTION : Reporting functions lets us compare non-aggregate values to aggregate values.<br />Example : The following query returns a result set that shows a list of the products that<br />sold higher than the average number of sales. The result set is partitioned by<br />year.<br /> <br />
  53. 53. SELECT *FROM (SELECT year(order_date) AS Year, prod_id,SUM( quantity ) AS Q,AVG (SUM(quantity))OVER (PARTITION BY Year) AS Average FROM sales_order JOIN sales_order_itemsGROUP BY year(order_date), prod_idORDER BY Year)AS derived_tableWHERE Q > Average<br />For the year 2000, the average number of orders was 1787. Four products<br />(700, 601, 600, and 400) sold higher than that amount. In 2001, the average<br />number of orders was 1048 and three products exceeded that amount.<br />
  54. 54. OLAP FUNCTIONS<br />WINDOW FUNCTIONS<br />Window functions lets us analyze ourdataby computing aggregate values over windows surrounding each row. The result set returns a summary value representing a set of rows.<br />
  55. 55. The query returns a result set that partitions the data by department and then provides a cumulative summary of employees’ salaries starting with the employee who has been at the company the longest. The result set includes only those employees who reside in West Bengal, BBSR, Maharashtra, or Arunachal. The column Sum Salary provides the cumulative total of employees’ salaries. SELECT dept_id, emp_lname, start_date, salary,SUM(salary) OVER (PARTITION BY dept_idORDER BY start_dateRANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS "Sum_Salary"FROM employeeWHERE state IN (’WB’, ’BBSR’, ’MH’, ’AR’) AND dept_id IN (’100’,’200’)ORDER BY dept_id, start_date;<br />
  56. 56.
  57. 57. On Line Analytical Processing<br />Thus Online Analytical Processing as a whole can be understood to be a method which takes in raw data , processes it through various functions and operations and produces Information as a Response to Multidimensional Queries in Real Time<br />
  58. 58. SERVER ARCHITECTURES<br />MOLAP : Multidimensional OLAP<br />The database is stored in a special, usually proprietary, structure that is optimized for multidimensional analysis.<br />+ : very fast query response time because data is mostly pre-calculated<br />-: practical limit on the size because the time taken to calculate the database and the space required to hold these pre-calculated values <br />
  59. 59. SERVER ARCHICTECTURES<br />ROLAP – Relational OLAP<br />The database is a standard relational database and the database model is a multidimensional model, often referred to as a star or snowflake model or schema.<br />+: more scalable solution <br />-: performance of the queries will be largely governed by the complexity of the SQL and the number and size of the tables being joined in the query <br />
  60. 60. SERVER ARCHITECTURES<br />HOLAP – HYBRID OLAP <br />A hybrid of ROLAP and MOLAP<br />can be thought of as a virtual database whereby the higher levels of the database are implemented as MOLAP and the lower levels of the database as ROLAP <br />
  61. 61. SERVER ARCHITECTURES<br />DOLAP –DESKTOP OLAP<br />The previous terms are used to refer to server based OLAP technologies<br />DOLAP (Desktop OLAP)<br />DOLAP enables users to quickly pull together small cubes that run on their desktops or laptops .<br />
  65. 65. OLAP Challenges and Future Scope<br />Analytical Complexity<br />Business questions can be rarely answered by a single query<br />Complex queries are hard to understand,write and execute efficiently<br />Need for good business analysts<br />Data Cubes can be HUGE<br />But also can be sparse<br />Can compute in advance,compute on demand , or some combination.<br />OLAP forms the underlying structure of DDAS –Distributed Data Analysis and Dissemination System.<br />From On line Analytical Processing to Online Analytical Mining <br />( OLAP to OLAM)<br />
  66. 66. BIBLIOGRAPHY<br />Data Warehousing , Data Mining and OLAP – Alex Berson,StephenJ.Smith<br />Data Warehousing And OLAp - Hector Garcia-Molina<br />Stanford University<br />A Hitchhiker’s guide to OLAP – Paul Burton and Howard ong.<br />Data mining data warehousing – Dr.HaniSaleeb<br />DATA WAREHOUSE AND OLAP TECHNOLOGY Prof. Anita Wasilewska<br />Data Mining: Concepts and Techniques Jiawei Han, MichelineKamber, and Jian Pei<br />University of Illinois at Urbana-Champaign &<br />Simon Fraser University<br />Wikipedia.<br />Data Warehousing, Filtering, and Mining-Temple University<br />Data Mining-Professor Maytal Saar-Tsechansky<br />
  67. 67. THANK YOU !<br />