Click here to Skip to main content
15,904,655 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can someone tell me which way is better to store blood details like A+,O+,etc..

Bloodgroup is A,B,AB,O...
Bloodtype is positive, negative..

I need to keep track of the blood details like O+ in my blood inventory.

What I have tried:

Instead of placing bloodgroup and bloodtype in donors table, can i just do it as shown below?

C#
Donors : donorID, bloodGroupID, bloodTypeID, ..etc
BloodGroups : bloodGroupID, remarks..etc
BloodTypes : bloodTypeID, remarks..etc



or

C#
Donors : donorID, bloodID, ..etc
Bloods : bloodID, bloodGorup, bloodTypeID, remarks..etc
BloodTypes : bloodTypeID, remarks..etc
Posted
Updated 8-Dec-16 7:56am
v2

1 solution

As there are only 8 blood types
O+
O-
A+
A-
B+
B-
AB+
AB-

I think it could be overkill to normalize the database to the extent you have suggested, and could just store the Blood Type as a VarChar. But you imply that you may want to store remarks against each one (e.g. the estimated percentage of population with each type, or a "ranking" on rarity) and of course you may want to populate a dropdown with the valid entries. So...

Personally I would have a BloodTypes table with the 8 rows listed above, and store the BloodTypeID against a person (donor).

I (personally) wouldn't bother to take it to the extra level of separating out the blood groups as I don't think it's necessary, efficient or conducive to ease of use and understanding. Purists may think differently.
 
Share this answer
 
Comments
心心傷心 8-Dec-16 15:26pm    
okay, thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900