You are on page 1of 18

[INFORMATICS PRACTICES PROJECT

REPORT]
[FOOD BILLING SYSTEM]
FOR

AISSCE 2024 EXAMINATION

As a part of the Informatics Practices Course (065)

SUBMITTED BY: [NALIN BANGA ][Roll No…………]

Under the Guidance of: [MS ANNI KUMAR (PGT COMPUTER SCIENCE)]
FOOD BILLING SYSTEM


CERTIFICATE
This is to certify that the Project entitled, Food Billing System is a bonafide work done

by ________________ of class XII-F Session 2023-2024 in partial fulfillment of CBSE’s

AISSCE Examination 2024 and has been carried out under my direct supervision and

guidance. This report or a similar report on the topic has not been submitted for any other

examination and does not form a part of any other course undergone by the candidate.

Signature of Student Signature of Teacher

Name: _____________ Name: Ms Anni Kumar

Board Roll No.: …………… Designation: PGT Computer Science

Place: Delhi Date:……………..

1
FOOD BILLING SYSTEM


ACKNOWLEDGEMENT
In the accomplishment of this project successfully, many people have best owned upon
me their blessings and the heart pledged support, this time I am utilizing to thank all the
people who have been concerned with this project.

I would like to express my special thanks of gratitude to our principal Ms. Teena Solanki
teacher and Informatics Practices teacher Ms. Anni Kumar who gave me the golden
opportunity to do this wonderful project on the topic (Write the topic name), which also
helped me in doing a lot of Research and I came to know about so many new things I am
really thankful to them. The suggestions and instructions given by my IP teachers have
served as the major contributor towards the completion of the project.

I am over helmed in all humbleness and gratefulness to acknowledge my depth to all


those who have helped me to put these ideas, well above the level of simplicity and into
something concrete.

Any attempt at any level can 't be satisfactorily completed without the support and
guidance of my parents and friends.

I would like to thank my parents who helped me a lot in gathering different information,
collecting data and guiding me from time to time in making this project, despite of their
busy schedules, they gave me different ideas in making this project unique.

Lastly, I would like to thank my classmates who have helped me a lot.

Thanking you,

Your name

XII-

2
FOOD BILLING SYSTEM


INDEX
S.No. CONTENT PAGE NO.

1. Objective of the Project

2. Features of Python

3. Features of MySql

4. Python MySQL Database Connection

5. Coding

6. Output

7. Bibliography

3
FOOD BILLING SYSTEM


OBJECTIVE OF THE PROJECT


The Food Billing System is a project that is built using Python and MySql. PyMySql was
used to establish the connectivity between Python and MySQL.

The project consists of 5 python programs namely (main.py, addition.py,


modification.py, deletion.py and Report.py)

The main.py is the first program where 4 buttons are displayed and the user can add,
modify, delete or run the report.py programs. The Addition.py programs helps to add
record of a new bill generated. Modification.py helps to modify the bill and deletion.py
helps to delete any record according to the billno.

Report.py helps to search any bill and also display all the records of the table customer.

4
FOOD BILLING SYSTEM


FEATURES OF PYTHON
Python is a widely used general-purpose, high level programming language. It was
initially designed by Guido van Rossum in 1991 and developed by Python Software
Foundation. It was mainly developed for emphasis on code readability, and its syntax
allows programmers to express concepts in fewer lines of code.

Python is a programming language that lets you work quickly and integrate systems more
efficiently.

Reason for increasing popularity

 Emphasis on code readability, shorter codes, ease of writing


 Programmers can express logical concepts in fewer lines of code in comparison to
languages such as C++ or Java.
 Python supports multiple programming paradigms, like object-oriented, imperative
and functional programming or procedural.
 There exists inbuilt functions for almost all of the frequently used concepts.
 Philosophy is “Simplicity is the best”.
LANGUAGE FEATURES

Interpreted There are no separate compilation and execution steps like C and C+
+. Directly run the program from the source code. Internally, Python
converts the source code into an intermediate form called bytecodes
which is then translated into native language of specific computer to
run it. No need to worry about linking and loading with libraries, etc.

Platform Independent Python programs can be developed and executed on multiple


operating system platforms. Python can be used on Linux,
Windows, Macintosh, Solaris and many more. Free and
Open Source; Redistributable High-level Language. In Python,
no need to take care about low-level details such as managing
the memory used by the program.

Simple Closer to English language; Easy to Learn. More emphasis on the


solution to the problem rather than the syntax

5
FOOD BILLING SYSTEM


Embeddable Python can be used within C/C++ program to give scripting


capabilities for the program’s users.

