0% found this document useful (0 votes)
64 views28 pages

Grade 12 CS Project

The document describes a Python program that manages a medical sector database for Nicholas Industries. It includes functions for medicine management, customer billing, and database operations using MySQL. The program has separate interfaces for the industry owner and customers, allowing the owner to manage medicines and the database, while customers can generate and view bills. Key features include secure login, real-time updates, efficient database integration, and optimization tools to track expiry dates and stock levels. The program utilizes various SQL queries and creates tables if they do not exist to interface with the MySQL database.

Uploaded by

jacksonniki2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views28 pages

Grade 12 CS Project

The document describes a Python program that manages a medical sector database for Nicholas Industries. It includes functions for medicine management, customer billing, and database operations using MySQL. The program has separate interfaces for the industry owner and customers, allowing the owner to manage medicines and the database, while customers can generate and view bills. Key features include secure login, real-time updates, efficient database integration, and optimization tools to track expiry dates and stock levels. The program utilizes various SQL queries and creates tables if they do not exist to interface with the MySQL database.

Uploaded by

jacksonniki2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

OLIVE PUBLIC SCHOOL

Affiliated to CBSE,New Delhi


Affiliation No.1931179
Chitlapakkam

CENTRAL BOARD OF SECONDARY EDUCATION

Olive Public School


II main road,Sarvamangala nagar,
Chitlapakkam,Chennai-600 064

PROJECT REPORT FILE IS SUBMITTED TO DEPARTMENT OF


COMPUTER SCIENCE FOR THE
PARTIAL FULFILLMENT OF
AISSE EXAMINATION SESSION – 2023-2024

SUBMITTED BY :
CLASS :
ROLL NO :
OLIVE PUBLIC SCHOOL
Affiliated to CBSE,New Delhi
Affiliation No.1931179
Chitlapakkam

DEPARTMENT OF COMPUTER SCIENCE


CERTIFICATE
This is to certify that the project report entitled
_____________________________________________ submitted
by ____________________________ of grade XII with Roll
No.___________________ for the AISSCE – 2023-2024 at Olive
Public School, Chitlapakkam has been examined. This report is
checked by the Practical External/Internal Examiner on
_______________

Signature of Internal Examiner Signature of External Examiner

Signature of Principal
ACKNOWLEDGEMENT

We would like to express our deep sense of


honour and gratitude to our project guide
Ms.Amudhavalli.K M.Tech.,MBA.,B.Ed, for guiding and
mentoring us through the course of the project. Her
constructive advice and constant motivation have been
responsible for the successful of this project.

Our sincere regards go to our respected Principal,


Mrs.Priya Ajith M.Sc.,M.Phil.,B.Ed for extending every
possible support and school authorities for providing us
with the facilities for making this project file.

We also extend our obligation to our Parents for their


motivation and support. We thank our classmates and
friends for their timely help and support to complete this
project file successfully.
S. Jackson Nicholas

s.no TOPIC PAGE


NO
1 BONAFIDE CERTIFICATE I

2 ACKNOWLEDGEMENT II

3 INTRODUCTION 1

4 OBJECTIVE OF THE PROJECT 2

5 PROPOSED APPLICATION 3

6 APPLICATION ALGORITHM 4

7 FLOW CHART 9

8 DATABASE: TABLE STRUCTURE AND 8


DATA
9 APPLICATION CODE 10

10 OUTPUT 14

11 SYSTEM REQUIREMENTS 18

12 BIBLIOGRAPHY 18

CONTENTS
Medical Sector Database

1. INTRODUCTION
The code provided is a Python script that manages a database
system for a medical sector under "Nicholas Industries." It
incorporates functionalities for managing medicines, billing
customers, and performing various database operations. The
system utilizes MySQL Connector for interaction with the
database. The script includes functions for creating tables,
adding, displaying, searching, and deleting medicines. It also
manages customer billing, including functionalities for editing,
deleting, and searching bills. The system is divided into sections
for the industry owner (president) and customers (billing), each
offering distinct functionalities and access levels. The
president's section enables management and administration of
the medicines and database, while the customer section is
focused on billing operations. The script utilizes a command-
line interface for user interaction and provides a menu-driven
system for navigating through different functionalities.
2. OBJECTIVE OF THE PROJECT
The objective of the "Medical Sector Database" project is to
create a robust and efficient system that effectively manages
various aspects of a medical sector. The primary objectives
include:

Medicine Management: Enable the industry owner to add,


display, search, and delete medicines within the inventory. This
functionality ensures proper management of medicine details
such as product code, name, expiry date, quantity, and rates.

Customer Billing: Facilitate the billing process for customers


by allowing them to create bills, view existing bills, search for
specific bills, edit bill quantities, and delete bills if necessary.

Database Operations: Implement necessary database


operations using MySQL Connector, such as creating tables,
managing data, performing queries, and ensuring data integrity.

User Access Control: Segregate functionalities and access


levels between the industry owner (president) and customers to
ensure secure and controlled usage of the system.

Efficiency and Accuracy: Create a user-friendly interface that


allows efficient interaction with the database, ensuring accurate
data entry, retrieval, and management.
Business Optimization: Provide tools for the industry owner
to track medicine expiry dates, monitor stock levels, manage
company-wise medicine displays, and optimize inventory
based on sales and demand.

