0% found this document useful (0 votes)
18 views

Edge Program Project Farmacy Man,,,,

Uploaded by

md.abrarfuad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Edge Program Project Farmacy Man,,,,

Uploaded by

md.abrarfuad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EDGE PROGRAM PROJECT

Database Schema
The schema will include the following tables:
1. Patients
2. Doctors
3. Medications
4. Prescriptions
5. Pharmacies
6. Pharmacists
7. Inventory
8. Sales
Tables
1. Patients
o patient_id (Primary Key)

o first_name

o last_name

o dob (date of birth)

o address

o phone

o email

2. Doctors
o doctor_id (Primary Key)

o first_name

o last_name

o specialization

o phone
o email
3. Medications
o medication_id (Primary Key)

o name

o description

o manufacturer

o price

4. Prescriptions
o prescription_id (Primary Key)

o patient_id (Foreign Key to Patients)

o doctor_id (Foreign Key to Doctors)

o date_prescribed

o total_cost

5. Pharmacies
o pharmacy_id (Primary Key)

o name

o location

o phone

o email

6. Pharmacists
o pharmacist_id (Primary Key)

o first_name

o last_name

o pharmacy_id (Foreign Key to Pharmacies)

o phone

o email

7. Inventory
o inventory_id (Primary Key)

o pharmacy_id (Foreign Key to Pharmacies)

o medication_id (Foreign Key to Medications)


o quantity
o last_updated

8. Sales
o sale_id (Primary Key)

o prescription_id (Foreign Key to Prescriptions)

o pharmacist_id (Foreign Key to Pharmacists)

o date_sold

o total_price

ERD (Entity-Relationship Diagram)


Creating an ERD diagram involves visualizing these tables and
their relationships. Below is a textual description of the
relationships, which can be translated into a graphical ERD
using tools like Lucidchart, Microsoft Visio, or any other ERD
software.
• Each Patient can have multiple Prescriptions.
• Each Doctor can write multiple Prescriptions.
• Each Pharmacy can have multiple Pharmacists.
• Each Pharmacy can have multiple Medications in their
Inventory.
• Each Prescription can have multiple Medications (in a
real-world scenario this would be implemented through a
linking table, but for simplicity, we consider it directly).
• Each Sale involves one Prescription and one Pharmacist.
ERD Diagram
To visualize the ERD, you can use the above
relationships and create the diagram in a tool
like Lucidchart. Here is a simple textual
representation that can guide you:
• Patients (1)---(∞) Prescriptions
• Doctors (1)---(∞) Prescriptions
• Pharmacies (1)---(∞) Pharmacists
• Pharmacies (1)---(∞) Inventory
• Medications (1)---(∞) Inventory
• Prescriptions (1)---(∞) Sales
• Pharmacists (1)---(∞) Sales

You might also like