DBMS PBL
DBMS PBL
DBMS PBL
A PROJECT REPORT
Submitted in partial fulfillment of the requirements for the award of the degree of
Bachelor of Technology
In
Assistant Professor
VIZIANAGARAM-535005, AP (INDIA)
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.
To avoid all these limitations and make the working more accurately the
system needs to be computerized.
The Medical Shop Managing System Project system provides faster data
access, data entry and retrieval.
● The customer and medicine ID’s are not null able i.e., they cannot take null
values.
● 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.
• Staff Entity
Attributes
o staff_id
o phone
• 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
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.
Attributes
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
Symbol Meaning
Relationships (Cardinality and Modality)
Zero or One
One or More
Zero or More
Many - to - One
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,
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);
alter table orders add constraint o_staff foreign key(staff_id) references staff(staff_id);
2. desc staff;
3. desc brand;
4. desc category;
5. desc medicines;
7. desc customer;
8. desc orders;
9. desc order_items;
insert into medical_store (store_id, name, phone_no, email, street, city, state, zip) values
(1535002, "medplus", 04067006700, "[email protected]", "19-B", "VZM", "AP",
535002);
-- 2. Staff
-- 3. Brand
-- 5. Medicines
-- 6. Stocks
-- 8. Orders
-- 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;
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';
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
• Learn How Medical Store Software Manage Pharmacy Shop Process (swindia.com)