Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

MEDICAL STORE MANAGEMENT SYSTEM

A PROJECT REPORT

Submitted in partial fulfillment of the requirements for the award of the degree of

Bachelor of Technology

In

COMPUTER SCIENCE AND ENGINEERING


BY

SHAIK ASHIK AHAMAD


(20331A05HO)

Under the Supervision of


Dr.B.Srinivas

Assistant Professor

Department of Computer Science and Engineering

MVGR COLLEGE OF ENGINEERING (AUTONOMOUS)

VIZIANAGARAM-535005, AP (INDIA)

(Accredited by NBA, NAAC, and Permanently Affiliated to Jawaharlal Nehru

Technological University Kakinada)


Nov, 2022

MEDICAL STORE MANAGEMENT SYSTEM 1


Maharaj Vijayaram Gajapathi Raj (MVGR) College of
Engineering
(Autonomous)
Vizianagaram

CERTIFICATE

This is to certify that the project report entitled MEDICAL STORE MANAGEMENT
SYSTEM being submitted by Shaik Ashik Ahamad bearing registered number
20331A05H0, in partial fulfillment for the award of the degree of “BACHELOR OF
TECHNOLOGY” in Computer Science and Engineering is a record of bona fide work done
by them under my supervision during the academic year 2022-2023.

SUPERVISOR HOD CSE

Dr. B. Srinivas Dr. P. Ravi Kiran Varma

MEDICAL STORE MANAGEMENT SYSTEM 2


ACKNOWLEDGEMENT

I place on record my heartfelt appreciation and gratitude to Dr.


B. Srinivas for the immense cooperation and navigation as mentor in bringing
out the project work under his guidance. His uncompromising attitude to bring
out the best with constructive suggestions inspired me to achieve the results set
forth for the project work. I am deeply indebted to him for his excellent,
enlightened and enriched guidance.

We consider it our privilege to express our deepest gratitude of


Dr. P. Ravi Kiran Varma, Head of the Department, for his valuable
suggestions and constant motivation that greatly helped the project work to get
successfully completed.

I also thank Dr. K. V. L. Raju, principal for extending his


utmost support and cooperation in providing all the provisions for the
successful completion of the project. I sincerely thank all the members of the
staff in the Department of Computer Science & Engineering for their sustained
help in my pursuits. We thank all those who contributed directly or indirectly
in successfully carrying out this work.

MEDICAL STORE MANAGEMENT SYSTEM 3


Table of Contents
ACKNOWLEDGEMENT .............................................................................................. 3
ABSTARCT .................................................................................................................... 5
1. INTRODUCTION ....................................................................................................... 6
2. EXISTING SYSTEM .................................................................................................. 7
2.1. DISADVANTAGES OF EXISTING SYSTEM .................................................. 7
3. PROPOSED SYSTEM ................................................................................................ 8
3.1. ADVANTAGES OF THE PROPOSED SYSTEM .............................................. 8
4. OBJECTIVES ............................................................................................................. 9
5. RULES GOVERNING THE PROJECT.................................................................... 10
6. MEDICAL STORE MANAGEMENT SYSTEM......................................................... 11
6.1 MEDICAL STORE MANAGEMENT SYSTEM ENTITIES AND THEIR
ATTRIBUTES ........................................................................................................... 11
6.2. RELATIONS IN MEDICAL STORE MANAGEMENT SYSTEM ................. 14
7. COMMANDS USED TO IMPLEMENT THE SCHEMA ....................................... 16
8. ER-MODELLING ..................................................................................................... 17
9. ER DIAGRAM .......................................................................................................... 20
9.1. ER DIAGRAM GENERATED IN WORKBENCH 8.0 .................................... 21
10. IMPLEMENTATION ............................................................................................. 22
10.1. DATABASE CREATION ................................................................................ 22
10.2. ENTITY SET CREATION .............................................................................. 22
10.3. ESTABLISHING RELATIONS ...................................................................... 24
10.4. DESCRIBING THE ENTITY AND RELATIONS: ........................................ 25
10.5. INSERTING DATA INTO ENTITIES ............................................................ 27
11. QUERIES ................................................................................................................ 33
12. CONCLUSION ....................................................................................................... 35
13. REFERENCES ........................................................................................................ 36

