0% found this document useful (0 votes)
11 views48 pages

ABU Dhabi Indian: School

Computer Science investigatory for class 12 cbse
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)
11 views48 pages

ABU Dhabi Indian: School

Computer Science investigatory for class 12 cbse
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/ 48

ABU DHABI INDIAN SCHOOL

BRANCH-1, AL WATHBA

COMPUTER SCIENCE
PROJECT
(2024- 2025)

MEDICAL SHOP MANAGEMENT


PROGRAM

SUBMITTED BY:

NAME: Nehal Roopesh

CLASS: XII SECTION: AM

EXAM NO:
ABU DHABI INDIAN SCHOOL,
BRANCH-1, AL WATHBA

CERTIFICATE

This is to certify that Nehal Roopesh of

Class 12 _ Section A-M , Examination

N0. has satisfactorily completed the

project in COMPUTER SCIENCE, during the academic session


2024-2025 as prescribed by the CBSE, towards the partial
fulfillment of the All India Senior Secondary School Certificate
Examination conducted by CBSE, New Delhi.

Teacher In- Charge Principal

Date of Examination:

Internal Examiner :

External Examiner:
Acknowledgement

I would like to take this opportunity to express my heartfelt gratitude to all those who have
supported me in completing this project.

I would like to take this opportunity to express my profound gratitude to my teacher of


Computer Science, Ms. Santhi, for her invaluable guidance and continued encouragement with
regard to this project. Your lucid suggestions and patience served as a persistent motivation
and helped me remain focused and organized.

I am also deeply grateful to my parents for their unwavering support, understanding, and
encouragement. Your love and belief in my abilities gave me the strength to persevere and
complete this task to the best of my abilities. Thank you for always being there to lend a helping
hand and for providing the resources I needed.

I am lastly thankful to God for giving me the strength, wisdom, and perseverance that have
enabled me to carry out this project.

Sincerely,

Jomy Prince
INDEX
SI NO CONTENT PAGE NO

1 Overview of the project

2 Requirements: Software, Hardware

3 Package/Module/Functions used in the project

4 Source code

5 Output

6 Conclution

7 Bibliography
Overview

Python-Based Medicine Shop Management System with SQL


Connectivity

Medicine Shop Management System in Python will automate the different


operations that happen in a pharmacy or a medicine shop. The program makes
use of SQL connectivity for managing data storage. Some of the key features
included in this program are adding, deleting, and managing medicines,
generating bills, and displaying available stock. This system provides a user-
friendly interface to the staff working in a pharmacy to carry out daily activities
efficiently.

Some Key Features:

Add Medicine:
The system allows the addition of new medicines to the inventory. This includes
specifying details such as the medicine name, category, price, stock quantity, and
expiry date.

The data is stored in a relational database for easy retrieval and updates.

Delete Medicine:
Medicine can be removed from the system if it is no longer in stock or if it needs
to be discontinued.

1
A deletion operation serves to update the database by removing the record of the
medicine from the inventory.

Generate and Display Bills:


The system allows the generation of bills for customers based on the medicines
they purchase. It calculates the total cost by multiplying the quantity of the
medicine with its unit price.

Bill formatted in a presentable format; it should depict the various items


purchased along with all the details of the purchased items, showing the final bill
amount.

View All Medicines Available:


The software can fetch and list the available medicines within the store. This
makes it easy for the staff within the pharmacy to go through the stock and
control them.

It can also show relevant details like: name, stock quantity, price, and Expiration
Date.

6
Software And Hardware used

Main softwares used

1. Python
Python is a programming language that is widely used in web applications,
software development, data science, and machine learning (ML). Developers use
Python because it is efficient and easy to learn and can run on many different
platforms. Python software is free to download, integrates well with all types of
systems, and increases development speed.

2. MYSQL
MySQL is a relational database management system (RDBMS) developed by
Oracle that is based on structured query language (SQL).

A database is a structured collection of data. It may be anything from a simple


shopping list to a picture gallery or a place to hold the vast amounts of
information in a corporate network. In particular, a relational database is a digital
store collecting data and organizing it according to the relational model. In this
model, tables consist of rows and columns, and relationships between data
elements all follow a strict logical structure. An RDBMS is simply the set of
software tools used to actually implement, manage, and query such a database.

7
For my project (medical shop management) I have used SQL and Python to
develop an easy and efficient medicine management program where all records
with regard to medication and inventory can be stored managed with ease. SQL
gave a base for storing and maintaining information about the stock of each
medicine, its name, quantity, dosage, date of expiry, and supplier details. This is
combined with Python into the SQL database that can allow several functions to
be done on the data ,providing current stock of medicines, addition of new
medicines, and dispensing in real time.I have also used MYSQL connector in
Python to effectively connect thepython interface and MYSQL so that I can carry
out fuction in mysql trhough python in a easier manner.

8
Package/Module/Functions used in the project

Random module :

The Python Random module is a built-in module for generating random integers
in Python. These numbers occur randomly and does not follow any rules or
instructuctions. We can therefore use this module to generate random numbers,
display a random item for a list or string, and so on.

1) random() Function:
The random.random() function gives a float number that ranges from 0.0 to 1.0.

2) randint() Function :
The random.randint() function generates a random integer from the range of
numbers supplied.

3) randrange() Function
The random.randrange() function selects an item randomly from the given range
defined by the start, the stop, and the step parameters. By default, the start is set
to 0. Likewise, the step is set to 1 by default.

Time module :

As the name suggests Python time module allows to work with time in Python. It
allows functionality like getting the current time, pausing the Program from
executing, etc.

1) time.sleep() Function :
It is a function in the time module that pauses the execution of the program
for the specified number of seconds. The argument can be a floating point
number to indicate more precise sleep times (like fractions of a second). This
function is useful for delaying actions or simulating delays in your programs.

9
Source code

Part 1

import mysql.connector as mysql

conn=mysql.connect(host="localhost",user="root",password="1234")

if conn.is_connected():

print("sucessfully connect")

cur=conn.cursor()

query1= ("drop database medicine_shop")

cur.execute(query1)

query0=("CREATE DATABASE IF NOT EXISTS medicine_shop")

cur.execute(query0)

query01=("use medicine_shop")

cur.execute(query01)

query1 = ("""

CREATE TABLE medicine (

10
medid int(25) PRIMARY KEY NOT NULL,

name VARCHAR(25),

manfname VARCHAR(25),

dateofman DATE,

dateofex DATE,

mg VARCHAR(25),

content VARCHAR(25),

price int(25),

qty int(25)

""")

cur.execute(query1)

query2 = ("""

INSERT INTO medicine (medid, name, manfname, dateofman, dateofex, mg,


content, price, qty)

VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)

""")

values = (1, "Acetaminophen", "sinofarm", "2024-12-12", "2026-12-12", 10,


"chlorine", 25, 100)

cur.execute(query2, values)

11
val1=(2, "Adderall", "sinofarm", "2024-11-02", "2025-01-12", 10, "phosphate" ,21,
50)

val2=(3, "Amitriptyline", "phizer", "2022-10-19", "2026-11-10", 9, "salysilic acid",


20, 150)

cur.execute(query2 ,val1)

cur.execute(query2,val2)

print("table created")

conn.commit()

query3=(

"""CREATE TABLE IF NOT EXISTS bill (

bno VARCHAR(25) PRIMARY KEY NOT NULL,

cname VARCHAR(100),

medicine VARCHAR(10000),

amount int(25),

bdate date

)""")

12
cur.execute(query3)

print("Table created ")

13
Part 2
############### MEDICINE MANAGMENT PROGRAM####################

import mysql.connector as mysql

