3 D4: Conformed Dimension A conformed dimension table is a dimension table shared by fact tables.Ex: PRODUCT dimension table is shared by two fact tables – SALESFACT and PROCOST.A conformed dimension table should mean the same thing with every fact table to which it is joined.D: refers to special considerations for dimension tables or special types of dimension tables
4 D4: Conformed Dimension Conformed dimension tables connect separate star schemas into an enterprise star schema.Support drill across queries on star schema
5 D5: Role-playing Dimension Role-playing dimension is a dimension which plays several simultaneous roles when used with a fact table.In the following star schema, time dimension plays two different roles – ORDERDATE and DELIVERYDATE.
6 D5: Role-playing Dimension Although ORDERDATE and DELIVERYDATE have exactly the same table structure, they need to be treated as different tables.SALEFACT (CUSTOMER_KEY, PRODUCT_KEY, ORDERDATE_KEY, DELIVERYDATE_KEY, QUANTITY, SALES)ORDERDATE (ORDERDATE_KEY, ODATE, DAY_OF_WEEK, DAY_OF_MONTH)DELIVERYDATE (DELIVERYDATE_KEY, DDATE, DAY_OF_WEEK, DAY_OF_MONTH)Query: List sales of products ordered on Wednesday and delivered on FridaySelect sum(sales)From SALEFACT S, ORDERDATE O, DELIVERYDATE DWhere S.ORDERDATE_KEY = O. ORDERDATE_KEY ANDS. DELIVERYDATE_KEY = D. DELIVERYDATE_KEY ANDO.DAY_OF_WEEK = 3 ANDD.DAY_OF_WEEK = 5
7 D5: Role-playing Dimension If we replace ORDERDATE and DELIVERYDATE with one time dimension table SDATE, we get,SALEFACT (CUSTOMER_KEY, PRODUCT_KEY, ORDERDATE_KEY, DELIVERYDATE_KEY, QUANTITY, SALES)SDATE (SDATEID, SDATE, DAY_OF_WEEK, DAY_OF_MONTH)Note: ORDERDATE_KEY and DELIVERYDATE_KEY in SALEFACT table are foreign keys refer to SDATEID in SDATE table.Query: List total sales ordered on Wednesday and delivered on FridaySelect sum(sales)From SALEFACT S, SDATE SDWhere S.ORDERDATE_KEY = SD.SDATEID ANDS.DELIVERYDATE_KEY = SD.SDATEID ANDSD.DAY_OF_WEEK = 3 ANDSD.DAY_OF_WEEK = 5This query will return nothing!
8 F2: Types of Fact Attributes Additive fact attributes can be added along any dimension.
9 F2: Types of Fact Attributes Non-additive fact attributes cannot be added along any dimension.
10 F2: Types of Fact Attributes Semi-additive fact attributes can be added along some dimensions.
11 F3: Factless Fact TableFactless fact table is a fact table that contains only warehouse keys without any fact attributes.Factless fact table is useful for event tracking, such as tracking student class attendance event.
13 F3: Factless Fact TableInstead of sum function used in common fact tables, query on factless fact tables use count functionHow may courses did student Mark take on 01/01/99?Select count(course_key)From Attendance A, Attend_time AT, Student S, Course CWhere A.Time_key = AT.Time_key ANDS.Student_key = A.Student_key ANDS.SNAME = ‘Mark’ ANDAT.Date = ’01/01/99’