MEDICAL STORE MANAGEMENT SYSTEM 4


ABSTARCT

This application provides a powerful tool for medical


store, operations such as holding up of medicines information’s such as medicine
name, expire date, company, quantity i.e., available in stock in database and that
details help the pharmacist to sell the medicines at a faster rate. This application
also helps in adding details of new medicines and deleting the existential ones.
This application also stores the information of each customer and the
corresponding pharmacist who sell that medicine along with the quantity and
total price i.e., whole old transaction done by customer. This software helps in
reducing the clerical work of the staffs since almost all the work can be done by
the software.

A computer-based management system is designed to


handle all the primary information required to calculate transaction which
include total cost, monthly sales etc., Separate database is maintained to handle
all the details required for the correct calculation and generation.

This software holds a well-defined RDBMS data base for


storing data in the medical store, which is capable of handling large amount of
data and frequent use of it. This system provides fast, efficient, reliable and User-
friendly interfaces in banking and has no chance of losing data while processing of
data i.e., customer transactions and medicines information. It also reduces effort
done by the accountant and reduces the load of real time computation.

MEDICAL STORE MANAGEMENT SYSTEM 5


1. INTRODUCTION

Generally, if the medical shops follow manual entering of


data such as customer details, medicine details, and report on stock of the data
it leads to a lot of time consumption. And there is a chance that there might be
errors in manual entering of data, and sometimes there might be loss of data.

Thus, we introduce the “Medical Shop Management


System”, in this case when a customer orders the medicine, the details of the
customer, type of medicine ordered and stock left of that particular medicine
will be automatically entered into the database which makes the data loss zero.
this process is simple, efficient and it’s not a time taking process. no formal
knowledge is needed for the user to manage and use this system.

It makes the work of the organization easy, as it readily


shows the amount of stock left of a particular medicine. The organization can
easily recognize and refill the medicine so that the customer can order them
anytime.

MEDICAL STORE MANAGEMENT SYSTEM 6


2. EXISTING SYSTEM
In the existing system the medicine names and their purpose have to be memorized by
the pharmacist also the transactions has to be done manually. In this case there may be
a chance of committing mistakes.

2.1. DISADVANTAGES OF EXISTING SYSTEM

• Lack of security of data.


• More manpower.
• Time consuming.
• Consumes large volume of pare work.
• Needs manual calculations.
• No direct role for the higher officials

To avoid all these limitations and make the working more accurately the
system needs to be computerized.

MEDICAL STORE MANAGEMENT SYSTEM 7


3. PROPOSED SYSTEM
The aim of proposed system is to develop a system of improved facilities.

• The proposed system can overcome all the limitations of the


existing system. The system provides proper security and reduces
the manual work.

3.1. ADVANTAGES OF THE PROPOSED SYSTEM


The system is very simple in design and to implement. The system requires
very low system resources, and the system will work in almost all
configurations. It has got following features Security of data.
• Ensure data accuracies.
• Proper control of the higher officials.
• Minimize manual data calculation and entry.
• Minimum time needed for the various processing.
• Greater efficiency
• Better service.
• User friendliness and interactive.
• Minimum time required.

The Medical Shop Managing System Project system provides faster data
access, data entry and retrieval.

MEDICAL STORE MANAGEMENT SYSTEM 8


4. OBJECTIVES

The main objective of the “Medical Shop Management System” is to manage


the details of customers and their orders, details of medicine, stock of that
particular medicine, and even details of the staff.

● The objective of this project is to reducing the manual work of data


management.
● To avoid errors and data loss
● To efficiently manage the medicines and customers to boost the
efficiency of the organization and its business.
● To efficiently retrieve the details of customers or a medicine in case of
emergencies.
● It deals with monitoring the information and transactions od medicine
stock.

MEDICAL STORE MANAGEMENT SYSTEM 9


5. RULES GOVERNING THE PROJECT

● All the customers have a unique customer ID.

● All the medicines have unique medicine ID’s.

● The customer and medicine ID’s are not null able i.e., they cannot take null
values.

● There should be a minimum amount of stock of particular medicine so that the


customer can place orders.

● The stock column is monitored to maintain the supplies

