0% found this document useful (0 votes)
33 views

Business Analytics Chapter 7

Uploaded by

Vinayak Pandla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
33 views

Business Analytics Chapter 7

Uploaded by

Vinayak Pandla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 52
Multidimensional Data Modeling BRIEF CONTENTS What’ in Store Dimension Table Introduction ‘Typical Dimensional Models Data Modeling Basics Dimensional Modeling Life Cycle ‘Types of Data Model Designing The Dimensional Model Data Modeling Techniques Soived Exercises Fact Table apes ‘Unsolved Exercises a — WHAT'S IN STORE You are already familiar with the concepts relating to basics of RDBMS, OLTR and OLAP applicx tions, role of ERP in the enterprise as well as “enterprise proieton cwior for a deployment We hope you hi Teanyrasp on the concepts covered in the chapters “Types of Digital Dac (Chapter o “Ineduction e OLN? and OLAP” (Chaprer 3), “Getting Starved with Business Intelligence” (Chapter 4), and "Basies of Data Integration (Chapter 6)”, With this background ies time to think about “how data is modeled”. . ike a circuit diagram is to an elect 1 ees tg om ee eigen architect, But ie “data modeling” only the responsibility of a daca architece? The answer is “No”. A i i ication de Iay is involved in designing, developing, deploying, Business Intelligence (BI) application ope ne syarchousellata marts-To be able to play his/her Wier rls heavily on daa modesdaea agra o understand | engineer, an assembly diagram is to a mechanical engi- Supporting, and optimizing storage in ¢ tole efficiently, the BI application devel N tenet . i data, etc. In thi Sy 206 nships between is cha he relatio oa ter hema structure, the data, Stn — How to go about designing a data Model 2. e i the a the basics of data modeling and cons of the popular Modeling tech’ Ini i : ros yoo We cies the p' - logical levels? W nodeling, . modeing and dimensional dime of the learning resources suggested at the eng fer to sot i oF this . , vill get deeper knowledge by interacting yin’ ‘Kp, We suggest you refer ee si complete the “Test Me’ ou sli Wiaeeeyoumee te =e shared their project experience - ing through the chapter. 7.1 INTRODUCTION Refer to the Case Study Brief of “TenToTen Retail Stores” 7 smetic products has been introduced by a leading brand, which Tenors, ty oo outers, In this regard TenToTen wants to study the market and the, a choice of cosmetic products. Asa ern strategy the group also wants to Offer attcctig rg tory offer like discounts, buy one get one free, etc, “yb have a sound knowledge of the cosmetics market, TenToTen study of the buying pattern of consumers’ by geography, the sales of ¢ Preferred brand, etc. and then decide on a strategy to promote the product. To take right decisions on various aspects of business Preferences, tc. TenToTen Stores has deveded ¢, g0 in fo expansion, product prometay, ox enterprises alike, After studying the requirements of TenToTen Sto, warehouse application, “Y ® construct a d; but forth by TenToten ¢ Hatt Model res, AllSolutions decided on buil that would meet the business requis addressed "ores, AllSolutions identified the following concerns that nee? 1. What ate the enticje ; in chs ‘ other? SONes involved in this business process and how are they reed =» 2. What tab dated ws, 3. What cam ed be thos J it€s Must be included in the data warchous? 4. What are th © Included into eq, table? 6. ye tlationship has tobe mada ave with each other and which is the columa What should f, iz a 7. What are the fy om ins Paitons {oF the columns that have been identife? Ravi 0 be added j ban need down on the “eauitements for ie the tables? 1 rst 3 for model” Understand What ig enTo’ as d10™ ade Ten Stores, we now proceed to build isda “model? and yp. «re the steps involved in dete Data Modeling 7.2. DATA MODELING Basics pefore getting down to the basics of data modelin e gen ie ng let us an peri: ateibue, cardinality ofa relationships ees do a quick recap on a few database terms such ete, 7.2.1 Entity Entigrs# common word for anything real or absnact shout which we data, Ent cenealy fall into five categories: roles (such as employe, executives, ere), everts (ouch a hockey match, cricket match, ctc:), locations (such as office campus, auditoriu nd mul oth inde rancible things (such as book, laptop, ete), oF concepts (such as» proce ides), areal ae, Lunher, Connors, Jennifer, etc. could be instances ofthe “employec"entiy um 7.2.2. Attribute An attribute is 2 characteristic property of an entity. An entity could have multiple atributes. For example, for the “car” entity, attributes would be color, model number, number of doors, right or left hand drive, engine number, diesel or petrol, ete. 7.2.3. Cardinality of Relationship ‘This relationship defines the type of relationship between two participating entities. For example, one employee can work on only one project at any given point in time. One project, however, can have several employees working on it, So, the cardinality of relationship between employce and project is “mnany to one”. Here is an example ofa “one to one” cardinality. One person can sit on only one chai ar any point of time. One chair can accommodate only one person in 2 given point of ime. So, chs relationship has “one co one” cardinality. “To read more on entity, attribute, cardinality, etc. please refer: « An Introduction to Database Systems (8th Edition), C.J. Date, Addison Wesley. © Database System Concepts by Abraham Silberschatz, Henry Korth and S. Sudarshan, McGraw Hill. «© Fundamentals of Database Systems (6th Edition) by Ramez. Elmasti and Shamkant Navathe, ‘Addison Wesley. With this understanding of afew database terms, let us proceed «© understand data model. TYPES OF DATA MODEL resentation of the di he relationship between A data model is a di | and n s a diagrammatic rep! : ship beove cites, Although time consuming, the process of creaing & dara model is extr nly impor, It assists in identi ow che entities are relaced ehrough a visual representation of theif insips and thus helps dee possible errors in the “Freabase design. Ie helps in building, robust database/dara warehouse. There are three types of data models: * Conceptual Data Model. | Stal 108 Model + Logical Dats A, . Physical Dara Data Model designed by identifying the various entities and theh; isderrements. Let us look at some features of, cant tel | \ tual 4 ConceP' 73. node! al dara mode! ; neept he given require con een he spe «+ Iridentifies he most + Ieidentifies relations! © Iedoes not support «Ie does not support hack to the requirement specification of TenToTen Stores, node (Figure 7.1). In this case, the entities can be identified as ils of products). . (to store the category detail ; . sabeoeoy (co store the details of sub-categories that belong to dire ca, « Product (to store product details). ; + PromotionOfer (to store various promotion offers introduced by the compay nen + ProductOffer (to map the promotion offer to a product). + important entities. . hips between different entities. he specification of attributes. he specification of the primary key. let us design been a) Date (1o keep track of the sale date and also to analyze sales in different meet Territory (to store various territories where the stores are located). MarketType (to store devails of various market setups, viz. “Hypermatkes &Sec “Traditional Supermarket”, “Dollar Store”, and “Super Warehouse’), OperatorType (to store the det Outlet (to store * Sales (to store all : ails of types of operator, viz. company-opeatedai= the details of various stores distributed over various location). I the daily transactions made at various stores). There can be several oth above. Let us now defin r entities, but for the current scenario we restrict ourselves ¢ the relationships that exist between the various entities sel Outlet has a MarketType, Outlet has an Operator; Outlet belongs oe SubCategory : toa Territory : * Product belongs tog: pec MeBOHY- ProductOffer’ er is an ing ils ofa Product. "et &f Promotion Offer for a Product. les ina g 5 na Sales from On duration, « : 32 Logical Data Mog 1 el gf elis used inde . ue 1 i o Fa tsideration i py tibe data in as much derail 38 possible. Wn ka ta model: "0 the physical implementation spect: Le" lidmenional Data Modeling + 209 Date Market Type Sales >| outiet | Operator Type sub- category K—] Product Territory Product Promotion Category Offer Offers Figure 7.1. The conceptual data model for TenToTen Stores. + Ie specifies the primary key for each entity. * especifis the Foreign keys (keys identifying the relationship berween different entities). + Normalization of entities is performed at this stage. Here is a quick recap of various normalization levels: Normal Form INE Relation should have atomic attributes. The orm row relat domain of an attribute must include only atomic ateribure, (imple, indivisible) values. 2NF. For relations where the primary key contains Deconnpose and form a new relation. | “ muleipe tributes (composite primary key, far each partial key with its dependent \ non-key attributes should not be fanetionally ——actribute(s), Reta the relation with the dependent on a pare ofthe primary key exit primary key and any atetbures that | ac fally Functionally dependent on it, | NF FE ld waves ww nibe( [ Deirpsn a reat | factional determined by another non-key includes the nonekey attibute(s) that bute (r by a et of not key aida ther finetionally determine(s) other non-key eer or dpould be no transitive dependency of | urtrbute(s), g books: the followin ition), aad ison Wesley: ry Korth and S. Sudarshan, McG l “eq hake 1o our case study. Having iden and thus design the logins Before in now we enti JoTen Stores data for Ten Category Primary Key roducrCaregory 1D is used fo uniquely Pi cae a “erent types of ateBOris: N “The name of the corresponding TEEN: CategoryName SubCategory Oe ee Per aad Primary Key ‘Category ID uniquely identifies ProduesSubCategoryID The Product Sul ch product. the sub-categories that belong t0 ea SubCategoryName “The name ofthe corresponding sub-category. Refers to the Category The Product Category ID to which the sub- (ProduetCategoryID) ProducrCategoryD category belongs, (eon Product luctlD ‘The product code for the respective product, and Primary Key will be the primary key for the Product Table. Produc me jeNan The name of the product. ProductDescriptic i i ceDescription Gives brief description about the product SubCategorylD Describes the sub-category the product bi to. cy eg pr elongs DateOfProduction imm/yy) Date when the pa en the conesponding produce was “dd/mmiyyyy” fot LastDate I ae The lst date the shipping was made to th fs made to the warchouse, CurrentlventoryLevel in the iy theinventory oF the produce, ‘The standard price for the Product, The listed price for the Prodi luct, StandardCose ListPrice (Continued) saohtinued Us i Discontinue sea to find whether the manufacturing of a “Y" or" particular product has been discontinued. ; ccontinuedDate he date wl i DiscontinuedDat The date when the product manufacture was “ddfmmlyyyy" format discontinued, PromotionOffers ans eet erercaa Ie is used to uniquely identify the various Primary Key PromotionOfferID promotion offers. (Discounts, Buy One The ype of offers given. Get One Free, etc.) Promotion Type The percentage of discoune given on the List Price DiscountPercentage of the product. ComplimentaryProduct Complimentary products that might be offered with a product. DateOfOfferExpiry The date when the offer will expire. “ddimmlyyyy" format ProductOffer ec Columns peat ProductID Refers to a product from the product table vo Primary Key, Refers to Product (Product) which the offer is to be made. cistobe Primary Key. Refers to the promotion offer tha Refers to PromotionOffers PromotionOfferID given with a product. : (PromotionOfferID) Date Os Columns Description DatelD The Date ID foreach date for uniquely idesffing primary Key each date. Date The corresponding dare. —M [Poe | + Each BU can have many projects allocated to it, but there are chances that different modules of che same project may be allocated to different uni Hence the cardinality is “many to one”. Project | N [Business Unis Step 3: Identify the key attribute or attributes + BU Name is the key attribute for the entity “Business Units’, as it identifies the business units uniquely. + EmployeelD is the key attribute for the entity “Employee” which is a forcign key for the “BU Head” enti + ProjectID is the key attribute for the “Project” entity. * ClientID is the key attribute for the “Client” entity. * HouseNumber is the key attribute for the “Address” entity. Step 4: Identify all other relevant attributes + Business Units(Domain). + Employee(EmployeeName, EmaillD, PhoneNumber). * Project(ProjectName, StartDate, EndDate). * Client(ClientName). * Address(Street, City, State, Country). Siep 5: Draw the ER diagram. Figure 7.4 shows the diagram of the ER model for Letus take a quick look at the pros and cons of ER modeling. Pros: * The ER diagram is easy to understand and is represented in a language that the can understand. * Itcan also be casily understood by * Itis intuitive and helps in the imp! * Ithelps in understanding the system at @ Cons; “InfoMechanists”. business users a non-technical domain expert. ; Jementation on the chosen database platform. higher level i ay have some amount of redundancy. using ER model may hav {The physical designs derived win aug of the limited information available in che * There is scope for misincerpretations bi scope for misincerp' diagram, (c0rione > oa T (ome) 1 ‘Assigned >— M Employoo Des Figure 7.4 ER model for “InfoMechanists”. 7.4.2 Dimensional Modeling Let us understand why dimensional modeling is required. Picture this... You have just reached the Bangalore International Airport. You are an Indian national due © ie London, Heathrow International Airport. You have collected your boarding pass. You have wo NP that you would like checked in, The person at the counter asks for your boarding pass, weighs the BS pastes the label with details about your flight number, your name, your travel date, source airport and destination airport code, etc. He then pastes a similar label ar he bck of your boarding Pas 1 done, you proceed to the Immigration counter, passport, and boarding pass in hand. The person tg immigration counter verifies your idemtity, visa, boarding pass, etc. and then sta ps the imm : nar seal with the current date on your passport. Your next stop is the security counter. The seus) Pr nel scrutinize your boarding pass, passport, etc. And you find yourself in the queue to beet ced Again quick, careful rounds of verification by the aircraft crew before you find yourself en:

You might also like