0% found this document useful (0 votes)
19 views1 page

660cfc0f56031DB Lab6 LabTasks

Uploaded by

Muhammad Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

660cfc0f56031DB Lab6 LabTasks

Uploaded by

Muhammad Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Database Systems Lab (CS-232 )

Database Systems - Lab 06

Namal University Mianwali


Faculty of Computer Science

Lab
Ms. Asiya Batool Dated 03-04-2024
Instructor
Name Roll No
Max Marks Obtained Marks

Lab 06 – Lab Tasks

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.

A salesperson may manage many other salesperson. A salesperson is managed by


only one salesperson. A salesperson can be an agent for many customers. A
customer is managed by one salespeople. A customer can place many orders. An
order can be placed by one customer. An order lists many inventory items. An
Task 1
inventory item may be listed on many orders. An inventory item is assembled from
many parts. A part may be assembled into many inventory items. Many employees
may assemble an inventory item from many parts. A supplier supplies many parts. A
part can be supplied by many suppliers.

Solution

Here is the information the information gathered for Prescriptions-R-X chain of


pharmacies to make a data base design:

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

You might also like