● Any customer with a unique customer ID can place order for the medicine
based on the prescription.

● All the staff or employees of the medical store have a unique Staff ID

● Phone numbers of the staff and the customers are specified for emergency
contact.

● Phone number is unique for customer and staff.

MEDICAL STORE MANAGEMENT SYSTEM 10


6. MEDICAL STORE MANAGEMENT SYSTEM

This ER (entity Relationship) Diagram represents the model of medical store


management system entity. The entity-relationship diagram of MEDICAL
STORE MANAGEMENT SYSTEM shows all the visual instrument of
database tables and the relationship between medical store, staff, orders,
customers, stock, medicines, etc. The main entities of the MEDICAL STORE
MANAGEMENT SYSTEM are medical store, staff,

6.1 MEDICAL STORE MANAGEMENT SYSTEM ENTITIES


AND THEIR ATTRIBUTES
• Medical_store Entity
Attributes
o store_id
o address
➢city
➢state
➢street
➢zip
o phone
o email
o name
• Stock Entity
Attributes
o store_id
o quantity
o exp_dt
o arrival_dt
o mfg_dt

• Staff Entity
Attributes
o staff_id
o phone

MEDICAL STORE MANAGEMENT SYSTEM 11


o name
➢ f_name
➢ l_name

• Customer Entity
Attributes
o customer_id
o name
➢ f_name
➢ l_name
o address
➢ city
➢ state
➢ street
➢ zip
o phone
o email
• Orders Entity
Attributes
o order_id
o o_date
• Order_items Entity
Attributes
o item_id
o quantity
• Medicines Entity
Attributes
o medicine_id
o name
o cost
o description
• brand Entity
Attributes
o brand_id
o name

MEDICAL STORE MANAGEMENT SYSTEM 12


• Category Entity
Attributes
o category_id
o name

EXPLANATION:

• In this er diagram we took the medical shop as the main entity which can
manage the staff, orders, stock and indirectly customers and medicines.
• In this er diagram a customer entity is in relationship with the orders entity in
one-to-many relationship because one customer has many orders
• In turn to generate the bill, orders entity is connected to the orders_items in
one-to-many relationship because an order can have one or more items at a
time.
• To know what the medicine (item/ product) details is we connected order_items
entity and medicines entity in one-to-many relation.
• As same medicine composition has different company or brand names and
categories like liquid, tab. Etc., we established a ternary relationship between
these entities.
• To update stocks medicines entity is connected to stocks entity.

MEDICAL STORE MANAGEMENT SYSTEM 13


6.2. RELATIONS IN MEDICAL STORE MANAGEMENT
SYSTEM
• Manages:
o It is a ternary relationship between medical store, orders and stock.
o It describes that medical store can manage both orders and stock.
o One medical store can manage many orders and stocks. So it is a one to
many relationship.
ATTRIBUTES:
➢ Store_id
➢ Order_id
➢ Stock_id
• Holds:
o It is a relationship between medicines and stock.
o It describes that one medicine can has any number of stocks regarding Its
manufacturing date and quantity, etc.
o One medicine can hold many stocks. So, it is a one to many relationship.
ATTRIBUTES:
➢ Stock_id
➢ Medicine_id
• Takes:
o It is a relationship between staff and orders.
o It describes that one staff can Manage and take many orders from many
customers.
o One staff takes many orders, so it is a one-to-many relationship.
ATTRIBUTES:
➢ Staff_id
➢ Order_id
• Have:
o It is a relationship between medical store and staff.
o One medical store can have many staff or Pharmacists so it is a one to many
relationship.
ATTRIBUTES:
➢ Staff_id
➢ Store_id
• Consists
o It is a relationship between orders and order items.
o It describes that one order contains many order items. So it is a one to many
relationship.
ATTRIBUTES:
➢ Order_id
➢ Item_id
• Has

MEDICAL STORE MANAGEMENT SYSTEM 14


o It is a ternary relationship between Medicine’s category and brand.
o It describes that one category has many medicines and one brand has many
medicines.
o So, it is many to one relationship.
ATTRIBUTES:
➢ Brand_id
➢ Category_id
➢ Medicine_id
o It is a relationship between medicine and order items
o One medicine has many order item. So, it a one-to-many relationship.
ATTRIBUTES:
➢ Item_id
➢ Medicine_id
o It is a relationship between customer and orders
o It describes that one customer has many orders. So, it is a one to many
relationship.
ATTRIBUTES:
➢ Order_id
➢ Customer_id

