0% found this document useful (0 votes)
5 views17 pages

Airline Reservation System Project

The document is a project file for a Computer Science project titled 'Data Handling Using Python' by Ashmit Bhardwaj for the academic session 2025-26. It includes a certificate of completion, acknowledgments, a detailed description of an Airline Reservation System (ARS), Python code for creating and managing a database, and a conclusion reflecting on the learning outcomes. Additionally, it lists a bibliography of resources used in the project.

Uploaded by

aaforapple939399
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)
5 views17 pages

Airline Reservation System Project

The document is a project file for a Computer Science project titled 'Data Handling Using Python' by Ashmit Bhardwaj for the academic session 2025-26. It includes a certificate of completion, acknowledgments, a detailed description of an Airline Reservation System (ARS), Python code for creating and managing a database, and a conclusion reflecting on the learning outcomes. Additionally, it lists a bibliography of resources used in the project.

Uploaded by

aaforapple939399
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

SESSION : 2025-26

CS PROJECT FILE

NAME :- Ashmit Bhardwaj

CLASS:- XII-A

SUBJECT:- Computer Science

Teacher’s Sign
CERTIFICATE
This is to certify that Ashmit Bhardwaj of Class XII, has
successfully completed the Computer Science project titled
“Data Handling Using Python” for the academic session
2025–26.

This project is the student’s original work and has been


completed under my supervision.

Teacher’s Signature

Examiner’s Signature

DATE :-
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to my Computer


Science teacher Ms. Ritu Chauhan for their guidance and
support throughout the completion of this project.

I also thank my school, my classmates, and my parents for


providing encouragement and resources that helped me finish
this project successfully.
AIRLINE RESERVATION SYSTEM

A Airline Resevation System (ARS) is a fundamental


component of a modern airliner's avionics. An ARS is a
specialized computer system that automates a wide variety of in-
flight tasks. the workload on the flight crew to the point that
modern civilian aircraft no longer carry flight ght tasks,
reducing engineers or navigators. A primary function is in-flight
management of the flight pian. Using various sensors (such as
GPS and INS often backed up by radio navigation) to determine
the aircraft's position, the ARS can guide the aircraft along the
flight plan. From the cockpit, the ARS is normally controlled
through a Control Display Unit (CDU) which incorporates a
small screen and keyboard or touchscreen. The ARS sends the
flight plan for display to the Electronic Flight Instrument
System (EFIS), Navigation Display (ND), or Multifunction
Display (MFD). The ARS can be summarised as being a dual
system consisting of the Flight Management Computer (FMC),
CDU and a cross talk bus

The modem ARS was introduced on the Boeing 767, though


earlier navigation computers did exist. Now, systems similar to
ARS exist on aircraft as small as the Cessna 182. In its evolution
an ARS has had many different sizes, capabilities and controls.
However certain characteristics are common to all ARSs.
NEED OF ARS
1. Minimum documentation and no dulpication of records.

2. Reduced Paper work.

3. Better Administraton Control.

4. Faster Information Flow between various departments.

5. Smart Revenue Management.

6. Effective billing of various services.

7. Exact Stock Information.


# CODE(Python)

import [Link]

