Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A chain of pharmacy stores has asked you to design its database. Here s the information that you gather: 1 . Patients are identified by
A chain of pharmacy stores has asked you to design its database. Heres
the information that you gather:
Patients are identified by their ID For each patient, the ID first
name, last name, address, and date of birth must be recorded.
Doctors are identified by their ID For each doctor, the ID first
name, last name, specialty, and years of experience must be
recorded.
Each clinic is identified by its name and city. For each clinic, the
name, city and address, phone number are recorded.
Health insurance companies are identified by their ID For each
health insurance company, its ID name, address and phone number
must be recorded.
Doctors work at clinics. Each doctor should be associated with at
least one clinic.
Every patient has one primary physician. Every doctor has at least
one patient.
Each drug company is identified by its ID For each drug company,
its ID name, address, and phone number are recorded.
For each drug, the name and formula must be recorded. Each drug
is made by a given drug company, and the drug name identifies a
drug uniquely among the products of that company. If a drug
company is deleted, its products drugs should also be deleted.
Each pharmacy has a unique ID For each pharmacy, its ID name,
address and phone number are recorded. A pharmacy can either be
an instore pharmacy which has an address or an online
pharmacy which has a webURL
Each pharmacy sells several drugs and has a price for each. A drug
could be sold at several pharmacies, and the price could vary from
one pharmacy to another.
Every patient has an insurance policy that was purchased from a
health insurance company. The policy has a unique policyID. For
each policy, the effective date and expiration date are recorded.
Doctors write prescriptions for patients. A doctor can write
prescriptions for many patients and a patient could obtain
prescriptions from multiple doctors.
A doctor could prescribe one or more drugs in a prescription. Each
prescription has a prescription number and a date associated with
it Each prescription is given to the patient in a certain clinic and
the prescription number is unique within the clinic it is given.
A drug prescribed in a prescription may or may not be covered by
a patients insurance policy. No additional details need to be
recorded on the drugs coverage by the insurance policy.
Drug companies have longterm contracts with instore
pharmacies. A drug company can have contracts with several in
store pharmacies, and an instore pharmacy can have contracts
with several drug companies. For each contract, you have to store a
start date, an end date, and the text of the contract.
Pharmacies appoint a supervisor for each contract. There must
always be a supervisor for each contract.
Questions:
a Complete ER Diagram pts: Draw an ER diagram for the
pharmacy database. Make sure that your design captures all of
implications of the business model, including:
all of the relevant entities and their attributes, including keys;
all the relevant relationships and associated attributes, appropriate
key constraints for the relationships, and appropriate participation
constraints for the relationships.
b Partial ER Diagram pts: How would your design change if
each drug must be sold at a fixed price by all pharmacies? Draw the ER
diagram of just the entities and relationships that would need to be
updated.
c Style pts: Make sure that your diagram is drawn digitally and is
clear and easy to read. You may use MS Word, Apple Pages, LucidChart,
or another software to draw the diagram. Make sure to use the ER
notations covered in the lecture notes. Do not use UML or Crows Foot
notation. Do not draw the ER diagram by hand and take its picture.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started