Attribute forms – ID and DESC
Here comes the attribute. In a star schema, we typically find a dimension table with a code and a description: these two columns are the basic components of every attribute.
Thinking about this table, for example, DimProduct
: what is the most important thing that we look for in a table? Yes, the primary key. Without primary keys, we're in for trouble. It may sound too old style, but we desperately need a unique way to identify a single instance of an attribute.
I know, nowadays we have a lot of different technologies to represent information, such as NoSQL, unstructured, and XML data among others. But, if we need to analyze how many women's tights were sold last year, we need to know which women's tights we are talking about. Hence, the need for a primary key, name it a code, an ID, or anything else.
Getting ready
Said that, first of all, we identify the unique ID for a single instance of an attribute: in the case of DimProduct
it is ProductKey
. If you look at the...