MEDICAL STORE MANAGEMENT SYSTEM 15


7. COMMANDS USED TO IMPLEMENT THE SCHEMA

• SQL DATA MANIPULATION LANGUAGE COMMANDS


o UPDATE: updates data into a database table.
o DELETE: deletes data from a database table.
o INSERT: inserts new data into the database table.

• SQL DATA DEFINATION LANGUAGE COMMANDS


o CREATE TABLE: creates a new database table.
o ALTER TABLE : alter (changes) the database table.
o DROP TABLE : deletes the database table

• SQL DATA QUERY LANGUAGE COMMAND


o SELECT \ : extracts data from a data table.

MEDICAL STORE MANAGEMENT SYSTEM 16


8. ER-MODELLING

Er-modelling is a modelling technique used in software engineering to produce a


conceptual of data model of a information system. Diagrams created using ER-modelling
technique are called Entity-Relationship diagrams or ER diagrams or ERD’s.so you can say
that Entity Relationship diagram illustrate the logical structure of database. The original
notation for ER diagram uses Rectangles to represent Entity and Diamonds for the
Relationship.
There are three basic elements in ER-modelling diagram:

• Entities are the “things” for which we want to store the


information. Entity can be a person, place or event.
• Attributes are the data that we want to collect for the Entity.
• Relationships describe the relations between the entities.
The symbols used in the ER diagram are:
Symbol Shape Name Symbol Description
Entities

An entity is represented by a rectangle


Entity
which contains the entity’s name.

An entity that cannot be uniquely identified


by its attributes alone. The existence of a
weak entity is dependent upon another
Weak Entity entity called the owner entity. The weak
entity’s identifier is a combination of the
identifier of the owner entity and the partial
key of the weak entity.

An entity used in a many-to-many


Associative relationship (represents an extra table). All
Entity relationships for the associative entity
should be many

Attributes

In the Chen notation, each attribute is


Attribute represented by an oval containing atributte’s
name

MEDICAL STORE MANAGEMENT SYSTEM 17


An attribute that uniquely identifies a
Key
particular entity. The name of a key attribute
attribute
is underscored.

An attribute that can have many values


(there are many distinct values entered for it
Multivalued
in the same column of the table).
attribute
Multivalued attribute is depicted by a dual
oval.

An attribute whose value is calculated


(derived) from other attributes. The derived
Derived
attribute may or may not be physically
attribute
stored in the database. In the Chen notation,
this attribute is represented by dashed oval.

Relationships
A relationship where entity is existence-
independent of other entities, and PK of
Strong
Child doesn’t contain PK component of
relationship
Parent Entity. A strong relationship is
represented by a single rhombus

A relationship where Child entity is


Weak existence-dependent on parent, and PK of
(identifying) Child Entity contains PK component of
relationship Parent Entity. This relationship is
represented by a double rhombus.

Entity Relationship Diagram Symbols.

Symbol Meaning
Relationships (Cardinality and Modality)

Zero or One

One or More

One and only One

Zero or More

Many - to - One

MEDICAL STORE MANAGEMENT SYSTEM 18


a one through many notation on one side of a
relationship and a one and only one on the
other
a zero through many notation on one side of
a relationship and a one and only one on the
other
a one through many notation on one side of a
relationship and a zero or one notation on the
other
a zero through many notation on one side of
a relationship and a zero or one notation on
the other
Many - to - Many

a zero through many on both sides of a


relationship

a zero through many on one side and a one


through many on the other

a one through many on both sides of a


relationship

a one and only one notation on one side of a


relationship and a zero or one on the other

a one and only one notation on both sides

MEDICAL STORE MANAGEMENT SYSTEM 19


9. ER DIAGRAM

MEDICAL STORE MANAGEMENT SYSTEM 20


9.1. ER DIAGRAM GENERATED IN WORKBENCH 8.0

MEDICAL STORE MANAGEMENT SYSTEM 21


10. IMPLEMENTATION

10.1. DATABASE CREATION