Robust: Exceptional handling features. Memory management techniques in


built.

Rich Library Support The Python Standard Library is vary vast. Known as the
“batteries included” philosophy of Python ;It can help do
various things involving regular expressions, documentation
generation, unit testing, threading, databases, web browsers,
CGI, email, XML, HTML, WAV files, cryptography, GUI and
many more. Besides the standard library, there are various other
high-quality libraries such as the Python Imaging Library which
is an amazingly simple image manipulation library.

FEATURES OF MYSQL

6
FOOD BILLING SYSTEM


A Swedish company called MySQL AB originally developed MySQL in 1994. The US


tech company Sun Microsystems then took full ownership when they bought MySQL AB
in 2008. US tech giant Oracle in 2010 acquired Sun Microsystems itself, and MySQL has
been practically owned by Oracle since.

In regard to the general definition, MySQL is an open source relational database


management system (RDBMS) with a client-server model. RDBMS is a software or
service used to create and manage databases based on a relational model. Now, let’s take
a closer look at each term:

Database

A database is simply a collection of structured data. Think of taking a selfie: you push a
button and capture an image of yourself. Your photo is data, and your phone’s gallery is
the database. A database is a place in which data is stored and organized. The word
“relational” means that the data stored in the dataset is organized as tables. Every table
relates in some ways. If the software doesn’t support the relational data model, just call it
DBMS.

Open source

Open source means that you’re free to use and modify it. Anybody can install the
software. You can also learn and customize the source code to better accommodate your
needs. However, The GPL (GNU Public License) determines what you can do depending
on conditions. The commercially licensed version is available if you need more flexible
ownership and advanced support.

Client-server model

Computers that install and run RDBMS software are called clients. Whenever they need
to access data, they connect to the RDBMS server. That’s the “client-server” part.

MySQL is one of many RDBMS software options. RDBMS and MySQL are often
thought to be the same because of MySQL’s popularity. To name a few big web
applications like Facebook, Twitter, YouTube, Google, and Yahoo! all use MySQL for
data storage purposes. Even though it was initially created for limited usage, now it’s

7
FOOD BILLING SYSTEM


compatible with many important computing platforms like Linux, macOS, Microsoft
Windows, and Ubuntu.

SQL

MySQL and SQL are not the same. Be aware that MySQL is one of the most popular
RDBMS software’s brand name, which implements a client-server model. So, how do the
client and server communicate in an RDBMS environment? They use a domain specific
language – Structured Query Language (SQL). If you ever encounter other names that
have SQL in them, like PostgreSQL and Microsoft SQL server, they are most likely
brands which also use SQL syntax. RDBMS software is often written in other
programming languages, but always use SQL as their primary language to interact with
the database. MySQL itself is written in C and C++.

Computer scientist Ted Codd developed SQL in the early 1970s with an IBM based
relational model. It became more widely used in 1974 and quickly replaced similar, then-
outdated languages, ISAM and VISAM. History aside, SQL tells the server what to do
with the data. It is similar to your WordPress password or code. You input it into the
system to gain access to the dashboard area. In this case, SQL statements can instruct the
server to perform certain operations:

Data query: requesting specific information from the existing database.

Data manipulation: adding, deleting, changing, sorting, and other operations to modify
the data, the values or the visuals.

Data identity: defining data types, e.g. changing numerical data to integers. This also
includes defining a schema or the relationship of each table in the database

Data access control: providing security techniques to protect data, this includes deciding
who can view or use any information stored in the database.

How MySQL Works?

8
FOOD BILLING SYSTEM


The image explains the basic structure of the client-server structure. One or more devices
(clients) connect to a server through a specific network. Every client can make a request
from the graphical user interface (GUI) on their screens, and the server will produce the
desired output, as long as both ends understand the instruction. Without getting too
technical, the main processes taking place in a MySQL environment are the same, which
are:

 MySQL creates a database for storing and manipulating data, defining the
relationship of each table.
 Clients can make requests by typing specific SQL statements on the MySQL.
 The server application will respond with the requested information and it will
appear on the clients’ side.
Why is MySQL so Popular?

MySQL is indeed not the only (R)DBMS on the market, but it is one of the most popular
ones and only second to Oracle Database when scored using critical parameters like the
number of mentions in search results, professional profiles on LinkedIn, and frequency of
technical discussions on internet forums. The fact that many major tech giants rely on it
further solidifies the well-deserved position. Why so? Here are the reasons:

Flexible and easy to use

You can modify the source code to meet your own expectations, and don’t need to pay
anything for this level of freedom, including the options for upgrading to the advanced
commercial version. The installation process is relatively simple, and shouldn’t take
longer than 30 minutes.

