Data Warehouse how to connect fact table with foreign key to dimension table whose primary key contains two attributes

StackOverflow https://stackoverflow.com/questions/22540363

Frage

I want to design my Data Warehouse fact-dimension schema, fact table should have several foreign keys, Aid, Bid, Cid.... refer to dimension tables A, B, C,.... respectively. However, dimension table C has an unique key (Aid, Cid). In this case, is that possible for link the fact record to the dimension table C with two keys (Aid and Cid)? Or I should apply another dimension table including only primary key? Thanks a lot!

War es hilfreich?

Lösung

Just as a rule of thumb, your dimension tables should have very simple primary keys, consisting of a single field. In most cases you should consider a surrogate key. Even if your dimension seems to have a natural key or a key coming from the transactional database, you are always only one requirement change away from having to support a slowly changing dimension.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top