create database MedicalShopManagementSystem;


use MedicalShopManagementSystem;

10.2. ENTITY SET CREATION

1. – medical_store
create table medical_store (store_id int primary key auto_increment,
name varchar(10) not null,
phone_no bigint unique not null,
email text not null,
street varchar(10) not null,
city varchar(10),
state varchar(10),
zip int(6) not null);
2. – staff
create table staff(staff_id int primary key auto_increment,
f_name varchar(10) not null,
l_name varchar(10) ,
phone bigint unique not null,
store_id int not null);
3. -- brand
create table brand(brand_id int primary key auto_increment,
name varchar(10) not null);
4. – category
create table category(category_id int primary key auto_increment,
name varchar(10) not null);
5. -- medicines
create table medicines(medicine_id int primary key auto_increment,
name varchar(20) not null,
description text not null,
cost int not null,
brand_id int not null,
category_id int not null);
6. -- stock
create table stock(stock_id int primary key auto_increment,
arrival_dt date,
mfg_dt date,

MEDICAL STORE MANAGEMENT SYSTEM 22


exp_dt date,
store_id int not null,
medicine_id int not null,
quantity int not null);

7. -- customer
create table customer(customer_id int primary key auto_increment,
f_name varchar(10) not null,
l_name varchar(10),
phone bigint unique not null,
email text, street varchar(10) not null,
city varchar(10),
state varchar(10),
zipcode int(6) not null);

8. -- orders
create table orders(order_id int primary key auto_increment,
o_date date,
store_id int null,
staff_id int null,
customer_id int null);
9. -- orders_items
create table order_items(item_id int primary key auto_increment,
quantity int not null,
medicine_id int not null,
order_id int not null);

MEDICAL STORE MANAGEMENT SYSTEM 23


10.3. ESTABLISHING RELATIONS
1. Relation between staff and medical store.

alter table staff add constraint m_storeid foreign key(store_id) references


medical_store(store_id);

2. Relation between medicines, brand and category.

alter table medicines add constraint branch1 foreign key(brand_id) references


brand(brand_id);

alter table medicines add constraint category1 foreign key(category_id) references


category(category_id);

3. Relation between stock, medicines and medical store

alter table stock add constraint stock_med foreign key(medicine_id) references


medicines(medicine_id);

alter table stock add constraint stock_med_store foreign key(store_id) references


medical_store(store_id);

4. Relation between orders, customer, staff, medical store.

alter table orders add constraint o_cus foreign key(customer_id) references


customer(customer_id);

alter table orders add constraint o_staff foreign key(staff_id) references staff(staff_id);

alter table orders add constraint o_store foreign key(store_id) references


medical_store(store_id);

5. Relation between order items, orders and medicines.

alter table order_items add constraint o_item_o foreign key(order_id) references


orders(order_id);

alter table order_items add constraint o_item_medcines foreign key(medicine_id)


references medicines(medicine_id);

MEDICAL STORE MANAGEMENT SYSTEM 24


10.4. DESCRIBING THE ENTITY AND RELATIONS:
1. desc medical_store;

2. desc staff;

3. desc brand;

4. desc category;

5. desc medicines;

MEDICAL STORE MANAGEMENT SYSTEM 25


6. desc stock;

7. desc customer;

8. desc orders;

9. desc order_items;

MEDICAL STORE MANAGEMENT SYSTEM 26


10.5. INSERTING DATA INTO ENTITIES
-- 1. medical_store

insert into medical_store (store_id, name, phone_no, email, street, city, state, zip) values
(1535002, "medplus", 04067006700, "wecare@medplusindia.com", "19-B", "VZM", "AP",
535002);

select * from medical_store;

-- 2. Staff

insert into staff(staff_id, f_name, l_name, phone, store_id) values (15350021,


"Ankit","Kumar", 9885948345, 1535002),
(15350022, "Ahamed", "Alisha", 5867429413, 1535002),
(15350023, "Rahul","Ramana", 2534128974, 1535002);

select * from staff;

-- 3. Brand

insert into brand(brand_id, name) values (100,"Mankind"),


(200,"Pfizer"),
(300,"Dr. Reddys"),
(400,"Cipla");

select * from brand;