# ------------------------------------------
# CONNECT TO MYSQL (CREATE DATABASE)
# ------------------------------------------
try:
root = [Link](
host="localhost",
user="root",
password="12345678"
)
print("Connected to MySQL Successfully!")
except:
print("❌Connection Error! Check password or MySQL
server.")
exit()

root_cursor = [Link]()
root_cursor.execute("CREATE DATABASE IF NOT
EXISTS airline")
[Link]()

con = [Link](
host="localhost",
user="root",
password="12345678",
database="airline"
)
cursor = [Link]()

# ------------------------------------------
# CREATE TABLES
# ------------------------------------------
def create_tables():
[Link]("""
CREATE TABLE IF NOT EXISTS flights(
flight_id INT PRIMARY KEY,
airline VARCHAR(50),
source VARCHAR(50),
destination VARCHAR(50),
departure_time VARCHAR(20),
price INT
)
""")

[Link]("""
CREATE TABLE IF NOT EXISTS passengers(
passenger_id INT PRIMARY KEY,
name VARCHAR(50),
age INT,
gender VARCHAR(10)
)
""")

[Link]("""
CREATE TABLE IF NOT EXISTS tickets(
ticket_id INT PRIMARY KEY,
passenger_id INT,
flight_id INT,
seat_no VARCHAR(10),
FOREIGN KEY (passenger_id) REFERENCES
passengers(passenger_id),
FOREIGN KEY (flight_id) REFERENCES
flights(flight_id)
)
""")

[Link]()
print("✔ Tables created successfully!")

# ------------------------------------------
# INSERT MANY SAMPLE RECORDS
# ------------------------------------------
def insert_sample_data():

# Flights (10 values)


[Link]("SELECT COUNT(*) FROM flights")
if [Link]()[0] == 0:
[Link]("""
INSERT INTO flights VALUES
(%s, %s, %s, %s, %s, %s)
""", [
(101, "Air India", "Delhi", "Mumbai", "08:30 AM",
5500),
(102, "IndiGo", "Kolkata", "Delhi", "11:00 AM",
4800),
(103, "Vistara", "Bangalore", "Delhi", "02:45 PM",
7200),
(104, "SpiceJet", "Chennai", "Hyderabad", "06:15
AM", 3200),
(105, "GoAir", "Pune", "Jaipur", "09:50 AM",
4100),
(106, "Air Asia", "Delhi", "Goa", "01:30 PM", 6500),
(107, "Vistara", "Hyderabad", "Mumbai", "07:00
AM", 5400),
(108, "IndiGo", "Lucknow", "Delhi", "04:20 PM",
3600),
(109, "SpiceJet", "Ahmedabad", "Pune", "05:45
PM", 3900),
(110, "Air India", "Mumbai", "Kolkata", "10:25
AM", 7800)
])
print("✔ 10 Flight records inserted!")
# Passengers (10 values)
[Link]("SELECT COUNT(*) FROM passengers")
if [Link]()[0] == 0:
[Link]("""
INSERT INTO passengers VALUES
(%s, %s, %s, %s)
""", [
(1, "Aarav Mehta", 28, "Male"),
(2, "Riya Sharma", 22, "Female"),
(3, "Kabir Singh", 35, "Male"),
(4, "Neha Verma", 30, "Female"),
(5, "Arjun Patel", 26, "Male"),
(6, "Simran Kaur", 24, "Female"),
(7, "Rohan Das", 33, "Male"),
(8, "Isha Malhotra", 21, "Female"),
(9, "Daksh Gupta", 27, "Male"),
(10, "Tanya Kapoor", 29, "Female")
])
print("✔ 10 Passenger records inserted!")

# Tickets (10 values)


[Link]("SELECT COUNT(*) FROM tickets")
if [Link]()[0] == 0:
[Link]("""
INSERT INTO tickets VALUES (%s, %s, %s, %s)
""", [
(5001, 1, 101, "12A"),
(5002, 2, 103, "7C"),
(5003, 3, 104, "3B"),
(5004, 4, 105, "14D"),
(5005, 5, 106, "11A"),
(5006, 6, 107, "9E"),
(5007, 7, 108, "5F"),
(5008, 8, 102, "2B"),
(5009, 9, 109, "10C"),
(5010, 10, 110, "1A")
])
print("✔ 10 Ticket records inserted!")

[Link]()

# ------------------------------------------
# DISPLAY TABLE
# ------------------------------------------
def show_table(table):
try:
[Link](f"SELECT * FROM {table}")
rows = [Link]()

print(f"\n------ {[Link]()} TABLE ------")


for row in rows:
print(row)
print("----------------------------------\n")
except:
print("❌Table does not exist!")

# ------------------------------------------
# CUSTOM SQL INPUT
# ------------------------------------------
def custom_query():
print("\nType your SQL Query (SELECT / INSERT /
UPDATE / DELETE):")
query = input("SQL> ")

try:
[Link](query)
if [Link]().startswith("select"):
for row in [Link]():
print(row)
else:
[Link]()
print("✔ Query executed successfully!")
except Exception as e:
print("❌Error:", e)

# ------------------------------------------
# MAIN PROGRAM
# ------------------------------------------
create_tables()
insert_sample_data()

while True:
print("\n===== AIRLINE MANAGEMENT SYSTEM
=====")
print("1. Show Flights")
print("2. Show Passengers")
print("3. Show Tickets")
print("4. Run Custom SQL Query")
print("5. Exit")

try:
choice = int(input("Enter choice: "))
except:
print("❌Invalid input!")
continue

if choice == 1:
show_table("flights")
elif choice == 2:
show_table("passengers")
elif choice == 3:
show_table("tickets")
elif choice == 4:
custom_query()
elif choice == 5:
print("✔ Exiting...")
break
else:
print("❌Invalid choice!"
# MySQL
 Tables in Database airlines :

 Description and Data in table ‘flights’ :


 Description and Data in table ‘passengers’:

 Description and Data in Table ‘tickets’ :


CONCLUSION
This project helped me understand how Python can be used for data storage,
retrieval, and analysis

I gained practical experience in:

 File Handling

 Data Processing

 Menu-Driven Programming

 Statistical Calculations
BIBLIOGRAPHY
 NCERT Computer ScienceTextbook , Class XII

 Python Official Documentation

 Classroom Notes

You might also like