0% found this document useful (0 votes)
18 views25 pages

Dbms 01 Project

The document outlines a micro project on a Pharmacy Management System developed using C++ and MySQL, aimed at automating pharmacy operations such as inventory management, sales, and customer records. It includes details on project objectives, features, implementation, and testing, demonstrating the integration of programming and database management concepts. The project is part of the academic curriculum for the 2023-2024 academic year at Brahma Valley College of Technical Education, Nashik.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views25 pages

Dbms 01 Project

The document outlines a micro project on a Pharmacy Management System developed using C++ and MySQL, aimed at automating pharmacy operations such as inventory management, sales, and customer records. It includes details on project objectives, features, implementation, and testing, demonstrating the integration of programming and database management concepts. The project is part of the academic curriculum for the 2023-2024 academic year at Brahma Valley College of Technical Education, Nashik.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

MAHARASHTRA BORAD OF TECHNICAL EDUCATION,MUMBAI

NASHIK GRAMIN SHIKSHAN PRASARK MANDAL’S

ACADEMIC YEAR: 2023-2024

MICRO PROJECT
ON

BLOOD BANK MANAGEMENT SYSTEM


COMPUTER TECHNOLOGY(3rD SEMESTER)

SUBMITTED BY

SR,NO GROUP MEMBER’S NAME SEAT NO ENROLLNMENT NO

1 Tejaswi Navnath Lokhande

2 Kartik Mahesh Suryawanshi

3 Aayushi Atul Shirsat

UNDER THE GUIDEN IN OF

[PROF. S.K.PATIL]
NASHIK GRAMIN SHIKSHAN PRASARK MANDAL’S

BRAHMA VALLEY COLLEGE OF TECHNICAL EDUCATION


ANJANERI,NASHIK

CERTIFICATE

THIS IS TO CERTIFY THAT


[TEJASWI NAVNATH LOKHANDE ]

[ KARTIK MAHESH SURYAWANSHI ]

[AAYUSHI ATUL SHIRSATH ]

Have successfully completed their Project “PHARMACY


MANAGEMENT SYSTEM USING C++ WITH MySQL” at Brahma
Valley College Anjaneri Nashik, in the partial fulfillment of the Diploma
course in Computer Technology in Academic Year 2024-2025

Prof. S.K.Patil Prof.

Guide External

Prof. M.M.Kulkarni Prof. V.P Nikhade

Head of Department Principal


TABLE OF CONTENTS
Sr. Contents Page
No. No.

1 Abstract 1

2 Introduction and Aim 2

3 Project and Details 3

4 Resource 4

5 Feature 5

6 Table Created In MySQL 9

7 Source Code 12

8 Output 15

9 Testing 17

11 Bibliography And Conclusion 18

3
Abstract
The Pharmacy Management System is a desktop-based application
developed to automate the day-to-day operations of a pharmacy,
ensuring efficient management of inventory, sales, and customer
records. This system is implemented using C++ for front-end
operations and MySQL as the back-end database for storing
and managing data.

The system offers several functionalities, such as managing medicines,


tracking supplier details, processing customer sales, and maintaining
up-to-date inventory records. Key features include the ability to add,
update, and delete records related to medicines, suppliers, and
customers. The system also tracks sales transactions, updates stock
levels accordingly, and generates sales receipts.

The primary objective of this project is to reduce manual work and


errors, streamline pharmacy operations, and ensure accurate tracking
of inventory and sales. By integrating C++ with MySQL, the
system provides a reliable and efficient solution for managing
pharmacy
activities in real-time. This project demonstrates the practical
application of database management and programming concepts,
with a focus on enhancing operational efficiency in the pharmacy
business.

In conclusion, the Pharmacy Management System offers a simple


yet effective platform for automating pharmacy operations, ensuring
accuracy, and improving productivity.

4
Introduction

A Pharmacy Management System is designed to manage

pharmacy-related tasks such as managing medicines, suppliers,

customers, and sales records. The system ensures the smooth

operation of the pharmacy by automating inventory management

and billing, ensuring that the right medicine is available at the right

time. This project aims to implement such a system using C++

integrated with a MySQL database, providing a robust solution

for efficient management.

Aim of Micro Project