MEDICAL STORE MANAGEMENT SYSTEM 27


-- 4. Category

insert into category(category_id, name) values (1,"Syrup"),


(2,"Tablet"),
(3,"Capsules"),
(4,"Drops"),
(5, "Inhalers"),
(6,"Injections");

select * from category;

-- 5. Medicines

insert into medicines(medicine_id, name, description, cost, brand_id, category_id) values


(101,'Dolo','fever', 10, 100, 2),
("301", "Dolo", 'fever', 12, 300, 2),
(102,'Aspirin', 'Headache', 40, 100, 3),
(201, 'Advil','Headache', 45, 200,2),
(103,'Benadryl', 'Cough', 50, 100, 1),
(401, 'Solvin', 'Cough', 45, 400, 1),
('202', 'Kofol', 'Cough',55, 200, 1),
(302, 'Solvin', 'Cough', 42, '300',2),
(104,'Buscogast', 'Stomachache',47, 100, 2),
(203,'Meftal', 'Stomachache',33, 200, 2),
(303, 'Cyclopam', 'Stomachache', 67, 300, 1),
(402, 'Aristozyme', 'Stomachache', 72, 400, 1),
(105,'Gelusil', 'Gastic', 97, 100, 1),
(403,"Pantoprazole", 'Gastic', 68, 400, 2),
(106, 'Levocitirizine', 'Cold or flue', 98, 100, 2),
(204, 'vicks', 'Cold or flue',55,200,5 ),
(304, 'Azeflow','Cold or flue',339,300, 4),
(205,'Metrogyl', 'Diarrhea', 77, 200, 1),
(305,'Flagyl', 'Diarrhea', 69, 300, 2),
(306, 'Asthalin', 'Astama', 255, 300, 2),
(404, 'Budecort', 'Astama', 165, 400, 5),

MEDICAL STORE MANAGEMENT SYSTEM 28


(405, 'Cromal', 'Inflammation of eyes', 112, 400, 4),
(406, 'Monocef', 'Antibiotic', 125, 400, 6);

select * from medicines;

-- 6. Stocks

insert into stock(stock_id, arrival_dt, mfg_dt, exp_dt, store_id, medicine_id, quantity)


values (1,'2022-09-01','2022-04-15','2024-07-01', 1535002,101,200),
(2,'2022-09-01', '2022-4-16', '2024-07-15', 1535002,102,300),
(3,'2022-09-01', '2022-4-16', '2024-06-15', 1535002,103,30),
(4,'2022-09-03', '2022-4-25', '2024-08-19', 1535002,104,400),
(5,'2022-09-03', '2022-5-12', '2024-08-13', 1535002,105,40),
(6,'2022-09-04', '2022-5-12', '2024-06-15', 1535002,106,350),
(7,'2022-09-04', '2022-5-12', '2024-06-15', 1535002,201,300),
(8,'2022-10-01', '2022-5-10', '2024-06-15', 1535002,202,20),
(9,'2022-10-01', '2022-5-11', '2024-06-15', 1535002,203,100),
(10,'2022-10-01', '2022-5-12', '2024-06-15', 1535002,204,25),
(11,'2022-10-01', '2022-5-12', '2024-09-07', 1535002,205,20),
(12,'2022-10-06', '2022-5-12', '2024-09-17', 1535002,301,300),
(13,'2022-10-06', '2022-5-22', '2024-08-15', 1535002,302,250),

MEDICAL STORE MANAGEMENT SYSTEM 29


(14,'2022-11-01', '2022-5-23', '2024-06-15', 1535002,303,18),
(15,'2022-11-01', '2022-5-21', '2024-08-15', 1535002,304,11),
(16,'2022-11-01', '2022-5-12', '2024-08-15', 1535002,305,225),
(17,'2022-11-01', '2022-6-12', '2024-09-28', 1535002,306,150),
(18,'2022-11-05', '2022-6-12', '2024-09-25', 1535002,401,10),
(19,'2022-11-05', '2022-6-12', '2024-10-15', 1535002,402,15),
(20,'2022-11-05', '2022-6-12', '2024-10-12', 1535002,403,200),
(21,'2022-11-06', '2022-6-16', '2024-10-25', 1535002,404,15),
(22,'2022-11-06', '2022-7-12', '2024-11-02', 1535002,405,9),
(23,'2022-11-06', '2022-7-21', '2024-11-01', 1535002,406,30);

