Parent-child relationship I
Attributes can be related to each other (like in the case of city, province, and country) to form relationships between them. Furthermore, the tables holding attribute data can be normalized, as in the DimProduct
, DimProductSubcategory
, and DimProductCategory
or denormalized as in the DimGeography
table where we have province and country names repeated in every row. It is important that foreign keys are in place to preserve data integrity and help the RDBMS use the less expensive query path. So, for example, we have in the DimProductSubcategory
table a foreign key pointing to the primary key in the DimProductCategory
table.
If you look at the content of the DimProduct
table, you'll see some records with NULL
values in the DimProductSubcategory
column; there are no sales transactions for those products, but this is a very common data quality problem. Missing values in foreign keys is something we usually have to deal with. If those products had sales movements...