The aim of this micro-project is to develop a Pharmacy

Management System that automates the tasks of a pharmacy,

such as managing the stock of medicines, handling sales, and

maintaining customer and supplier records. The project aims

to improve pharmacy operations by reducing manual errors

and increasing efficiency.

5
Project and Details:
Pharmacy & medicine Management System Project in C++ and MySQL Database

ABOUT PROJECT PROJECT DETAILS

Pharmacy & medicine Management System


Project Name :
Project in C++ and MySQL Database

Project Platform : C/C++

Programming Language
C++ Programming Language
Used:

IDE Tool
Codeblocks
(Recommended):

Project Type : Desktop Application

Database: MySQL Database

Upload Date Oct 20, 2024

Action Plan
1. Research and understand the key features required for a Pharmacy
Management System.
2. Design a database in MySQL to manage data related to medicines,
suppliers, customers, and transactions.
3. Develop the front-end functionality in C++ for performing
CRUD operations (Create, Read, Update, Delete) with the MySQL
database.
4. Test the system to ensure it meets the requirements and
handles various edge cases.
Database and Table Name use in Pharmacy Management System
Project in C++ and MySQL Database
• Table Name: medicine_tb

• Database: pharmacy_c++_db

• Sever and Library Usage: XAMPP Server, MySql Headers, MySql Libs

6
Resources Required

1. Hardware: Laptop or Desktop with C++ compiler and MySQL


server installed.
2. Software:
- C++ development environment (e.g., Dev C++, Code::Blocks)
- MySQL Database (MySQL Workbench or phpMyAdmin)
- Connector library for C++ and MySQL (MySQL Connector/C++)
3. Books/Reference : Database Management System reference
material, C++ programming tutorials.

Actual Resource Used


- Hardware: Laptop with 8GB RAM and 256GB SSD.
- Software: Code::Blocks for C++ development, MySQL Workbench
for database design, MySQL Connector for C++.
- Online Resources: Stack Overflow, C++ MySQL integration tutorials.

Course Outcome Integrated


This project integrates knowledge from the Database Management System
course, applying concepts like database design, SQL queries, C++ database
connection, and CRUD operations. It also enhances problem-solving skills
related to database programming and system management.

7
Features of Pharmacy Management System
Project in C++ and MySQL

• Buy Medicine Module – In the Pharmacy Management System, this module is for the

customer. If a consumer wishes to buy medicine, the vendor may quickly construct a list of the

medications and a total bill. The console will display all of the medicines on the list. The seller has

the option of selecting multiple drugs. A simple “Select” query returns all of the drugs in the list.

Following the confirmation of ids, the overall number of medicines purchased will drop.

Also, make sure the database is up to date. In addition, indicate the entire quantity of medicine

purchased.

• Show Item List – In Pharmacy Management System, the “Select” query will retrieve all of

the data from the database and present it in the terminal.

• Find Item from List Module – In Pharmacy Management System, a user can locate an item

from a list. The application can find all similar products using only a few characters from the

item’s name. Also, on the console, display all of the data.

• Add Item Stock Module – This function allows the user to add additional medicines.

The “Insert” query is used to create new records in the database. The user can fill in all

of the medicine’s details. The information is then entered into the database.

• Update Stock Item – This is the function to utilize if the user wants to update any information

about an item in the list. The “Update” query is used to make changes to the database.

By typing the simple term “xN,” the user can keep the old data in the database, and the

database will update the information.

• Delete Stock Item – Any object in the database can be deleted by the user. The “Erase”

query is used to delete data. Simply type the item’s id and a notice will appear, indicating that

the item has been deleted from the database.

8
ER DIAGRAM FOR PHARMACY MANAGEMENT SYSTEM

9
TABLE CREATED IN MySQL :

Pharmacy Management System Project in C++ and MySQL Database Menu Module

Pharmacy Management System Project in C++ and MySQL Database Buy Medicine Module

Pharmacy Management System Project in C++ and MySQL Database Show Item List

10
Pharmacy Management System Project in C++ and MySQL Database Find Item from the List

Pharmacy Management System Project in C++ and MySQL Database Add Item in Stock

11
Pharmacy Management System Project in C++ and MySQL Database Update Stock Item

