SwiftTrips Report..
SwiftTrips Report..
A PROJECT REPORT
Submitted by
SHAMBHAVI AKHOURI [RA2311029010014]
Dr. P. Visalakshi
1
SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY
KATTANKULATHUR–603203
BONAFIDE CERTIFICATE
2
ABSTRACT
In the era of smart technology and digital convenience, travel planning has evolved
from manual bookings to streamlined, tech-driven platforms that prioritize
personalization, integration, and efficiency. SwiftTrips is a comprehensive travel
management web application developed with a MySQL-backed architecture, aimed at
transforming the way users explore destinations, book accommodations, and manage
their travel itineraries. SwiftTrips provides an intuitive interface where users can
browse destinations, compare transport and hotel options, make secure bookings, and
leave feedback—all within a centralized system. The application ensures data reliability
and operational consistency through a well-structured Entity-Relationship (ER) model
and a fully normalized relational schema. Core features include user authentication,
destination-wise package customization, booking history, secure payment tracking, and
administrative control panels. The platform addresses key challenges in the existing
travel planning ecosystem such as fragmented service access, redundant user input, and
poor post-booking experience. SwiftTrips resolves these with a modular and relational
database-driven backend, ensuring seamless interaction across user roles and travel
entities. This report delves into the complete system architecture, database design, and
implementation strategies, showcasing how SwiftTrips redefines travel planning
through a smart, scalable, and user-centric solution.
3
Chapter Chapter Name Page No
No
1. Introduction 5
9. Chart Work - 1 36
11. Conclusion 38
4
1. INTRODUCTION
The platform features a clean and responsive User Interface where travelers can
explore various destinations, book transport and hotel accommodations, track past trips,
and leave feedback—all from a single portal. Meanwhile, the Admin Panel enables
platform managers to oversee bookings, manage listings, handle payments, and
moderate user interactions, ensuring operational control and platform reliability.
The platform ensures smooth travel planning through a modular structure that connects
users, bookings, and destinations with minimal effort and maximum control.
5
1.2 Identification of Entities and Relationships
1. Account
(account_id, username, email, password_hash)
Stores login credentials and access control details for each user.
2. Customer
(customer_id, account_id, name, contact_number)
Contains personal and contact information for customers; linked to their
account.
3. RideBooking
(ride_id, customer_id, pickup_location, drop_location, status)
Manages ride-sharing bookings such as cabs or private vehicles, including
route and booking status.
4. FlightBooking
(flight_id, customer_id, flight_number, departure_date, arrival_date, status)
Handles flight reservations for customers, tracking schedules and booking
status.
5. Payment
(payment_id, customer_id, ride_id, flight_id, amount, payment_date,
payment_mode)
Centralized payment processing entity supporting multi-mode transactions for
both rides and flights.
6. Itinerary
(itinerary_id, customer_id, trip_type, trip_id, details)
Records planned travel packages or custom trip details selected by the
customer.
7. Discount
(discount_id, code, discount_percentage, expiry_date)
Manages promotional offers applied during booking or payment processes.
8. Review
(review_id, customer_id, service_type, service_id, rating, comments,
review_date)
Captures customer feedback for different services (ride or flight), enhancing
service quality.
6
1.3 Relationships Between Entities
7
1.4 ER Model
8
The schema includes several primary entities that form the backbone of the SwiftTrips
platform. These entities are linked through their relationships, allowing seamless
interactions between different components of the system.
Table 1: Account
The Account table stores login credentials and basic access-level information for all
users. It ensures that each user has a unique identity on the platform.
Table 2: Customer
This table stores detailed user profile information and links each customer to their
corresponding account.
Foreign Key →
account_id INT
Account(account_id)
9
contact_number VARCHAR(20) Customer's contact number
Table 3: RideBooking
Foreign Key →
customer_id INT
Customer(customer_id)
Table 4: FlightBooking
Foreign Key →
customer_id INT
Customer(customer_id)
10
Table 5: Payment
Records payment information for rides and flights. A payment may be associated with
either service.
Foreign Key →
customer_id INT
Customer(customer_id)
Foreign Key →
ride_id INT (nullable)
RideBooking(ride_id)
Foreign Key →
flight_id INT (nullable)
FlightBooking(flight_id)
Table 6: Itinerary
This table stores trip details including both ride and flight types.
Foreign Key →
customer_id INT
Customer(customer_id)
11
Table 7: Discount
Table 8: Review
Foreign Key →
customer_id INT
Customer(customer_id)
12
3. COMPLEX QUERIES BASED ON THE CONCEPTS OF
CONSTRAINTS, SETS, JOINS, VIEWS, TRIGGERS AND
CURSORS
In this section, we explore advanced database operations that ensure the efficiency,
accuracy, and consistency of the SwiftTrips platform. These techniques include
constraints, set operations, joins, views, triggers, and cursors—each playing a critical
role in database management for a travel booking system.
3.1 Constraints
Constraints enforce rules at the table level and ensure data integrity throughout the
database.
sql
CopyEdit
ALTER TABLE Account
ADD CONSTRAINT pk_account_id PRIMARY KEY (account_id);
Ensures referential integrity between related tables. For example, customer_id in the
RideBooking table references the Customer table.
sql
CopyEdit
ALTER TABLE RideBooking
ADD CONSTRAINT fk_customer_id FOREIGN KEY (customer_id) REFERENCES
Customer(customer_id);
Check Constraint
Restricts values within a column. For example, limiting rating between 1 and 5 in the
Review table.
sql
CopyEdit
ALTER TABLE Review
ADD CONSTRAINT chk_rating CHECK (rating BETWEEN 1 AND 5);
13
3.2 Sets
Set operations allow the comparison and combination of data from multiple queries.
Union
sql
CopyEdit
SELECT customer_id, ride_id AS booking_id FROM RideBooking
UNION
SELECT customer_id, flight_id AS booking_id FROM FlightBooking;
Intersection
sql
CopyEdit
SELECT customer_id FROM RideBooking
INTERSECT
SELECT customer_id FROM FlightBooking;
Difference
Find users who have booked rides but never booked a flight.
sql
CopyEdit
SELECT customer_id FROM RideBooking
EXCEPT
SELECT customer_id FROM FlightBooking;
3.3 Joins
Joins combine rows from two or more tables based on a common column.
Inner Join
sql
CopyEdit
SELECT c.name, r.drop_location
FROM Customer c
14
INNER JOIN RideBooking r ON c.customer_id = r.customer_id;
Left Join
sql
CopyEdit
SELECT c.name, r.pickup_location, r.drop_location
FROM Customer c
LEFT JOIN RideBooking r ON c.customer_id = r.customer_id;
Right Join
List all rides, even if some don’t have corresponding customer details (rare but valid in
testing or legacy cases).
sql
CopyEdit
SELECT c.name, r.pickup_location
FROM Customer c
RIGHT JOIN RideBooking r ON c.customer_id = r.customer_id;
3.4 Views
Views simplify complex queries and improve security by showing only specific
columns.
Create View
sql
CopyEdit
CREATE VIEW CompletedFlightBookings AS
SELECT c.name, f.flight_number, f.departure_date
FROM Customer c
JOIN FlightBooking f ON c.customer_id = f.customer_id
WHERE f.status = 'Completed';
15
3.5 Triggers
Trigger Example
sql
CopyEdit
CREATE TRIGGER AutoInsertReview
AFTER UPDATE ON FlightBooking
FOR EACH ROW
BEGIN
IF NEW.status = 'Completed' THEN
INSERT INTO Review (customer_id, service_type, service_id, rating, comments)
VALUES (NEW.customer_id, 'Flight', NEW.flight_id, 5, 'Auto-generated review
for completed flight.');
END IF;
END;
3.6 Cursors
Cursors process each row returned by a query individually—useful for batch updates
or audits.
Cursor Example
Iterate through all in-progress ride bookings and mark them as 'Completed'.
sql
CopyEdit
DECLARE @ride_id INT;
DECLARE ride_cursor CURSOR FOR
SELECT ride_id FROM RideBooking WHERE status = 'Pending';
OPEN ride_cursor;
FETCH NEXT FROM ride_cursor INTO @ride_id;
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE RideBooking
SET status = 'Completed'
WHERE ride_id = @ride_id;
CLOSE ride_cursor;
16
DEALLOCATE ride_cursor;
{account_id}+ = {account_id,
account_id → username, email,
Account username, email,
password_hash
password_hash}
{customer_id}+ =
customer_id → account_id, name,
Customer {customer_id, account_id,
contact_number
name, contact_number}
{ride_id}+ = {ride_id,
ride_id → customer_id,
RideBooking customer_id, pickup_location,
pickup_location, drop_location, status
drop_location, status}
{flight_id}+ = {flight_id,
flight_id → customer_id,
customer_id, flight_number,
FlightBooking flight_number, departure_date,
departure_date, arrival_date,
arrival_date, status
status}
{payment_id}+ =
payment_id → customer_id, ride_id, {payment_id, customer_id,
Payment flight_id, amount, payment_date, ride_id, flight_id, amount,
payment_mode payment_date,
payment_mode}
{itinerary_id}+ = {itinerary_id,
itinerary_id → customer_id,
Itinerary customer_id, trip_type, trip_id,
trip_type, trip_id, details
details}
{discount_id}+ = {discount_id,
discount_id → code,
Discount code, discount_percentage,
discount_percentage, expiry_date
expiry_date}
{review_id}+ = {review_id,
review_id → customer_id,
customer_id, service_type,
Review service_type, service_id, rating,
service_id, rating, comments,
comments, review_date
review_date}
17
4.2 PITFALLS :
Table Pitfalls
- Repeated usernames or emails without strong
constraints can cause duplicates. - Passwords
Account must be stored using secure hashing algorithms,
not plaintext. - No role-based access system
included (e.g., Admin, User).
- Redundant data if multiple customers share
similar contact numbers. - Tightly coupled with
Customer
Account, changes to Account can cause
anomalies if not cascaded.
- No driver or vehicle table limits extensibility
for transport tracking. - ENUM values are fixed;
RideBooking
future expansion (e.g., "Ongoing") requires
schema change.
- Repeating flight numbers for different dates
might not be properly handled without
FlightBooking composite uniqueness. - Date constraints are not
enforced (arrival_date should be after
departure_date).
- Either ride_id or flight_id is NULL depending
on context, leading to sparse records. -
Redundant amount storage if recalculated from
Payment
booking tables. - ENUM values like ‘UPI’,
‘Credit Card’ should be normalized into a
separate table.
- trip_id refers to either a RideBooking or
FlightBooking — no foreign key enforcement
Itinerary possible due to polymorphic relationship. -
Details stored in TEXT format reduce querying
flexibility.
- No linkage to specific users or bookings;
Discount cannot track usage history. - Expiry check not
enforced by DB logic.
- No check to restrict one review per customer
per service. - Rating should be bounded (1 to 5),
Review but changes in customer info can affect
traceability. - Polymorphic service_id makes
strict integrity enforcement difficult.
18
4.3 Normalisation :
Rule: Atomic values, no repeating groups. All the tables you provided already satisfy
Example (Not in 1NF):
19
3NF (Third Normal Form)
Rule: A table must be in 2NF and have no transitive dependency (non-key attributes
should not depend on other non-key attributes).
Rule: A stricter version of 3NF where every determinant must be a candidate key.
20
BCNF Solution (Decomposed)
21
5NF (Fifth Normal Form)
Rule: A table must be in 4NF and all join dependencies must be implied by candidate
keys.
22
5. IMPLEMENTATION OF CONCURRENCY CONTROL AND
RECOVERY MECHANISMS
Definition:
Goal:
● Commit or Rollback:
While booking a flight, generating itinerary, and recording payment, all operations
should occur within a single transaction.
If payment fails, all previous actions (like booking) are rolled back, ensuring data
integrity.
23
5.2 Concurrency Control
Definition:
Goal:
The goal of concurrency control is to maintain data consistency and prevent race
conditions, where multiple transactions simultaneously alter the same data. It is
critical in systems where multiple users might attempt to access or modify the same
data at the same time.
Locking: Locks are applied to specific rows or tables to prevent multiple transactions
from accessing the same data simultaneously.
Use row-level locks (e.g., SELECT ... FOR UPDATE) when accessing ride or flight
availability.
24
5.3 Recovery Mechanism
Definition:
A recovery mechanism ensures that the system can return to a consistent state after a
failure (e.g., system crash, network failure, or transaction failure). Recovery typically
involves undoing incomplete transactions and redoing committed transactions,
ensuring data durability and consistency.
Goal:
The recovery mechanism's goal is to ensure that the database remains consistent even
after a failure. It helps recover from system crashes or disruptions while guaranteeing
no data is lost and the system returns to a valid state.
● Logging: A transaction log records all changes made to the database. This
log is essential to undo or redo changes after a failure.
● Checkpoints: Periodic checkpoints are created so that recovery can start from
the last successful point, minimizing recovery time.
● Rollback and Redo: Unfinished transactions are rolled back, and committed
transactions are redone from the logs.
25
How It Is Done in SwiftTrips:
26
By implementing these mechanisms, SwiftTrips ensures High data integrity during
multi-step operations, Robust Concurrency handling during high-traffic scenarios,
and Effective fault recovery to maintain service reliability even in failure conditions.
import mysql.connector
def get_connection():
return mysql.connector.connect(
host="localhost",
user="root",
password="Lovesid@005",
database="db_name"
)
Main.py
import tkinter as tk
from PIL import Image, ImageTk
import accounts_ui
import flight_bookings_ui
import ride_bookings_ui
import hotel_bookings_ui
import review_ui
import payment_ui
import discount_coupons_ui
import itinerary_ui
27
def open_dashboard():
root = tk.Tk()
root.title("Swift Trips - Dashboard")
root.geometry("1280x800")
root.resizable(False, False)
# Background Image
bg_image =
Image.open("/Users/parnikasharma/Desktop/dbm/Image.jpg")
bg_image = bg_image.resize((1280, 800))
bg_photo = ImageTk.PhotoImage(bg_image)
bg_label = tk.Label(root, image=bg_photo)
bg_label.place(x=0, y=0, relwidth=1, relheight=1)
# Dashboard Title
title = tk.Label(
root,
text="Swift Trips Dashboard",
font=("Helvetica", 50, "bold"),
fg="#FFFFFF",
padx=20,
pady=10
28
)
title.place(relx=0.5, rely=0.05, anchor="n")
# Button styling
BUTTON_BG = "#255957" # Teal
BUTTON_BORDER = "#1A3C40"
29
highlightbackground=BUTTON_BORDER,
highlightthickness=1,
state="normal", # ensures they look active
command=command if command else lambda:
print(f"{text} clicked")
)
30
btn = create_button(text, cmd)
btn.grid(row=i//4, column=i%4, padx=20, pady=15)
# Exit Button
exit_btn = tk.Button(
root,
text="Exit",
font=("Helvetica", 12, "bold"),
width=18,
height=2,
bg="#3F292B", # Dark brown
activebackground="#3F292B",
command=root.quit
)
exit_btn.place(relx=0.5, rely=0.92, anchor="center")
root.mainloop()
if _name_ == "_main_":
open_dashboard()
31
7. Results
32
\
33
8. NPTEL course registration page & ASSIGNMENT PROOF
34
35
9. CHART 1 : [ER MODEL & RELATIONAL MODEL]
36
CHART 2 : [FD & NORMALISATION]
37
CONCLUSION
The SwiftTrips – Travel Management System has been developed with the objective of
creating a comprehensive and efficient platform that caters to the growing demands of
modern travel services. With features ranging from ride and flight bookings to payment
processing, itinerary management, discount handling, and customer reviews, the system
integrates various travel functionalities into a single database-driven solution.
By applying advanced SQL techniques such as joins, set operations, triggers, views,
and cursors, we demonstrated the ability to go beyond basic CRUD operations and
implement logic that automates key processes—for example, automatically updating
booking statuses or generating virtual views for efficient data retrieval. We also
identified and analyzed common pitfalls in database design, such as update anomalies,
redundant data, and dependency conflicts, and addressed them using normalization up
to the third normal form (3NF).
The system's modular design ensures scalability and flexibility for future
enhancements, such as integrating third-party APIs, adding user authentication layers,
or including multi-modal travel packages. Moreover, the inclusion of real-time payment
tracking, itinerary summaries, and review functionalities adds value from both
customer experience and administrative perspectives.
In conclusion, SwiftTrips not only fulfills its primary function as a travel management
system but also serves as a well-structured case study in database design and
application. This project has allowed us to bridge theoretical knowledge with practical
implementation, demonstrating the importance of well-designed databases in powering
real-world software solutions.
38