0% found this document useful (0 votes)
15 views5 pages

Untitled Document

The document outlines a project for an Airline Management System created by Vedant Gajjar, Dev Dhruve, and Bhabhor Om as part of their diploma engineering at GPG Gandhinagar. It details the database structure, including tables for flights, passengers, bookings, employees, and payments, along with SQL commands for data insertion and queries. The system aims to efficiently manage airline operations, ensuring data accuracy and supporting essential functions like booking and payment processing.

Uploaded by

vedantgajjar70
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)
15 views5 pages

Untitled Document

The document outlines a project for an Airline Management System created by Vedant Gajjar, Dev Dhruve, and Bhabhor Om as part of their diploma engineering at GPG Gandhinagar. It details the database structure, including tables for flights, passengers, bookings, employees, and payments, along with SQL commands for data insertion and queries. The system aims to efficiently manage airline operations, ensuring data accuracy and supporting essential functions like booking and payment processing.

Uploaded by

vedantgajjar70
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/ 5

DATABASE MANAGEMENT SYSTEM

PROJECT

Created by
Vedant Gajjar(042)
Dev Dhruve (037)
Bhabhor Om(013)

CERTIFICATE

This project is created by Vedant gajjar (042),dev dhruve (037) and bhabhor Om (013) in diploma engineering at
gpg gandhinagar sector 26.

Created by,
Vedant gajjar
Dev Dhruve
Om Bhabhor

Project name :
Airlines management system

Introduction: Airline Management System


The Airline Management System is a database designed to manage airline operations, such as flight scheduling,
passenger bookings, employee details, and payments. Using SQL, the system efficiently handles tasks like
booking flights, tracking passengers, and managing payments. It ensures data accuracy and supports key
operations like adding, updating, and retrieving records for smooth airline management.

Code:

– Flight Table
CREATE TABLE Flights (
flight_id INT PRIMARY KEY,
flight_number VARCHAR(10) NOT NULL,
source VARCHAR(50) NOT NULL,
destination VARCHAR(50) NOT NULL,
departure_time TIME NOT NULL,
arrival_time TIME NOT NULL,
date_of_flight DATE NOT NULL
);

-- Passenger Table
CREATE TABLE Passengers (
passenger_id INT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
phone VARCHAR(15),
passport_number VARCHAR(20)
);

-- Booking Table
CREATE TABLE Bookings (
booking_id INT PRIMARY KEY,
flight_id INT,
passenger_id INT,
booking_date DATE NOT NULL,
seat_number VARCHAR(5),
status VARCHAR(20) NOT NULL CHECK (status IN ('Booked', 'Cancelled')),
FOREIGN KEY (flight_id) REFERENCES Flights(flight_id),
FOREIGN KEY (passenger_id) REFERENCES Passengers(passenger_id)
);

-- Employee Table
CREATE TABLE Employees (
employee_id INT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
role VARCHAR(50),
hire_date DATE,
salary DECIMAL(10, 2)
);

-- Payments Table
CREATE TABLE Payments (
payment_id INT PRIMARY KEY,
booking_id INT,
payment_date DATE NOT NULL,
amount DECIMAL(10, 2) NOT NULL,
payment_method VARCHAR(20),
FOREIGN KEY (booking_id) REFERENCES Bookings(booking_id)
);

Insertion of Data in Table:

–Insert data into Flights


INSERT INTO Flights (flight_id, flight_number, source, destination, departure_time, arrival_time, date_of_flight)
VALUES
(1, 'AI101', 'New York', 'London', '08:00:00', '16:00:00', '2024-10-25'),
(2, 'AI102', 'London', 'Paris', '10:00:00', '12:00:00', '2024-10-26');

-- Insert data into Passengers


INSERT INTO Passengers (passenger_id, name, email, phone, passport_number)
VALUES
(1, 'John Doe', '[email protected]', '1234567890', 'P1234567'),
(2, 'Jane Smith', '[email protected]', '0987654321', 'P7654321');

-- Insert data into Bookings


INSERT INTO Bookings (booking_id, flight_id, passenger_id, booking_date, seat_number, status)
VALUES
(1, 1, 1, '2024-10-10', '12A', 'Booked'),
(2, 2, 2, '2024-10-11', '15B', 'Booked');

-- Insert data into Employees


INSERT INTO Employees (employee_id, name, role, hire_date, salary)
VALUES
(1, 'Alice Johnson', 'Pilot', '2015-01-10', 80000),
(2, 'Bob Lee', 'Flight Attendant', '2018-06-15', 35000);

-- Insert data into Payments


INSERT INTO Payments (payment_id, booking_id, payment_date, amount, payment_method)
VALUES
(1, 1, '2024-10-10', 500.00, 'Credit Card'),
(2, 2, '2024-10-11', 300.00, 'Debit Card');

Queries:

1)get all flights between two locations


SELECT * FROM Flights
WHERE source = 'New York' AND destination = 'London';

2) get passenger’s booking details


SELECT p.name, b.booking_id, f.flight_number, f.source, f.destination, b.seat_number
FROM Passengers p
JOIN Bookings b ON p.passenger_id = b.passenger_id
JOIN Flights f ON b.flight_id = f.flight_id
WHERE p.passenger_id = 1;

3) find all employees and their roles


SELECT name, role FROM Employees;

4) list all payments for a specific booking


SELECT payment_id, amount, payment_method, payment_date
FROM Payments
WHERE booking_id = 1;

5) find flights on specific date


SELECT * FROM Flights
WHERE date_of_flight = '2024-10-25';

6) update flight time


UPDATE Flights
SET departure_time = '09:00:00'
WHERE flight_id = 1;

7) delete booking
DELETE FROM Bookings
WHERE booking_id = 2;

Output:
1)
flight_id | flight_number | source | destination | departure_time | arrival_time | date_of_flight
---------------------------------------------------------------------------------------------
1 | AI101 | New York | London | 08:00:00 | 16:00:00 | 2024-10-25

2)
name | booking_id | flight_number | source | destination | seat_number
---------------------------------------------------------------------------
John Doe | 1 | AI101 | New York | London | 12A

3)
name | role
--------------------------
Alice Johnson | Pilot
Bob Lee | Flight Attendant

4)
payment_id | amount | payment_method | payment_date
----------------------------------------------------
1 | 500.00 | Credit Card | 2024-10-10

5)
Flight updated successfully.

Conclusion: Airline Management System

The Airline Management System provides an efficient way to manage airline operations, including flight
scheduling, passenger bookings, employee details, and payment processing. By leveraging SQL, the system
ensures data integrity, supports easy retrieval of information, and simplifies complex operations such as booking
management and flight tracking. This project demonstrates the practical use of a relational database for a
real-world application, ensuring scalability and ease of use in managing airline data.
Thank you

You might also like