Each entity that stores a medicine name should do so using a key. Modify the cur
ID: 3571014 • Letter: E
Question
Each entity that stores a medicine name should do so using a key. Modify the current database design so that a medication is only listed in a single entity and then referenced in other tables by a key. Add a PatientMedicationAllergies entity and define the necessary relationships. Hint: PatientMedicationAllergies is a linking entity.
Here is what I have. How do I reference CurrentMedications in other tables by a key and how do I define the relationships for PatientMedicationAllergies? I did this in Visio
Each entity that stores a medicine name should do so using a key. Modify the current database design so that a medication is only listed in a single entity and then referenced in other tables by a key. Add a PatientMedicationAllergies entity and define the necessary relationships. Hint: PatientMedicationAllergies is a linking entity. Here is what I have. How do I reference CurrentMedications in other tables by a key and how do I define the relationships for PatientMedicationAllergies? I did this in VisioExplanation / Answer
Best design based on your DB requirement is below:
1. Create a entity MedicationDetails with PK MedicationKey
2. Remove existing CurrentPatientMedications entity:
3. Modify the existing PatientMedicationAllergies as below:
Going with your question, below is the explanation:
1. You have done yourself by referencing the MedicationName as foreign key in your PatientMedicationAllergies table.
2. To refer the CurrentMedication accross all tables you need to use the bridge table PatientMedicationAllergies in all the SQL joins.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.