conn=mysql.connect(host="localhost",user="root",password="1234",db="medicin
e_shop")

if conn.is_connected():

print("sucessfully connect")

cur=conn.cursor()

import time

import random as rd

def addmed():

print(" ")

print("*" * 15)

print(" ")

mid = input("Enter Medicine Id : ")

14
name = input("Enter Medicine Name : ")

mf = input("Enter Name of Manufacturer : ")

dom = input("Enter Date of Manufacture in the form (yyyy-mm-dd) : ")

doe = input("Enter Date of Expiry in the form(yyyy-mm-dd): ")

mg = input("Enter the Weight (in mg) : ")

content = input("Enter Content : ")

price = input("Enter the Price : ")

qty = input("Enter the Quantity : ")

print("STORING MEDICINE DETAILS")

time.sleep(2)

q = ("insert into medicine values(%s,%s,%s,%s,%s,%s,%s,%s,%s)")

data = (mid, name, mf, dom, doe, mg, content, price, qty)

cur=conn.cursor()

cur.execute(q, data)

print("Medicine Inserted")

print("#" * 15)

print("\n")

conn.commit()

time.sleep(2)

15
def showmed():

q = ("SELECT * FROM medicine")

cur.execute(q)

res = cur.fetchall()

print("*" * 15)

print("\n")

print("-" * 95)

print("Id\tName\t\tDate_of_Expiry\t\tPrice\t\tQty")

print("-" * 95)

for row in res:

medid = row[0]

name = row[1]

date_of_expiry = row[4]

price = row[-2]

qty = row[-1]

print(medid, "\t", name, "\t\t", date_of_expiry, "\t\t", price, "\t\t", qty)

print("-" * 95)

print("\n")

16
time.sleep(2)

def restock():

mid = input("Enter the Medicine ID : ")

qty = input("Enter the Quantity to Add : ")

query = "UPDATE medicine SET qty=qty + %s WHERE medid = %s"

data = (qty, mid)

cur = conn.cursor()

cur.execute(query, data)

conn.commit()

print("restocking.... ")

time.sleep(2)

print("medicine sucessfully restoked")

time.sleep(2)

def search():

mid = input("Enter the Medicine ID : ")

17
q = "select * from medicine where medid = " + mid

cur = conn.cursor()

cur.execute(q)

k = cur.fetchone()

if k == None:

print("No Medicine Available With This ID")

print("---" * 15)

else:

print("Medicine Found")

print("*" * 15)

print("\n")

print("-" * 95)

print("Id\tName\t\tDate_of_Expiry\t\tPrice\t\tQty")

print("-" * 95)

print(k[0], "\t", k[1], "\t\t", k[4], "\t\t", k[-2], "\t\t", k[-1])

print("-" * 95)

print()

time.sleep(2)

def seebill():

18
bno= input("Enter the Bill no : ")

q = ("select * from bill where bno=" + bno)

cur = conn.cursor()

cur.execute(q)

k = cur.fetchone()

if k == None:

print("No bill Available With This no")

print("--- " * 15)

else:

print("Bill Found...... !!")

print("*" * 15)

print("\n")

print("-" * 95)

print("Bill No\t\t\tName\t\t\t\tmedicine\t\t\tAmount")

print("-" * 95)

print(k[0], "\t\t\t", k[1], "\t\t\t", k[2], "\t\t\t", k[3], "\t\t")

print("-" * 95)

print()

time.sleep(2)

19
def billing():

bno = input("Enter Bill No.: ")

cname = input("Enter Customer's Name: ")

bdate = input("Enter Bill Date (yyyy-mm-dd): ")

amount = 0

medicine = ""

cur = conn.cursor()

while True:

mid = input("Enter Medicine ID: ")

q = ("SELECT * FROM medicine WHERE medid = "+mid)

cur.execute(q)

res = cur.fetchone()

if res is None:

print("No Medicine Available With This ID")

print("--- " * 15)

else:

price = int(res[-2])

medicine += res[1] + " "

print("Price of Medicine is: ", price)

20
qty = int(input("Enter the Quantity to be Purchased: "))

bill = price * qty

amount += bill

print("Amount for Medicine: ", amount)

ans = input("Are There More Medicines to be Purchased (yes/no): ")

if ans.lower() == "no":

print("Calculating Your Bill")

time.sleep(2)

break

print("Total Bill Amount is: ", amount)

q = ("INSERT INTO bill VALUES (%s, %s, %s, %s, %s)")

data = (bno, cname, medicine, amount, bdate)

cur.execute(q, data)

conn.commit()

print("generating bill... ")

time.sleep(2)

print(" Bill Generated ")

time.sleep(2)

21
def showbills():

print("--- " * 15)

q = ("select * from bill")

cur = conn.cursor()

cur.execute(q)

res = cur.fetchall()

print("/n")

print("-" * 95)

print("BillNo\tName\t\tMedicine\t\t\tAmount\t\tDateofBill")

print("-" * 95)

for k in res:

print(k[0], "\t", k[1], "\t\t", k[2], "\t\t", k[3], "\t\t\t", k[4])

print("-" * 95)

print("\n")

time.sleep(2)

def deletem():

mid = input("Enter the Medicine ID : ")

q = "delete from medicine where medid = " + mid

22
cur = conn.cursor()

cur.execute(q)

print("Deleting medicine.")

time.sleep(2)

print("Medicine Deleted")

print("---- " * 15)

print("\n\n")

conn.commit()

time.sleep(2)

a = rd.randint(1, 9)

b = rd.randint(1, 9)

c = rd.randint(1, 9)

d = rd.randint(1, 9)

e = rd.randint(1, 9)

num = str(a) + str(b) + str(c) + str(d) + str(e)

print("\t\t", num)

n = int(input("Enter The Number Shown Above : "))

if str(n) == num:

23
print("Loading.... ")

time.sleep(2)

print("You've Successfully Entered the Shop")

print("--- " * 15)

print("\n")

print("\t\t\tCHEMIST SHOP MANAGEMENT")

print("\n")

print("\t\tThanks for Visiting.... !!!")

print("--- " * 15)

time.sleep(2)

while True:

print("--- " * 15)

print("\t\t\t The Medical Store")

print("--- " * 15)

print("\n")

print("Press 1 - Add New Medicine")

print("Press 2 - Restock a Medicine")

print("Press 3 - Show All Medicines")

print("Press 4 - Search a Medicine")

print("Press 5 - Delete a Medicine")

24
print("Press 6 - Billing")

print("Press 7 - Display Previous Bills")

print("press 8 - to see your bill")

print("press 9 - to Exit")

print("\n")

opt = int(input("Enter Your Choice : "))

if opt == 1:

addmed()

elif opt == 2:

restock()

elif opt == 3:

showmed()

elif opt == 4:

search()

elif opt == 5:

deletem()

elif opt == 6:

billing()

elif opt == 7:

showbills()

elif opt == 8:

25
seebill()

elif opt == 9:

print("THANKS FOR VISITING..!!")

print("--- " * 15)

print("\t\t Have a Medicine-Free Life Ahead")

print("*" * 95)

break

else:

print("You're having only 8 options to choose ")

break

else:

print("Seems like it's not a human being ")

print("You Can't Enter The Software. SORRY ")

26
Output
Part 1

sucessfully connect

table created

Table created

27
Part 2

sucessfully connect

79711

Enter The Number Shown Above : 79711

Loading....

You've Successfully Entered the Shop

CHEMIST SHOP MANAGEMENT

Thanks for Visiting.... !!!

28
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 1

***************

29
Enter Medicine Id : 40

Enter Medicine Name : paracetamol

Enter Name of Manufacturer : cerave

Enter Date of Manufacture in the form (yyyy-mm-dd) : 2023-09-12

Enter Date of Expiry in the form(yyyy-mm-dd): 2023-08-09

Enter the Weight (in mg) : 100

Enter Content : calcium

Enter the Price : 120

Enter the Quantity : 20

STORING MEDICINE DETAILS


Medicine Inserted

###############

30
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 2

Enter the Medicine ID : 440

Enter the Quantity to Add : 12

restocking....

medicine sucessfully restoked

31
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 3

***************

32
Id Name Date_of_Expiry Price Qty

1 Acetaminophen 2026-12-12 25 100

2 Adderall 2025-01-12 21 50

3 Amitriptyline 2026-11-10 20 150

40 paracetamol 2023-08-09 120 20

33
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 4

Enter the Medicine ID : 1

Medicine Found

***************

34
Id Name Date_of_Expiry Price Qty

1 Acetaminophen 2026-12-12 25 100

35
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 4

Enter the Medicine ID : 2

Medicine Found

***************

36
Id Name Date_of_Expiry Price Qty

2 Adderall 2025-01-12 21 50

37
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : Enter the Medicine ID : 40

Deleting medicine.

Medicine Deleted

38
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 6

Enter Bill No.: 1

Enter Customer's Name: jomy

Enter Bill Date (yyyy-mm-dd): 2024-12-06

39
Enter Medicine ID: 1

Price of Medicine is: 25

Enter the Quantity to be Purchased: 12

Amount for Medicine: 300

Are There More Medicines to be Purchased (yes/no): yes

Enter Medicine ID: 2

Price of Medicine is: 21

Enter the Quantity to be Purchased: 3

Amount for Medicine: 363

Are There More Medicines to be Purchased (yes/no): no

Calculating Your Bill

Total Bill Amount is: 363

generating bill....

Bill Generated

40
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

41
Enter Your Choice : 7

BillNo Name Medicine Amount DateofBill

1 jomy Acetaminophen Adderall 363 2024-12-06

42
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 8

Enter the Bill no : 1

Bill Found..... !!

***************

43
Bill No Name medicine Amount

1 jomy Acetaminophen Adderall 363

44
The Medical Store

Press 1 - Add New Medicine

Press 2 - Restock a Medicine

Press 3 - Show All Medicines

Press 4 - Search a Medicine

Press 5 - Delete a Medicine

Press 6 - Billing

Press 7 - Display Previous Bills

press 8 - to see your bill

press 9 - to Exit

Enter Your Choice : 9

THANKS FOR VISITING..!!

Have a Medicine-Free Life Ahead

45
**********************************************************
*************************************

46
Conclusion

In short, the Python-MySQL connect program for medicine


management manages to fuse the advantages of using Python with the
efficiency of MySQL databases really well to ease the process of
tracking and managing medication inventories in a pharmacy/hospital
setting . What this program does is allow for real-time updates, , and
the tracking of stock levels, their expiration date and other key data,
among many other things by the use of Python interacting with the
MySQL database. It thereby reduces the human effort associated with
watching the medicine inventory while removing the risk of missing the
time for refilling, hence improving overall efficiency in managing
medication. The most important feature of this application is that it will
be able to customize it in the future should the organization require any
such customization. Thus scalable when it comes to handling medicines
and medication effectively.

47
Bibliography

https://www.geeksforgeeks.org/

https://www.w3schools.com/python/

https://www.javatpoint.com/

https://thonny.org/

https://www.mysql.com/

books:

sumita aurora ,computer science class 12

48

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy