Flight Booking System4
Flight Booking System4
Page | 1
CERTIFICATE
This is to certify that Uday Kumar, Ankita Kumari, Prem Thakur, and Krish
Tiwari of Class XII A SCIENCE has successfully complete the research on the
below mentioned project under the guidance of Mr. Shubham Verma sir (subject
teacher) during the year 2023-24 in partial fulfillment of Computer Science
practical examination conducted by CBSE, New Delhi
Page | 2
ACKNOWLEDGMENT
I would like to express a deep sense of thanks & gratitude to my project guide Mr.
Shubham Verma sir for guiding me immensely through the course of the project.
He always evinced keen interest in my work. His constructive advice & constant
motivation have been responsible for the successful completion of this project.
My sincere thanks goes to Mr. Roop Narain Chauhan, Our principal sir, for his
co-ordination in extending every possible support for the completion of this
project.
I also thanks to my parents for their motivation & support. I must thanks to my
classmates for their timely help & support for compilation of this project.
Last but not the least, I would like to thank all those who had helped directly or
indirectly towards the completion of this project
Page | 3
CONTENT
Page | 4
FLIGHT BOOKING SYSTEM
INTRODUCTION
The main objective of the python project with SQL on Airline Reservation System
is to manage the details of passenger, class(seat), food menu, luggage etc.
The purpose of the project is to build an application program to reduce the manual
work for managing the booking, food, seats, and luggage.
It tracks all the details about seats, flight, food and luggage; it also prints various
reports as per input given by the user.
1. All the fields such as flight, seats, food and luggage are validated and does not
take invalid values.
2. Each forms of passenger detail, food orders and luggage cannot accept the blank
values.
Page | 5
SOFTWARE USED IN PROJECT
Frontend
Backend
FrontEnd:- For data entry we are using Python 3.10.9 with Pandas & MySQL
Connector module. It is used for create passenger details, for changing class price
or add new class, also for adding new food item or increase therate of food item,
also for specify luggage rate or rate per weights. It is also useful for ticket
reservation etc.
Backend:- Data file handling:- has been effectively used in the program. The
database is a collection of interrelated data to serve multiple applications. That is
database programs create files of information. Sowe see that files are worked with
most, inside the program.
MySQL:- is used for create and manage databases. Where we can store our data
that are fill through Python
Page | 6
NEED OF COMPUTERISATION
Over the decades computers and air ticket bookings have developed gradually,
changed with time. But nobody knew that a time will come when both these fields
will complement each other so well.
Today air ticket booking has reached new heights by computer aided methods of
design. As a result of which, computer industry has got its new customer.
Computer technology is making waves in the flight booking zone. Computers are a
vital component of the ticket booking counters. Computer aided design (CAD)
programs reduce the demand for manual sketches. New software programs
continue to replace old manual skills
Those who lag in math can now breathe a little easier. Manually figuring of tickets
insists that knowledge. Software programs constantly evolve. A program used
today may be obsolete within several years. Being trained on today's software does
not guarantee it will be used when you are ready to go out into the field.
Understanding calculations is timeless, as is computer competency. Software,
however, shifts rapidly.
Page | 7
ADVANTAGES
LIMITS
1. Excel export has not been developed for bookings.
2. The transactions are executed in offline mode only.
3. Online transactions for sales, bookings, or other data modificationsare
not possible.
4. Offline reports of sales, bookings, and discounts cannot be generated
due to batch mode execution
Page | 8
SOURCE CODE
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
conn=sql.connect(host='Localhost',user='root',passwd='Uday@123',database='airline')
if conn.is_connected():
print('successfully connected')
def menu():
print()
print("*************************************************************************")
print("*"*126)
print("8. Show ALL Types of Seats and their Ticket Price ")
print("9. Show Type of Seats passenger has chosen and its Ticket Price ")
Page | 9
print("******************************************************************************
*****")
print("*"*126)
menu()
def add_passenger():
c1=conn.cursor()
L=[]
name=input("ENTER NAME:-")
L.append(name)
address=input("ENTER ADDRESS:-")
L.append(address)
mobile=input("ENTER MOBILE:-")
L.append(mobile)
L.append(journeydate)
romwhere=input("ENTER SOURCE:-")
L.append(fromwhere)
towhere=input("ENTER DESTINATION:-")
L.append(towhere)
pas=(L)
sql="insert into
passenger(name,adress,mobile,journeydate,fromwhere,towhere)values(%s,%s,%s,%s,%s,%s)"
c1.execute(sql,pas)
conn.commit()
Page | 10
def add_classtype():
c1=conn.cursor()
print(df)
L=[]
L.append(sno)
L.append(name)
L.append(rate)
ct=(L)
c1.execute(sql,ct)
conn.commit()
def add_food():
c1=conn.cursor()
print(df)
L=[]
L.append(sno)
L.append(itemname)
Page | 11
rate=input("Enter Rate Per Food:-")
L.append(rate)
f=(L)
c1.execute(sql,f)
conn.commit()
def showfoodmenu():
print(df)
def search_byfooditem():
df=pd.read_sql(qry,conn)
print(df)
def revise_foodrate():
print(df)
Page | 12
mc=conn.cursor()
conn.commit()
print(df)
def add_luggage():
c1=conn.cursor()
print(df)
L=[]
L.append(sno)
L.append(rate)
lug=(L)
c1.execute(sql,lug)
conn.commit()
def showticketprice():
print(df)
Page | 13
def ticketreservation():
if(x==1):
s=20000*n
elif(x==2):
s=15000*n
elif(x==3):
s=10000*n
elif(x==4):
s=5000*n
else:
Page | 14
def luggagebill():
if(x==1):
s=2000
elif(x==2):
s=2500
elif(x==3):
s=3000
elif(x==4):
s=3500
elif(x==5):
s=4000
else:
def foodbill():
print(df)
Page | 15
d = int(input("Enter The Quantity:"))
if (c==1):
s=20*d
elif(c==2):
s=30*d
elif(c==3):
s=60*d
elif(c==4):
s=100*d
elif(c==5):
s=150*d
else:
print("Invalid Option")
while True:
if opt==1:
add_passenger()
elif opt==2:
add_classtype()
elif opt==3:
add_food()
elif opt==4:
showfoodmenu()
elif opt==5:
search_byfooditem()
Page | 16
elif opt==6:
revise_foodrate()
elif opt==7:
add_luggage()
elif opt==8:
showticketprice()
elif opt==9:
ticketreservation()
elif opt==10:
luggagebill()
elif opt==11:
foodbill()
else:
print("Invalid Option")
Page | 17
Output
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:1
ENTER NAME:-Sumit Kumar
ENTER ADDRESS:-Goa
ENTER MOBILE:-987654321
ENTER JOURNEY DATE: 2022-12-20
ENTER SOURCE:-Goa
ENTER DESTINATION: -Mumbai
Record of Passenger inserted
Enter Your Choice:
Page | 18
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:2
sno classtype rate
0 1 First Class 20000
1 2 Business Class 25000
2 3 Premium Economy 15000
3 4 Economy 10000
4 5 King Size 30000
Enter The Serial No.: 5
Enter The Name Of Class:- King Size XL
Enter Rate Per Ticket:- 30000
Record inserted in classtype
Enter your choice:
Page | 19
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:3
sno itemname Rate
0 1 Tea 20
1 2 Coffee 60
2 3 Pizza 200
3 4 Sandwich 50
4 5 Burger 100
5 6 Cake 300
Enter The Serial No.:-7
Enter The Name of Food:-Cupcake
Enter Rate Per Food:-80
Record inserted in Food
Enter Your Choice:
Page | 20
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:4
sno itemname Rate
0 1 Tea 20
1 2 Coffee 60
2 3 Pizza 200
3 4 Sandwich 50
4 5 Burger 100
5 6 Cake 300
6 7 Cupcake 80
Enter The Choice:
Page | 21
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:5
sno itemname Rate
0 1 Tea 20
1 2 Coffee 60
2 3 Pizza 200
3 4 Sandwich 50
4 5 Burger 100
5 6 Cake 300
6 7 Cupcake 80
Search rate of food item by entering item no
Enter The Food Iten No. : 5
sno itemname rate
0 5 Burger 100
Enter Your Choice:
Page | 22
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:6
Before any changes in Food Menu
sno itemname Rate
0 1 Tea 20
1 2 Coffee 60
2 3 Pizza 200
3 4 Sandwich 50
4 5 Burger 100
5 6 Cake 300
6 7 Cupcake 80
sno itemname Rate
0 1 Tea 20
1 2 Coffee 60
2 3 Pizza 200
3 4 Sandwich 50
4 5 Burger 100
5 6 Cake 300
6 7 Cupcake 80
Page | 23
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:7
sno weight Rate
0 1 20 kg 2000
1 2 25 kg 2500
2 3 30 kg 3000
Enter The Serial No.:4
Enter The Weight of Luggage:-35kg
Enter Rate Per Luggage:-3500
Record inserted in luggage
Enter Your Choice:
Page | 24
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:8
All records of types of seats available
sno classtype Rate
0 1 First Class 20000
1 2 Business Class 25000
2 3 Premium Economy 15000
3 4 Economy 10000
4 5 King Size 30000
Enter Your Choice:
Page | 25
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:9
WE HAVE FOLLOWING SEAT TYPES FOR YOU:
1. FIRST CLASS Rs 20000 per PERSON:
2. BUSINESS CLASS Rs 15000 per PERSON:
3. PREMIUM ECONOMY CLASS RS. 10000 per PERSON:
4. ECONOMY CLASS Rs. 5000 per PERSON:
5. KING ROOM Rs 3000 Per PERSON
ENTER YOUR CHOICE OF TICKET PLEASE->3
HOW MANY TICKETS YOU NEED: 3
You Have Chosen Premium Economy Class:
Your Total Ticket Price is = 30000
Enter Your Choice:
Page | 26
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:10
ENMTER THE SERIAL NO OF WEIGHT OF EXTRA LUGGAGE-> 3
You Have 30 Kg Extra
Your Cost Of Extra Luggage is 3000
Enter Your Choice:
Page | 27
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
******************************************************************************
FLIGHT MANAGEMENT SYSTEM Project
*************************************************************************************
**********************************************************
1. Add new Passenger Detail
2. Add new class Type Detail
3. Add Food Item Detail
4. Show Food Menu
5. Search by Food Item Name
6. Revise Rates of Food Items
7. Add new Charges for more weights
8. Show ALL Types of Seats and their Ticket Price
9. Show Type of Seats passenger has chosen and its Ticket Price
10. If Extra Luggage then its Bill
11. If Food Item ordered then its Bill
*************************************************************************************
***
*************************************************************************************
**********************************************************
Enter Your Choice:11
All Food Items Available
sno itemname Rate
0 1 Tea 20
1 2 Coffee 60
2 3 Pizza 200
3 4 Sandwich 50
4 5 Burger 100
5 6 Cake 300
6 7 Cupcake 80
Order Your Item No.: 3
Enter The Quantity: 4
Total food bill= Rs 800
Page | 28