Pharmacy Management System Project in C++ and MySQL Database Delete Stock Item

12
SOURCE CODE :
#include <iostream>
#include <mysql/mysql.h>
using namespace std;

class PharmacyManagementSystem {
private:
MYSQL *conn;
MYSQL_ROW row;
MYSQL_RES *res;

public:
PharmacyManagementSystem() {
conn = mysql_init(0);
if (conn) {
cout << "Database connection initialized successfully." << endl;
} else {
cout << "Database initialization failed!" << endl;
}
conn = mysql_real_connect(conn, "localhost", "root", "password", "PharmacyDB", 3306, NULL, 0);
if (conn) {
cout << "Connected to MySQL Database!" << endl;
} else {
cout << "Failed to connect to MySQL Database!" << endl;
}
}

void addMedicine(string name, double price, int quantity) {


string query = "INSERT INTO Medicines(name, price, quantity) VALUES('" + name + "',
" + to_string(price) + ", " + to_string(quantity) + ")";
const char *q = query.c_str();
if (mysql_query(conn, q)) {
cout << "Query Execution Failed: " << mysql_error(conn) << endl;
} else {
cout << "Medicine added successfully!" << endl;
}
}

void displayMedicines() {
string query = "SELECT * FROM Medicines";
const char *q = query.c_str();
if (!mysql_query(conn, q)) {
res = mysql_store_result(conn);
while (row = mysql_fetch_row(res)) {
cout << "ID: " << row[0] << " | Name: " << row[1] << " | Price: " << row[2] << " | Quantity: " << row[3] <<
endl;
}
} else {
cout << "Failed to fetch data: " << mysql_error(conn) << endl;
}
}
13
void updateMedicine(int id, string name, double price, int quantity) {
string query = "UPDATE Medicines SET name='" + name + "', price=" + to_string(price) + ", quantity=" +
to_string(quantity) + " WHERE id=" + to_string(id);
const char *q = query.c_str();
if (!mysql_query(conn, q)) {
cout << "Medicine updated successfully!" << endl;
} else {
cout << "Failed to update medicine: " << mysql_error(conn) << endl;
}
}

void deleteMedicine(int id) {


string query = "DELETE FROM Medicines WHERE id=" + to_string(id);
const char *q = query.c_str();
if (!mysql_query(conn, q)) {
cout << "Medicine deleted successfully!" << endl;
} else {
cout << "Failed to delete medicine: " << mysql_error(conn) << endl;
}
}

~PharmacyManagementSystem() {
mysql_close(conn);
cout << "Database connection closed." << endl;
}
};

int main() {
PharmacyManagementSystem pms;
int choice;
do {
cout << "\nPharmacy Management System\n";
cout << "1. Add Medicine\n2. Display Medicines\n3. Update Medicine\n4. Delete Medicine\n5. Exit\n";
cout << "Enter your choice: ";
cin >> choice;
switch (choice) {
case 1: {
string name;
double price;
int quantity;
cout << "Enter Medicine Name: ";

ci n >> name;
cout << "Enter Price: ";
cin >> price;
cout << "Enter Quantity: ";
cin >> quantity;
pms.addMedicine(name, price, quantity);
break;
}
case 2:
pms.displayMedicines();
14
break;
case 3: {
int id;
string name;
double price;
int quantity;
cout << "Enter Medicine ID to Update: ";
cin >> id;
cout << "Enter New Name: ";
cin >> name;
cout << "Enter New Price: ";
cin >> price;
cout << "Enter New Quantity: ";
cin >> quantity;
pms.updateMedicine(id, name, price, quantity);
break;
}
case 4: {
int id;
cout << "Enter Medicine ID to Delete: ";
cin >> id;
pms.deleteMedicine(id);
break;
}
case 5:
cout << "Exiting..." << endl;
break;
default:
cout << "Invalid choice!" << endl;
}
} while (choice != 5);

return 0;
}