select * from stock;

MEDICAL STORE MANAGEMENT SYSTEM 30


-- 7. customer
insert into customer(customer_id, f_name, l_name, phone, email, street, city, state, zipcode)
values (1001,'Ashik', 'Ahamad', 7093356740, 'shaikahamad456@gmail.com','16-
B','VZM','AP',535001),
(1002,'Satwik', 'Naidu', 7413366125, 'stawik97@gmail.com','16-A','VZM','AP',535001),
(1003,'Chandhan','Lohit', 1577886612,'chandhanxyz@gmail.com', '10-
A','VZM',"AP",535002);

select * from customer;

-- 8. Orders

insert into orders(order_id, o_date, store_id, staff_id, customer_id) values (15351,'2022-11-


10',1535002,15350021,1001),
(15352,'2022-11-10',1535002,15350021,1002),
(15353,'2022-11-12',1535002,15350021,1003),
(15354,'2022-11-12',1535002,15350022,1001);

select * from orders;

MEDICAL STORE MANAGEMENT SYSTEM 31


-- 9. order_items

insert into order_items(item_id,quantity, medicine_id, order_id) values


(1,5,101,15351),(2,2,102,15351),
(3,1,105,15351),(4,1,303,15352),
(5,1,304,15352),(6,6,305,15353),
(7,2,306,15353),(8,9,403,15354),(9,2,405,15354);

select * from order_items;

MEDICAL STORE MANAGEMENT SYSTEM 32


11. QUERIES
-- 1. select customers who bought medicines when staff 15350021 is working.

select f_name, l_name from customer c inner join orders o on c.customer_id =


o.customer_id where staff_id = 15350021;

-- 2. Select the customer details who has visited the store more than one time.

select c.* from customer c inner join orders o on c.customer_id = o.customer_id having
count(o.customer_id)>1;

-- 3. give the count of customer who has visited the store.

select customer_id, count(customer_id) as visited from orders group by customer_id;

-- 4. select distinct orders

select distinct * from orders group by customer_id order by customer_id asc;

MEDICAL STORE MANAGEMENT SYSTEM 33


-- 5. show what are the medicines that are ordered by customer name Ashik on 2022-
11-12.

select m.name, m.cost, ot.quantity, s.exp_dt , ot.quantity*m.cost as total from stock s inner
join medicines m on s.medicine_id = m.medicine_id inner join order_items ot on
ot.medicine_id = m.medicine_id inner join orders o on o.order_id = ot.order_id inner join
customer c on c.customer_id = o.customer_id where c.f_name like 'Ashik' and o.o_date =
'2022-11-12';

-- 6. select medicines which belong to mankind brand.


select m.name, cost, b.name as company from medicines m inner join brand b on
b.brand_id = m.brand_id where b.name like 'mankind';

MEDICAL STORE MANAGEMENT SYSTEM 34


12. CONCLUSION

This software has made working in a medical store a much easy job.

This software maintains a log of every customer bill. It has purchase stock about its

arrival date, manufacture date, expiry date, and quantity of each medicine. This software

generates a bill automatically. It gives a lot of details about the stock sell. In short, it is

a medical inventory that has made lives easier. This software is called the medical store

management system. It provides every small to big details like customer details, purchase

details, sell or pharmacist details, bill details, etc. Because of this software, we are having

a complete control in the data management and enhanced control on redundant data. Our

software ensures more security because of the relations and integrity of the data. This

application is user friendly and the pharmacist need not to remember any sort of

medicines hence it is convenient for both the customer and pharmacist and there will be

a regular monitor on sales by the owner.

MEDICAL STORE MANAGEMENT SYSTEM 35


13. REFERENCES

• ER Diagrams | ER Diagram Symbols | Gate Vidyalay

• A - Z Drug List from Drugs.com

• DBMS Convert ER into table - javatpoint

• Learn How Medical Store Software Manage Pharmacy Shop Process (swindia.com)

• SQL Constraints (w3schools.com)

MEDICAL STORE MANAGEMENT SYSTEM 36

You might also like