9
FOOD BILLING SYSTEM


High performance

A wide array of cluster servers backs MySQL. Whether you are storing massive amounts
of big e-Commerce data or doing heavy business intelligence activities, MySQL can
assist you smoothly with optimum speed.

An industry standard

Industries have been using MySQL for years, which means that there are abundant
resources for skilled developers. MySQL users can expect rapid development of the
software and freelance experts willing to work for a smaller wage if they ever need them.

Secure

Your data should be your primary concern when choosing the right RDBMS software.
With its Access Privilege System and User Account Management, MySQL sets the
security bar high. Host-based verification and password encryption are both available.

10
FOOD BILLING SYSTEM


Python MySQL DATABASE CONNECTION


Python is a dynamic language, and it has all the support to build large and complex
enterprise database-centric applications using MySQL.

Total 5 modules available in python to communicate with a MySQL and provides


MySQL database support to our applications.

 MySQL Connector Python


 PyMySQL
 MySQLDB
 mysqlclient
 OurSQL
PyMySQL implements the Python Database API 2.0. we will use it to connect to a
MySQL database server from Python. We have the following requirements to install
PyMySQL-

a. Python (any version)

b. MySQL

MySQL>=4.1

To install it, run the following command in the command prompt-


pip install PyMySQL

To connect mysql database in python program

import pymysql

#database connection

connection =
pymysql.connect(host="localhost",user="root",passwd="",database="databaseName" )

cursor = connection.cursor()

# some other statements with the help of cursor

connection.close()

11
FOOD BILLING SYSTEM


Python MySQL Example – creating table

Let’s now create a table named Artist having columns – name, id and track.

import pymysql

#database connection

connection = pymysql.connect(host="localhost", user="root", passwd="",


database="databaseName")

cursor = connection.cursor()

# Query for creating table

ArtistTableSql = """CREATE TABLE Artists(

ID INT(20) PRIMARY KEY AUTO_INCREMENT,

NAME CHAR(20) NOT NULL,

TRACK CHAR(10))"""

cursor.execute(ArtistTableSql)

connection.close()

Python MySQL insert

To insert some row entities in the table. First we have to write the queries to insert
different data, then execute it with the help of cursor.

import pymysql

#database connection

connection = pymysql.connect(host="localhost", user="root", passwd="",


database="databaseName")

cursor = connection.cursor()

# queries for inserting values

insert1 = "INSERT INTO Artists(NAME, TRACK) VALUES('Towang', 'Jazz' );"

12
FOOD BILLING SYSTEM


insert2 = "INSERT INTO Artists(NAME, TRACK) VALUES('Sadduz', 'Rock' );"

#executing the quires

cursor.execute(insert1)

cursor.execute(insert2)

#commiting the connection then closing it.

connection.commit()

connection.close()

Python MySQL select

We have inserted two rows in the above code. Now we to retrieve those. To do this have
a look at the following example:

import pymysql

#database connection

connection = pymysql.connect(host="localhost", user="root", passwd="",


database="databaseName")

cursor = connection.cursor()

# queries for retrievint all rows

retrive = "Select * from Artists;"

#executing the quires

cursor.execute(retrive)

rows = cursor.fetchall()

for row in rows:

print(row)

13
FOOD BILLING SYSTEM


#commiting the connection then closing it.

connection.commit()

connection.close()

Python MySQL update

To rename the name of the first artist from Towang to Tauwang. To update any attribute
of any entity do the following:

updateSql = "UPDATE Artists SET NAME= 'Tauwang' WHERE ID = '1' ;"

cursor.execute(updateSql )

Python MySQL delete

To delete an entity you have to execute the as followings:

deleteSql = "DELETE FROM Artists WHERE ID = '1'; "

cursor.execute(deleteSql )

Python MySQL Example – Drop Table

Sometimes we may need to drop any table before creating any new table so that name
collision does not take place. To drop the Artists table, we can do this as following:

dropSql = "DROP TABLE IF EXISTS Artists;"

cursor.execute(dropSql)

14
FOOD BILLING SYSTEM


CODING

15
FOOD BILLING SYSTEM


OUTPUTS

16
FOOD BILLING SYSTEM


BIBLIOGRAPHY
https://www.journaldev.com/15539/python-mysql-
example-tutorial
https://www.tutorialspoint.com/
http://zetcode.com/python/pymysql/
https://pymysql.readthedocs.io/en/latest/user/
examples.html
https://www.w3schools.com/
https://pynative.com/

17

You might also like