15
OUTPUT:
Database connection initialized successfully.
Connected to MySQL Database!

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 1
Enter Medicine Name: Aspirin
Enter Price: 12.99
Enter Quantity: 100
Medicine added successfully!

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 1
Enter Medicine Name: Ibuprofen
Enter Price: 8.50
Enter Quantity: 200
Medicine added successfully!

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 2
ID: 1 | Name: Aspirin | Price: 12.99 | Quantity: 100
ID: 2 | Name: Ibuprofen | Price: 8.50 | Quantity: 200

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit

16
Enter your choice: 3
Enter Medicine ID to Update: 1
Enter New Name: Aspirin Extra Strength
Enter New Price: 13.99
Enter New Quantity: 150
Medicine updated successfully!

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 2
ID: 1 | Name: Aspirin Extra Strength | Price: 13.99 | Quantity: 150
ID: 2 | Name: Ibuprofen | Price: 8.50 | Quantity: 200

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 4
Enter Medicine ID to Delete: 2
Medicine deleted successfully!

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 2
ID: 1 | Name: Aspirin Extra Strength | Price: 13.99 | Quantity: 150

Pharmacy Management System


1. Add Medicine
2. Display Medicines
3. Update Medicine
4. Delete Medicine
5. Exit
Enter your choice: 5
Exiting...
Database connection closed.

17
Testing:
• Test Cases
Functionality Tests:
• Add Medicine:
o Test adding a valid medicine (e.g., "Aspirin", 12.99, 100).
o Test adding a medicine with invalid data (e.g., negative price or quantity).
• Display Medicines:
o Test displaying medicines when the database is empty.
o Test displaying medicines after adding a few entries.
• Update Medicine:
o Test updating an existing medicine's details.
o Test updating a non-existent medicine ID.
• Delete Medicine:
o Test deleting an existing medicine.
o Test deleting a non-existent medicine ID.
Usability Tests:
• Ensure user prompts are clear and informative.
• Verify that all menu options work as expected.
• Performance Testing
• Measure response time for each operation (adding, displaying, updating, and
deleting medicine

Hardware Requirements:
• Minimum Requirements:
o CPU: Intel i3 or equivalent
o RAM: 4 GB
o Storage: 100 MB free disk space
o Network: Internet connection (for MySQL server)
• Recommended Requirements:
o CPU: Intel i5 or equivalent
o RAM: 8 GB or more
o Storage: 500 MB free disk space
o Network: Stable internet connection for remote databases

Software Requirements:

• Operating System:
o Windows 10 or later / Ubuntu 20.04 or later
• Development Tools:
o C++ Compiler (e.g., GCC, MinGW for Windows)
o MySQL Server (e.g., MySQL Community Server)
o MySQL Connector/C++ (for database connectivity)
o IDE (e.g., Code::Blocks, Visual Studio, or any text editor)
• Database Management:
o MySQL Workbench (optional, for managing the database visually)

18
Bibliography:

1. Books:
o "C++ Primer" by Stanley B. Lippman, Josée Lajoie, and Barbara E. Moo
o "MySQL Cookbook" by Paul DuBois
o Database management system
2. Online Resources:
o MySQL Documentation: https://dev.mysql.com/doc/
o C++ Reference: https://en.cppreference.com/
o TutorialsPoint C++ Tutorial:
https://www.tutorialspoint.com/cplusplus/index.htm
3. Articles:
o "Secure Coding in C++: Best Practices" from various security blogs.
o MySQL Connector/C++ documentation on prepared statements
for security.

Conclusion:

The Pharmacy Management System effectively illustrates the integration


of programming and database management to streamline pharmacy
operations. By providing essential functionalities—adding, updating,
displaying, and deleting medicine records—it enhances inventory
accuracy and efficiency. This project not only showcases technical
skills in C++ and MySQL but also emphasizes the importance of secure
data handling in healthcare. Looking ahead, the system offers
potential for further enhancements, such as user authentication
and expanded features, ultimately contributing to improved pharmacy
management and patient care.

19
Annexure – IV

Micro-Project Evaluation Sheet


Name of Student: Tejaswi navnath lokhande Enrollment No:
Name of Programme: Computer Engineering Semester: Third
Course Title: Object Oriented programming using C++ Code: 313304
Title of the Micro-Project: Desing CGPA Calculator
Course Outcomes Achieved:-
Develop C++ programs to solve problem using
a) Achieved
procedure oriented approach.

b) Develop C++ programs using classes and objects. Achieved


c) Implement inheritance in C++ program. Achieved/Not Achieved
d) Use polymorphism in C++ program. Achieved/Not Achieved
e) Develop C++ programs to perform file opretions. Achieved/Not Achieved

Poor Average Good Excellent


Sr. Characteristics to be Sub-
(Marks 1- (Marks 4- (Marks 6- (Marks 9-
No. assessed Total
3) 5) 8) 10)

(A) Process and Product Assessment (Convert above total marks out of 6 Marks)
Relevance to the
1
course
Literature Review/
2 Information
Collection
Completion of the
3 Target as per Project
Proposal
Analysis of Data and
4
Representation
Quality of
5
Prototype/Model
6 Report Preparation
(B) Individual Presentation/Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Viva

(A) Process and Product (B) Individual Presentation/Viva Total Marks


Assessment (4 Marks) (10 Marks)

20
(6 Marks)

Comments/Suggestions about team work/leadership/inter-personal communication


(if any)

Name and Designation of the Teacher: Prof.

Dated Signature:

21
Annexure – IV

Micro-Project Evaluation Sheet


Name of Student: kartik Mahesh suryawanshi Enrollment No: 23611480158
Name of Programme: Computer Engineering Semester: Third
Course Title: Object Oriented programming using C++ Code: 313304
Title of the Micro-Project: Desing CGPA Calculator
Course Outcomes Achieved:-
Develop C++ programs to solve problem using
a) Achieved
procedure oriented approach.

b) Develop C++ programs using classes and objects. Achieved


c) Implement inheritance in C++ program. Achieved/Not Achieved
d) Use polymorphism in C++ program. Achieved/Not Achieved
e) Develop C++ programs to perform file opretions. Achieved/Not Achieved

Poor Average Good Excellent


Sr. Characteristics to be Sub-
(Marks 1- (Marks 4- (Marks 6- (Marks 9-
No. assessed Total
3) 5) 8) 10)

(A) Process and Product Assessment (Convert above total marks out of 6 Marks)
Relevance to the
1
course
Literature Review/
2 Information
Collection
Completion of the
3 Target as per Project
Proposal
Analysis of Data and
4
Representation
Quality of
5
Prototype/Model
6 Report Preparation
(B) Individual Presentation/Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Viva

(A) Process and Product (B) Individual Presentation/Viva Total Marks

22
Assessment
(4 Marks) (10 Marks)
(6 Marks)

Comments/Suggestions about team work/leadership/inter-personal communication


(if any)

Name and Designation of the Teacher: Prof.

Dated Signature:

23
Annexure - IV

Micro-Project Evaluation Sheet


Name of Student: Aayushi Atul Shirsath Enrollment No: 2207760168
Name of Programme: Computer Engineering Semester: Third
Course Title: Object oriented programming using C++ Code: 313304
Title of the Micro-Project: Desing CGPA Calculator
Course Outcomes Achieved:-
Develop C++ programs to solve problem using
a) Achieved
procedure oriented approach.

b) Develop C++ programs using classes and objects. Achieved


c) Implement inheritance in C++ program. Achieved/Not Achieved
d) Use polymorphism in C++ program. Achieved/Not Achieved
e) Develop C++ programs to perform file opretions. Achieved/Not Achieved

Poor Average Good Excellent


Sr. Characteristics to be Sub-
(Marks 1- (Marks 4- (Marks 6- (Marks 9-
No. assessed Total
3) 5) 8) 10)

(A) Process and Product Assessment (Convert above total marks out of 6 Marks)
Relevance to the
1
course
Literature Review/
2 Information
Collection
Completion of the
3 Target as per Project
Proposal
Analysis of Data and
4
Representation
Quality of
5
Prototype/Model
6 Report Preparation
(B) Individual Presentation/Viva (Convert above total marks out of 4 Marks)
7 Presentation
8 Viva

24
(A) Process and Product
(B) Individual Presentation/Viva Total Marks
Assessment
(4 Marks) (10 Marks)
(6 Marks)

Comments/Suggestions about team work/leadership/inter-personal communication


(if any)

Name and Designation of the Teacher: Prof.

Dated Signature:

25

You might also like