Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 Visio

Explanation / 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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote