Parent-child relationship II
In the previous recipe, we created a three-level dimension with a denormalized table. Let's do it with normalized tables. Product
, Product Subcategory
, and Product Category
all reside in different tables related with referential integrity constraints as clearly described in the database diagram.
Like I said earlier, I always set the mapping method to manual whenever I create a new attribute. That prevents the editor from looking at every column in the database with the same name and add it automatically to the attribute definition. I prefer to have control over which tables are selected and which are not when it comes to generating SQL. You may also have noticed that some tables are bold in the attribute editor and some are not. Bold tables are the primary source for that specific attribute, often referred to as lookup tables .
We will begin this time from the top of the dimension, Product Category
.
Getting ready
You should be able to create attributes by now, and...