Pharmacy Management System
Member:
Ivan Jay Zapata B.
Zyke Manalo
Chester Jafet Pajarillaga
John Arwin Bacani
Nicole Halili
Submitted to:
Jerome Mangulabnan
Data Dictionary
Medicines
Field Type Null Key Description
medicine_id int no PK Primary key
medicine_name varchar yes Name of the
medicine
category varchar yes Medicine
category (e.g.,
Antibiotic,
Painkiller)
dosage_form varchar yes Form (tablet,
syrup, injection)
strength varchar yes Dosage strength
(e.g., 500mg)
description text yes Description of
medicine
shelf_life date yes Expiry or best
before date
minimum_stock int yes Minimum stock
before reorder
maximum_stock int yes Maximum stock
allowed
manufacturer varchar yes Medicine
manufacturer
Inventory
Field Type Null Key Description
inventory_id int no PK Primary key
medicine_id int yes FK Links to
Medicines table
batch_number varchar yes Batch number
quantity int yes Quantity
available in
stock
cost_price double yes Cost per unit
selling_price double yes Selling price per
unit
expiry_date date yes Expiry date of
this batch
date_added timestamp yes Date stock was
added
Sales_Transactions
Field Type Null Key Description
transaction_id int no PK Primary key
subtotal double yes Total before tax
tax_amount double yes Tax amount
total_amount double yes Total after tax
payment_amount double yes Amount paid
change_amount double yes Change given
transaction_date timestamp yes Date and time of
transaction
cashier varchar yes Cashier name
Sales_Details
Field Type Null Key Description
sale_id int no PK Primary key
transaction_id int yes FK Links to
Sales_Transactions
medicine_id int yes FK Medicine sold
batch_number varchar yes Batch number of
medicine
quantity int yes Quantity sold
total_price double yes Total price for
quantity
profit double yes Profit made on this
sale
Void_Transactions
Field Type Null Key Description
void_id int no PK Primary key
original_transaction_i int yes FK References
d original sale
medicine_id int yes FK Medicine
voided
batch_number varchar yes Batch number
quantity int yes Quantity voided
total_price double yes Total price
voided
profit double yes Profit voided
original_date timestamp yes Original sale
date
void_date timestamp yes Date voided
voided_by varchar yes User who
voided
Display_Area
Field Type Null Key Description
display_id int no PK Primary key
medicine_id int yes FK Medicine
displayed
batch_number varchar yes Batch number
quantity int yes Quantity
displayed
date_added timestamp yes Date display
entry added
Relationships and Keys
- medicine_id links Medicines to Inventory, Sales_Details, Void_Transactions, and
Display_Area.
- transaction_id links Sales_Transactions and Sales_Details.
- Batch numbers track batches for inventory control and expiry.
Additional Considerations
- You might want a table for Patients or Customers with contact details if you want to record
patient info.
- Adding Prescriptions table if you want to manage prescriptions.
- Consider adding Suppliers table for medicine suppliers.
- Add constraints or triggers to handle expiry checks.
Sample SQL for Medicines Table
CREATE TABLE Medicines (
medicine_id INT PRIMARY KEY AUTO_INCREMENT,
medicine_name VARCHAR(255) NOT NULL,
category VARCHAR(100),
dosage_form VARCHAR(50),
strength VARCHAR(50),
description TEXT,
shelf_life DATE,
minimum_stock INT,
maximum_stock INT,
manufacturer VARCHAR(255)
);