Domanda

I need some help in starting a new dimensional model (star schema) for tracking organ donors. We have an OLTP database that contains a referrals table (terminology for deaths) with info such as (gender, race, age, date of death) and related lookup tables, e.g.,date,time, race, hospital, organ type, donated organ info, etc. Some of the referrals become organ donors. I understand that most of the lookup tables will become the dimension tables but wondering if I should have 2 fact tables - factReferralInfo and factOrganDonors or only 1 fact table to track everything. We may have queries such as 'total number of referrals', 'total kidney donors', etc.

After thinking about it, I guess I need a dimension dimReferral that has the attributes for each death referral. I think I am confused since I read that you should not have a dimension table the same scope as the fact table. Maybe in the fact table, I have a row for each organ donated, e.g., kidney, pancreas, lung, etc.

È stato utile?

Soluzione

It sounds like a referral can donate multiple organs. This would be a one-to-many relationship between referrals and donations. Because of this, I would say donations should be the grain of your fact table and referrals would be a dimension. The following rough sketch is how I would begin to approach it:

Rough sketch of donation as fact table

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top