0% found this document useful (0 votes)
7 views

ATMS

Uploaded by

Įt'š Ťąłhá
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

ATMS

Uploaded by

Įt'š Ťąłhá
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1

Airline Ticket Management System (ATMS)


_______________________________

Submitted by

M Talha Manzoor (Fall 2022-BSIT-032)


Sameer Akram (Fall 2022-BSIT-044)

Session 2022-2026

Supervised by

Ms. Sidra Aslam

Department of Information Technology


Lahore Garrison University
Lahore
2

Airline Booking System


The Airline Booking System is a comprehensive platform designed to
streamline the process of booking, managing, and tracking airline reservations.
This project aims to simplify travel planning by providing users with an intuitive
interface to search for flights, view schedules, select seats, and complete
payments. It caters to both customers and administrators, offering
functionalities such as flight management, real-time availability updates, and
ticket issuance. The system is designed to enhance user convenience and
operational efficiency for airlines, ensuring a seamless experience for all
stakeholders.
3

ERD Diagram
4
5

SQL QUERIES
Passenger (Customer) Table
Entity: Passenger
Attributes:
• CustomerID (Primary Key)
• Name
• Email
• PhoneNumber

Flight Table
Entity: Flight
Attributes:
• FlightID (Primary Key)
• Destination
• DepartureTime
• Price

Booking Table
Entity: Booking
Attributes:
• BookingID (Primary Key)
• CustomerID (Foreign Key referencing Passenger)
• FlightID (Foreign Key referencing Flight)
• BookingDate
6

Payment Table
Entity: Payment
Attributes:
• PaymentID (Primary Key)
• BookingID (Foreign Key referencing Booking)
• PaymentAmount
• PaymentDate

Queries
1. Create Tables:

CREATE TABLE User (


user_id INT PRIMARY KEY,
username VARCHAR(50),
email VARCHAR(100),
password VARCHAR(100),
contact_number VARCHAR(15)
);

CREATE TABLE Flight (


flight_id INT PRIMARY KEY,
flight_number VARCHAR(10),
origin VARCHAR(50),
destination VARCHAR(50),
departure_date DATE,
departure_time TIME,
arrival_date DATE,
arrival_time TIME,
available_seats INT,
price DECIMAL(10, 2)
);
7

CREATE TABLE Booking (


booking_id INT PRIMARY KEY,
user_id INT FOREIGN KEY REFERENCES User(user_id),
flight_id INT FOREIGN KEY REFERENCES Flight(flight_id),
booking_date DATE,
seat_number VARCHAR(5),
payment_status VARCHAR(20)
);

CREATE TABLE Payment (


payment_id INT PRIMARY KEY,
booking_id INT FOREIGN KEY REFERENCES Booking(booking_id),
payment_method VARCHAR(20),
amount DECIMAL(10, 2),
payment_date DATE
);

2. Insert Sample Data

INSERT INTO User (user_id, username, email, password, contact_number) VALUES (1,
'john_doe', '[email protected]', 'securepassword', '123-456-7890'), (2, 'jane_smith',
'[email protected]', 'password123', '987-654-3210');

INSERT INTO Flight (flight_id, flight_number, origin, destination, departure_date,


departure_time, arrival_date, arrival_time, available_seats, price) VALUES (101, 'FL123',
'New York', 'Los Angeles', '2025-01-10', '09:00:00', '2025-01-10', '12:00:00', 200, 350.50),
(102, 'FL456', 'Chicago', 'Miami', '2025-02-15', '14:30:00', '2025-02-15', '18:00:00', 150,
280.75);

INSERT INTO Booking (booking_id, user_id, flight_id, booking_date, seat_number,


payment_status) VALUES (1, 1, 101, '2025-01-01', '12A', 'Confirmed'), (2, 2, 102, '2025-02-
01', '15B', 'Pending'); INSERT INTO Payment (payment_id, booking_id, payment_method,
amount, payment_date) VALUES (1, 1, 'Credit Card', 350.50, '2025-01-02'), (2, 2, 'PayPal',
280.75, '2025-02-05');
8

3. Queries to Retrieve Data

a) Retrieve all users

SELECT * FROM User;

b) Retrieve all flights from New York to Los Angeles

SELECT * FROM Flight


WHERE origin = 'New York' AND destination = 'Los Angeles';

c) Retrieve bookings and associated user information

SELECT Booking.booking_id, User.username, Flight.flight_number,


Booking.booking_date
FROM Booking
JOIN User ON Booking.user_id = User.user_id
JOIN Flight ON Booking.flight_id = Flight.flight_id;

d) Retrieve payment details for confirmed bookings

SELECT Payment.payment_id, Booking.booking_id, Payment.payment_method,


Payment.amount
FROM Payment
JOIN Booking ON Payment.booking_id = Booking.booking_id
WHERE Booking.payment_status = 'Confirmed';

You might also like