2Modeling Data Warehouse A data warehouse is based on a multidimensional data model which views data in the form of a data cubeA data cube allows data to be modeled and viewed in multiple dimensionsDimension tablesFact table contains measures and keys to related dimension tables
3Cont.Star schema: A fact table in the middle connected to a set of dimension tables.Snowflake schema: represents dimensional hierarchy by normalizing the dimension tables.save storagereduces the effectiveness of browsingFact constellations: Multiple fact tables share dimension tables
4Q3Suppose that a data warehouse consists of the three dimensions time, doctor, and patient, and the two measures count and charge, where charge is the fee that a doctor charges a patient for a visit.(a) Enumerate three classes of schemas that are popularly used for modeling data warehouses.Star schemaSnowflake schemaFact constellation schema
5Q3 cont.(b) Draw a schema diagram for the above data warehouse using one of the schema classes listed in (a). Using a star schema.
6Q3 cont. Star Schema time Fact Table Measures time_key doctor_id dayday_of_the_weekmonthquarteryeartimedoctor_iddoctor_namephone #addressgenderdoctorFact Tabletime_keydoctor_idpatient_idChargeCountpatient_idpatient_namephone #addressgenderpatientMeasures
7Q5Suppose that a data warehouse consists of the four dimensions, date, spectator, location, and game, and the two measures, count and charge, where charge is the fare that a spectator pays when watching a game on a given date. Spectators may be students, adults, or seniors, with each category having its own charge rate. Draw a star schema diagram for the data warehouse.
8Q5 cont. Star Schema date Sales Fact Table date_id spectator_id daymonthquarteryeardatespectator_idspectator_namephone #addressStatusCharge ratespectatorSalesFact Tabledate_idspectator_idlocation_idgame_idChargeCountlocation_idphone #Streetcityprovincecountrylocationgame_idgame_namedescriptionproducergame