reifly mentioned (and linked above) but there are several important database design criteria:
Normal FOrm essentially means removing redundant data. Taken to the extreme (3rd Normal Form, IIRC) this means that a name in your database is simply a list of keys: This guy is
000001 0075 8003
where another table lists just names:
0075 John
8003 Smith
ANd 000001 is that particular John Smith’s special ID.
So we don’t waste space repeating “John” 50,000 times.
Logically, for things like state names, this is obvious; PA or NY repeated for all 1,000,000 clients is a lot less wasted space than spelling them out in full; and a simple table can list the 50 states and their codes (and PR, DC, and 12 provinces and territories of Canada, etc.) Similarly, you would have a table of Medical History - say a list of pairs - 00001 066 Where 066 is a key in the table of medical procedures - “oh, look, this pair says John SMith has had a mastectomy.”
So for simple normalization, great - you eliminate a lot of redundant data. That’s one aspect of database design. So much for theory.
You also seem to ask about separating the simple from the sensitive; one table for ID info, another for medical history. Good idea and practical. Practical database design, as many examples above show, has may pitfalls:
I worked with a fully normalized database. Manual debugging is almost impossible, you ar forever looking up keys. God help you if something scrambles the data and you don’t notice for a while…
Every table is either data and a unique key, or tuples - key from Table A matched to key from table B (i.e. patient identity and medical procedure). When your design includes a lot of these tuples, it is a good idea to keep the keys as small as possile.
Many posts above point out the pitfalls of using real data for composite keys - SSNs are NOT unique, even sex can change, not to mention name, address, eye colour (contacts); DoB may even be misrepresented.
The obvious question is - what do you need? If the patient shows up at a desk, the reception/nurse will need to ask them who they are. Perhaps it becomes a game of 20 questions - what’s your name, DoB, when were you here last, current or previous address/phone, last procedure?(so you keep address/phone history list similar to procedure list). Short of DNA (which identical twins can share) there is nothing unique about a person except fingerprints or retina pattern; however, we hope your customers are not trying to conceal their identities as they might in a police line-up. Plus, anticipated customer base (2,000? Or 10,000,000?) has a bearing on how complex the
Most databases have the ability to generate unique keys. That’s the best situation, rather than trying to find a real-world unique key. Also, I find a lot of effort often spent programming for really wild cases; why not give someone a tool to correct patient info (heavily logged) rather than trying to code for sex-change possibility?