Untitled Document
Untitled Document
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
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)
);
Queries:
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.
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