Pharmacy Management System: ER Diagram & Database Schema

Core entities and relationships for a pharmacy management database:

Entities

  • Customer: CustomerID (PK), Name, Address, Phone, Email
  • Employee: EmployeeID (PK), Name, Address, Phone, Email, Role
  • Doctor: DoctorID (PK), Name, Address, Phone, Email, Specialty, License#
  • Medicine: MedicineID (PK), Name, Description, Price, NDC, Stock, ReorderLevel, ControlledSchedule
  • Prescription: PrescriptionID (PK), DoctorID (FK), PatientID (FK), MedicineID (FK), Quantity, Directions, Refills, DateWritten, ExpiryDate, Status
  • Order: OrderID (PK), CustomerID (FK), EmployeeID (FK), Date, Total, PaymentMethod, Status
  • OrderLine: OrderLineID (PK), OrderID (FK), MedicineID (FK), Quantity, UnitPrice

Key Relationships

  • Customer 1:M Order
  • Employee 1:M Order
  • Doctor 1:M Prescription
  • Patient 1:M Prescription
  • Medicine 1:M Prescription
  • Order 1:M OrderLine
  • Medicine 1:M OrderLine

Add indexes on foreign keys, prescription status, medicine stock. Consider audit tables for controlled substances.

Drug Treatment Centers - Related Articles