Database schema for pharmacy stock management system

Designing a database schema for a pharmacy stock management system involves capturing information related to drugs, suppliers, stock transactions, and other relevant entities. Below is a basic example of a database schema for a pharmacy stock management system.


  1. Drug:

    • DrugID (Primary Key)
    • DrugName
    • Manufacturer
    • ExpiryDate
    • StockQuantity
    • UnitPrice
    • Dosage
    • Description
  2. Supplier:

    • SupplierID (Primary Key)
    • SupplierName
    • ContactPerson
    • PhoneNumber
    • Email
  3. StockTransaction:

    • TransactionID (Primary Key)
    • DrugID (Foreign Key referencing Drug table)
    • SupplierID (Foreign Key referencing Supplier table)
    • TransactionType (e.g., purchase, return, adjustment)
    • TransactionDate
    • Quantity
    • RemainingStock
  4. AdjustmentReason:

    • ReasonID (Primary Key)
    • ReasonName
  5. StockAdjustment:

    • AdjustmentID (Primary Key)
    • DrugID (Foreign Key referencing Drug table)
    • ReasonID (Foreign Key referencing AdjustmentReason table)
    • AdjustmentDate
    • QuantityAdjustment
    • RemainingStock

This schema covers the basic entities needed for a pharmacy stock management system. Here are some explanations:

  • Drugs represent the medications available in the pharmacy, with details such as name, manufacturer, expiry date, stock quantity, unit price, dosage, and description.
  • Suppliers provide drugs to the pharmacy, and their information is stored in the Supplier table.
  • StockTransaction records changes in stock quantity due to purchases, returns, or adjustments.
  • AdjustmentReason provides predefined reasons for stock adjustments.
  • StockAdjustment records adjustments made to the stock quantity, including the reason and the adjusted quantity.

Depending on the specific requirements of your pharmacy stock management system, you may need to expand or modify this schema. Consider additional features such as batch tracking, expiration tracking, order management, or any other information relevant to your pharmacy stock management platform. Additionally, ensure that your system adheres to any regulatory requirements for managing pharmaceutical inventory.