3.PROPOSED APPLICATION
Nicholas Industries login portal is a user-friendly application for
Nicholas Industries' medical sector. It offers:

Admin Dashboard:
Manage medicines: Add, view, update, delete inventory.
Expiry alerts: Notify about expiring medicines.
Company-wise display: Organize medicines by company.

Customer Billing:
Generate bills, add/edit medicines, and delete bills.
Search & display detailed bills for customers.

Key Features:
Secure login for admins and customers.
Real-time updates and notifications.
Efficient MySQL database integration.
Benefits:
Streamlines inventory and billing processes.
Enhances customer experience and data-driven decisions.

4. APPLICATION ALGORITHM

Import Libraries:
Import required libraries (mysql.connector, datetime).

Database Connection:
Create global variables for database connection (mycn) and
cursor (mycur).
Establish a connection to the MySQL database using provided
credentials (localhost, root, password, database name -
NicholasMedicines).

Database Creation:
Create Database Tables:
Execute SQL commands to create two tables if they don't exist:
_medicalproject: Stores medicine details (ProductCode, name,
Packing, Expirydate, Company, Batch, Quantity, Rate).
customertable: Manages customer bills with foreign key
reference to _medicalproject table.

Functions for Database Operations:


Add Medicine Function (add_medicine()):
Accept user inputs for medicine details (ProductCode, name,
Packing, ExpiryDate, Company, Batch, Quantity, Rate).
Construct SQL command to insert the medicine record into the
_medicalproject table.
Execute the command, commit changes to the database, and
display a success message.

Display Medicine Function (display_medicine()):


Execute SQL command to retrieve all records from the
_medicalproject table.
Display the fetched records in a formatted manner.

Search Medicine Function (search_medicine()):


Prompt user for a medicine name to search.
Execute SQL command to find records containing the entered
medicine name in the _medicalproject table.
Display the fetched record(s) if found; otherwise, show a "not
found" message.

Expiry Stock Module Function (expiry_stockmodule()):


Retrieve today's date and year.
Execute SQL command to fetch records from _medicalproject
where Expirydate is before or equal to today's date.
Display the fetched records showing ProductCode, name,
Expirydate, and Batch.

Display Company-wise Function (display_companywise()):


Prompt user for a company name.
Execute SQL command to retrieve records from
_medicalproject based on the entered company name.
Display the fetched records for the specified company.

Delete Medicine Function (delete_medicine()):


Prompt user for a medicine's ProductCode to delete.
Check if the medicine has been sold (existing in customertable);
if not, delete the medicine record from _medicalproject, else set
its quantity to zero.
Add New Bill Function (add_newbill()):
Generate a new bill number by finding the maximum existing
bill number and incrementing it by 1.
Prompt user for their name, doctor's name, and proceed to add
medicines to the bill:
Check if the entered ProductCode exists in _medicalproject.
Add medicines to the customer's bill in customertable.

Display Bill Function (display_bill()):


Execute SQL command to retrieve and display detailed bills
containing customer, doctor, product, quantity, rate, and total
amount.

Search Bill Function (search_bill()):


Prompt user for a bill number to search.
Retrieve and display the detailed bill for the entered bill
number.

Delete Bill Function (delete_bill()):


Prompt user for a bill number to delete.
Delete the specified bill from the customertable.

Edit Bill Function (edit_bill()):


Prompt user for a bill number and product code to edit.
Fetch the existing quantity for the specified product in the bill
and update it with the new quantity.

Main Program Execution:


Main Menu Loop:
Display the main menu options for the industry owner
(president) and customers (billing).
Based on the user's choice, execute the corresponding
functionalities by calling respective functions.

Exit and Commit Changes:


Exit the loop when the user chooses to exit (choice = 3).
Commit changes to the database before exiting the program.

6. DATABASE: TABLE STRUCTURE AND


DATA

For this project a database named “NicholasMedicines” created


in mysql and no table was created since the program creates
table if it doesn’t exist.
"Create table if not exists _medicalproject(ProductCode integer
primary key,name char(50) not null,Packing
char(50),Expirydate date,"\"Company char(50),Batch
char(10),Quantity integer,Rate integer)"

"Create table if not exists customertable(BillNumber


integer,Customername varchar(50),Doctorname
varchar(50),Productcode integer,"\"Quantity integer,foreign
key(ProductCode) references _medicalproject(ProductCode))"

5. FLOWCHART
Start If choice 2 Customer
billing
If choice 3
d
If choice 1
Industry owner

Initialize Database
Connection

Create Database Tables Enter password


(_medicalproject,
customertable)

Loop for Billing


Options

Display Main
Menu

Accept User
Choice
If password
correct
Commit changes to
database

Check Billing
Choice

Check
users
choice

Loop for
Industry Owner
Options

END
7. APPLICATION CODE
8. OUTPUT
9. SYSTEM REQUIREMENTS

9.1 HARDWARE REQUIREMENTS


Processor – i3 or above
RAM- 4GB or more
Disk Space- 5GB or more

9.2 SOFTWARE REQUIREMENTS


Operating System – Windows 10 or 11
Python version 3.3.10 or higher
MySQL version 8.0.31 or higher

10. BIBLIOGRAPHY
Computer science textbook for class XII – by NCERT
Computer science with python for class XII by Sumitha Arora

You might also like