I'm confused on how to go from 1NF to 2NF since my 1NF has 3 primary keys (I am not familiar with using 3 primary keys in a single table, however I believe it's the best option). My attempt is listed below. Please let me know if it's incorrect and how I can improve.
[Patient#, Patient_Name, First_Seen, Social_Worker, (Visit_Date, Visit_Time,
Visit_Reason, New_Symptm, LevelofPain)]
**Patient_Visit_Time** [Patient#(PK), Visit_Date(PK), Visit_Time(PK), Visit_Reason,
New_Symptm, LevelofPain, Patient_FirstName, Patient_LastName, First_Seen,
SocialWorker_FirstName, SocialWorker_LastName]
**Patient** [Patient#(PK), Patient_FirstName, Patient_LastName, First_Seen,
SocialWorker_FirstName, SocialWorker_LastName]
**Visit_Time** [Visit_Date(PK), Visit_Time(PK), Visit_Reason, New_Symptm, LevelofPain,
Patient#(FK)]
Same as 2NF
Your normalization is mostly correct. The only difference I see is that you didn't include Patient#
in the PK of Visit_Time
. In your 1NF, different patients could visit at the same time, but not in your 2NF. Your 2NF isn't invalid as it stands, but normalization doesn't change the meaning of the relations.
A note about terminology: your 1NF has a single composite primary key made up of 3 attributes. It's not 3 separate keys. Besides the fact that a table can have only one primary key (that's why it's called primary), every entry in a key must be unique. In a composite key, every entry is a unique combination of attribute values. Separate keys would mean that each of the 3 attributes would be unique on their own, preventing a patient from visiting more than once (or more than one patient visiting per day or time).