660cfc0f56031DB Lab6 LabTasks
660cfc0f56031DB Lab6 LabTasks
Lab
Ms. Asiya Batool Dated 03-04-2024
Instructor
Name Roll No
Max Marks Obtained Marks
Design and draw ERDs for the following scenarios on papers. Entities, their relationship,
cardinalities, primary key, foreign key should be clearly mentioned. Document all assumptions
that you make about the mapping constraints.
Solution
1. Patients are identified by SSN, and their names, addresses, and age have to be
stored.
2. Doctors are identified by an SSN, for each doctor, the name, specialty and years
of experience must be recorded.
3. Each pharmaceutical company is identified by name and has a phone number.
4. For each drug, the trade name and formula must be recorded. Each drug is made
by a given pharmaceutical company, and the trade name identifies a drug
uniquely from among the products of that company. If a pharmaceutical
company is deleted, you need not keep track of its products any longer.
5. Each pharmacy has a name, address, and phone number.
Task 2
6. Every patient has a primary physician (Doctor). Every doctor has at least one
patient.
7. 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.
8. Doctors prescribe drugs for patients. A doctor could prescribe one or more drugs
for several patients, and a patient could obtain prescriptions from several doctors.
Each prescription has a date and a quantity associated with it.
9. Pharmaceutical companies have long-term contracts with pharmacies. A
pharmaceutical company can contract with several pharmacies, and a pharmacy
can contract with several pharmaceutical companies. For each contract, you have
to store a start date, an end date, and the text of the contract.
10. Pharmacies appoint a supervisor for each contract. There must always a 1
supervisor for each contract.
Solution