Sunteți pe pagina 1din 23

www.freestudentprojects.

com
Booking System

Airline Reservation

ABSTRACT
Airline Reservation is database software, which maintains the information about
reservations in airline. This is made user friendly so that the information is retrieved and
updated easily. This software is developed to maintain all the information about certain
airports, corresponding flights, routes etc.

This software is developed in Visual Basic because of its flexible, fast and rich
facilities. This software can be used by any Domestic Airline Service. As the software is very
user friendly and self explanatory, a little experience is enough to start using the software.
The working with this software is made easy with good interface.

www.freestudentprojects.com
Booking System

Airline Reservation

CONTENTS

1. Introduction
2. Review of Literature
2.1 Present System
2.2 Proposed System
2.3 Requirements and Features
3. Design of Airline Reservation System.
3.1

Entity Relationship Diagram

3.2

Command & Tables

3.3 SQL Queries


4 Experimental Results
5 Conclusion
6 Bibliography

www.freestudentprojects.com
Booking System

Airline Reservation

1. INTRODUCTION
Database
A collection of data that is treated as a unit. Composed of logical and physical
structures, databases are designed to store and retrieve related information.
A database object is anything defined and stored in a database. The following is a list
of database objects: tables, views, indexes, synonyms, database links, roles, sequences,
snapshots, users, triggers, packages, procedures, and functions.

Databases and Information Management


A Database Server is the key to solving the problems of information management. In
general, a server must reliably manage a large amount of data in a multi-user environment so
that many users can concurrently access the same data. All this must be accomplished while
delivering high performance. A database server must also prevent unauthorized access and
provide efficient solutions for failure recovery.
The Oracle Server provides efficient and effective solutions with the following features:
client/server (distributed processing) environments To take full advantage of a given
computer system or network, Oracle allows processing to be split between the database server
and the client application programs. The computer running the database management system
handles all of the database server responsibilities while the workstations running the database
application concentrate on the interpretation and display of data.

Database Structure
An Oracle database has both a physical and a logical structure. Because the physical
and logical server structures are separate, the physical storage of data can be managed
without affecting the access to logical storage structures.

Physical Database Structure


An Oracle database's physical structure is determined by the operating system files
that constitute the database. Each Oracle database is made of three types of files: one or more
datafiles, two or more redo log files, and one or more control files. The files of an Oracle
database provide the actual physical storage for database information.

www.freestudentprojects.com
Booking System

Airline Reservation

Logical Database Structure


An Oracle database's logical structure is determined by one or more table spaces. A
schema is a collection of objects. Schema objects are the logical structures that directly refer
to the database's data. Schema objects include such structures as tables, views, sequences,
stored procedures, synonyms, indexes, clusters, and database links.
The logical storage structures, including table spaces, segments, and extents, dictate how the
physical space of a database is used. The schema objects and the relationships among them
form the relational design of a database.

Table
The basic unit of data storage in a relational database management system. Every
table has a table name and a set of columns and rows in which the data is stored. Each
column is given a column name, a data type (defining characteristics of the data to be entered
in the column), and a width (quantity of space to allocate for data to be entered into the
column).

View
Customized presentation of data from one or more tables.

Index
A database object created to increase the performance of data retrieval. It provides a
fast access path to data in a database. Indexes point directly to the location of the rows
containing specified data.

Database link
A database link is an object in the database that allows you to access objects on a
remote database.

Trigger
A stored procedure that is fired (implicitly executed) when an INSERT, UPDATE, or
DELETE statement is issued against the associated table.

www.freestudentprojects.com
Booking System

Airline Reservation

Procedure
A set of SQL and PL/SQL statements that are grouped together as a unit to solve a
specific problem or perform a set of related tasks.

Function
A set of SQL and PL/SQL statements grouped together as an executable unit to
perform a task.

SQL (Structured Query Language)


Structured Query Language (SQL), is the set of commands that all programs and users
must use to access data within the Oracle database. Application programs and Oracle tools
often allow users to access the database without directly using SQL, but these applications in
turn must use SQL when executing the user's request.

History of SQL
The paper, "A Relational Model of Data for Large Shared Data Banks," by Dr. E. F.
Codd, was published in June 1970 in the Association of Computer Machinery (ACM) journal,
Communications of the ACM. Codd's model is now accepted as the definitive model for
relational database management systems (RDBMS). The language, Structured English Query
Language (SEQUEL) was developed by IBM Corporation, Inc. to use Codd's model.
SEQUEL later became SQL. In 1979, Relational Software, Inc. (now Oracle Corporation)
introduced the first commercially available implementation of SQL. Today, SQL is accepted
as the standard RDBMS language.

How SQL Works


This section describes many of the reasons for SQL's widespread acceptance by
relational database vendors as well as end users. The strengths of SQL benefit all ranges of
users including application programmers, database administrators, management, and end
users.
Technically speaking, SQL is a data sublanguage. That is to say, the purpose of SQL is to
interface to a relational database such as Oracle, and all SQL statements are instructions to
the database. In this it differs from general purpose programming languages like C and Basic.
Among the features of SQL are the following:

www.freestudentprojects.com
Booking System

Airline Reservation

It processes sets of data as groups rather than as individual units.


It provides automatic navigation to the data.
It uses statements that are complex and powerful individually, and that therefore stand alone.
Flow-control statements were not part of SQL originally, but they are found in the recently
accepted optional part of SQL, ISO/IEC 9075-5: 1996. Flow-control statements are
commonly known as "Persistent Stored Modules" or PSM, and Oracle's PL/SQL extension to
SQL is close to PSM.
Essentially, SQL lets you work with data at the logical level, only being concerned with the
implementation details when you want to manipulate them. For example, to retrieve a set of
rows from a table, you define a condition used to filter the rows. All rows satisfying the
condition are retrieved in a single step and can be passed as a unit to the user, to another SQL
statement, or to an application. You need not deal with the rows one by one, nor do you have
to worry about how they are physically stored or retrieved. All SQL statements use the
optimizer, a part of Oracle that determines a fast means of accessing the specified data.
Oracle also provides techniques you can use to make the optimizer perform its job better.
The non-procedural nature of SQL is one of the principle characteristics of all 4GLs - Fourth
Generation Languages - and contrasts with 3GLs (eg, C, Pascal, Modula-2, COBOL, etc) in
which the user has to give particular attention to how data is to be accessed in terms of
storage method, primary/secondary indices, end-of-file conditions, error conditions (eg
,Record NOT Found), and so on.
SQL provides commands for a variety of tasks including:

querying data

inserting, updating, and deleting rows in a table

creating, replacing, altering, and dropping objects

controlling access to the database and its objects

guaranteeing database consistency and integrity

www.freestudentprojects.com
Booking System

Airline Reservation

Summary of SQL Commands


The tables in the following sections provide a functional summary of SQL commands and
are divided into these categories:
1

Data Definition Language Commands

Data Manipulation Language Commands

3 Transaction Control Commands


4

Session Control Commands

System Control Command

Data Definition Language (DDL)


DDL commands allow you to perform these tasks:
1

create, alter, and drop schema objects

grant and revoke privileges and roles

analyze information on a table, index, or cluster

establish auditing options

add comments to the data dictionary

Data Manipulation Language Commands


Data Manipulation Language (DML) commands query and manipulate data in
existing schema objects. These commands do not implicitly commit the current transaction.

Command

Purpose

DELETE
EXPLAIN PLAN
INSERT
LOCK TABLE
SELECT

To remove rows from a table.


To return the execution plan for a SQL statement.
To add new rows to a table
To lock a table or view, limiting access to it by other users.
To select data in rows and columns from one or more tables.

www.freestudentprojects.com
Booking System

Airline Reservation

Transaction Control Commands


Transaction Control commands manage changes made by Data Manipulation Language
commands.
Command

Purpose

COMMIT

To make permanent the changes made by statements issued and

ROLLBACK

the beginning of a transaction.


To undo all changes since the beginning of a transaction or since

SAVEPOINT
SET TRANSACTION

a save point.
To establish a point back to which you may roll.
To establish properties for the current transaction.

2. Review Of Literature

www.freestudentprojects.com
Booking System

Airline Reservation

2.1 Present System


Airline Reservation is database software, which maintains the information about reservations
in domestic airline. Details about airport, information about flights, details about routes, fares
and aircraft are stored in files.
Every day there are around min of 100-500 transactions. In this busy schedule, its very
difficult to track down the information of passengers, when needed.

Disadvantages:
Storing every transaction information in the form of files is an overload of work.
All the primary operations include searching the records of airport, flight and route.
This searching process is very time consuming.
Since the information is stored in files redundancy of data (storing same data multiple
times) is inevitable.
Redundancy causes inconsistent and wastage of disk space.
As the modifications are to be done, files size increases.
Maintaining files and ledgers is tedious process.
When multiple users share a database unauthorized persons can access the file which
is undesired.

2.2 Proposed System

www.freestudentprojects.com
Booking System

Airline Reservation

Data and its storage may be considered to be the heart of any information system. Data has to
be up-to-date, accurate, accessible in the required form and available to one or perhaps many
users at the same time.
In our system a RDBMS (Relational Database Management System) is used to manage the
details about all airport, aircraft, information about all flights, routes. This software is aiming
towards providing these details easily. This reduces the time consuming work involved in file
processing and provides detail within seconds.
A user friendly GUI is provided to enter the information and little training is needed to use
this software.
Advantages:
Lot of time can be saved by using a RDBMS which retrieves/stores accurate data.

Less space is required as redundancy is controlled and hence efficiency is increased.

Modification and updates becomes easy compared to file processing.


Authorized access can be granted by giving each user with a login name and
password.

Complex relationships among related data can be provided.

Backup and recovery of data is provided.

10

www.freestudentprojects.com
Booking System

Airline Reservation

2.3 Requirements and Features

Requirements:Minimum: 64MB RAM, P-III 600MHz, in9x or NT, Visual Basic 6.0, Oracle 7.3
Recommended: 128MB RAM, P-III 866MHz, MSDN collection

Features and facilities: Allow Addition/Modification/Deletion of airport, route, aircraft, tariff and fares
records.
Provides MDI user environment.
Provide list of all available flights.
Provide facilities to easily navigate and select relevant information with user friendly
interface.
Provides user to set window position dynamically.
Reservation of tickets is made easier.

Schemas and Relations

11

www.freestudentprojects.com
Booking System

Airline Reservation

Airport
AIRPORT

ANAME

RESERVATIONS

CHECKIN

Route
ROUTE NO

RDESCRIPTION

Fares
FARETYPE

FDESCRIPTION

CONDITIONS

TARIFF
ROUTENO FARETYPE

PRICE

Aircraft
AIRCRAFT TYPE

ADESCRIPTION

NO OF SEATS

Flight
FLIGHTNO FROMAP TOAP

DEPTTIME ARRTIME

SERVICE

AIRCRAFTTYPE ROUTENO

Passenger
PID

NAME

ADDRESS

TELE NO

Ticket
TICKET NO

TICKET DATE

PID

Itinerary
TICKET NO

FLIGHT NO

LEG NO

3.2 Commands and Tables

12

FLIGHT DATE

FARE TYPE

www.freestudentprojects.com
Booking System

Airline Reservation

Airport
SQL> CREATE TABLE Airport ( airport char(4) constraint pk_ap primary key,
aname varchar(50),
checkin varchar(50),
resvtns varchar(12) );
SQL> desc airport;
Name
Null?
Type
------------------------------- -------- -----------------------AIRPORT
NOT NULL
CHAR(4)
ANAME
VARCHAR2(50)
CHECKIN
VARCHAR2(50)
RESVTNS
VARCHAR2(12)

Route
SQL> CREATE TABLE Route ( routeno number(3) constraint pk_rn primary key,
rdescription varchar(40) );
SQL> desc route;
Name
Null?
Type
------------------------------- -------- ----------------------ROUTENO
NOT NULL
NUMBER(3)
RDESCRIPTION
VARCHAR2(40)

Fares
SQL> CREATE TABLE Fares ( faretype char(3) constraint pk_ft primary key,
fdescription varchar(25),
conditions varchar(40) );
SQL> desc fares;
Name
Null?
Type
------------------------------- -------- -------------------------FARETYPE
NOT NULL
CHAR(3)
FDESCRIPTION
VARCHAR2(25)
CONDITIONS
VARCHAR2(40)

Tariff
SQL> CREATE TABLE Tariff ( routeno number(2) not null constraint fk_trn references
route(routeno) on delete cascade, faretype char(3) not null ,
price number(8,2) );

SQL> desc tariff;

13

www.freestudentprojects.com
Booking System

Airline Reservation

Name
Null?
Type
------------------------------- -------- ----------------------ROUTENO
NOT NULL
NUMBER(2)
FARETYPE
NOT NULL
CHAR(3)
PRICE
NUMBER(8,2)

Aircraft
SQL> CREATE TABLE Aircraft ( aircrafttype char(3) constraint pk_at primary key,
adescription varchar(40),
noseats number(4) );
SQL> desc aircraft;
Name
Null?
Type
------------------------------- -------- -------------------------AIRCRAFTTYPE
NOT NULL
CHAR(3)
ADESCRIPTION
VARCHAR2(40)
NOSEATS
NUMBER(4)

Flight
SQL> CREATE TABLE Flight ( flightno varchar(5) constraint pk_fn primary key,
fromairport char(4),
toairport char(4),
deptime char(10),
arrtime char(10),
service varchar(20),
aircrafttype char(3) constraint fk_at references
aircraft(aircrafttype) on delete cascade,
routeno number(3) not null constraint fk_frn references,
route(routeno) on delete cascade);
SQL> desc flight;
Name
Null?
Type
------------------------------- -------- ----------------------------FLIGHTNO
NOT NULL
VARCHAR2(5)
FROMAIRPORT
CHAR(4)
TOAIRPORT
CHAR(4)
DEPTIME
CHAR(10)
ARRTIME
CHAR(10)
SERVICE
VARCHAR2(20)
AIRCRAFTTYPE
CHAR(3)
ROUTENO
NOT NULL
NUMBER(3)

Passenger

14

www.freestudentprojects.com
Booking System

Airline Reservation

SQL> CREATE TABLE Passenger ( pid number(4) constraint pk_pid primary key,
name varchar(20),
address varchar(40),
telno varchar(12) );
SQL> desc passenger;
Name
Null?
Type
------------------------------- -------- ----- ----------------------PID
NOT NULL
NUMBER(4)
NAME
VARCHAR2(20)
ADDRESS
VARCHAR2(40)
TELNO
VARCHAR2(12)

Ticket
SQL> CREATE TABLE Ticket ( ticketno number(6) constraint pk_tn primary key,
ticketdate date,
pid number(4) constraint fk_pid references passenger(pid)
on delete cascade );

SQL> desc ticket;


Name
Null?
Type
------------------------------- -------- ---------------------------TICKETNO
NOT NULL
NUMBER(6)
TICKETDATE
DATE
PID
NUMBER(4)

Itinerary
SQL> CREATE TABLE Itinerary (
ticketno number(6) constraint fk_tn not null references ticket(ticketno) on delete cascade,
flightno varchar(5) constraint fk_fn not null references flight(flightno) on delete cascade,
legno number(2) not null,
flightdate date,
faretype char(3)
constraint fk_ft referencesfares(faretype) on delete cascade) ;
SQL> desc itinerary;
Name
Null?
Type
------------------------------- -------- ------------------------------------TICKETNO
NOT NULL
NUMBER(6)
FLIGHTNO
NOT NULL
VARCHAR2(5)
LEGNO
NOT NULL
NUMBER(2)
FLIGHTDATE
DATE
FARETYPE
CHAR(3)

3.3 Normalization for Airline Reservation Database

15

www.freestudentprojects.com
Booking System

Airline Reservation

First Normal Form


The domain of an attribute must include only atomic values and that the value of any
attribute in a tuple is a single value from the domain of that attribute. Hence every relation is
in accordance with First Normal Form.
Second Normal Form
The test for Second Normal Form involves testing for functional dependencies whose
left hand side attributes are part of the primary key. If the primary key contains a single
attribute, the test need not be applied at all. Hence every relation is in accordance with
Second Normal Form except for Tariff & Itinerary which do not have a primary key and
hence cannot be converted to Second Normal Form.
Third Normal Form
A relation schema R is in Third Normal Form if it satisfies Second Normal Form and
no nonprime attribute of R is transitively dependent on the primary key. Hence every relation
schema in Airline Reservation database is in accordance with Third Normal Form.

3.3 SQL Queries

16

www.freestudentprojects.com
Booking System
SELECT

SELECT AircraftType, ADescription, NoSeats


FROM Aircraft ;

SELECTING ROWS
SELECT NoSeats
FROM Aircraft
WHERE AircaftType = 'DC9' ;

COMPARISON OPERATORS
SELECT ADescription, NoSeats
FROM Aircraft
WHERE NoSeats > 50 ;
SELECT Pid, Name, Address
FROM Passenger
WHERE Pid NOT BETWEEN 25 AND 35;
SELECT TicketNo, FlightNo
FROM Itinerary
WHERE FlightNo IN ('BD54','BD80','BD412', 'BD582', 'BD332') ;
AGGREGATE FUNCTIONS

SELECT COUNT(*)
FROM Route ;
SELECT AircraftType, AVG(NoSeats)
FROM Aircraft ;

UPDATE

17

Airline Reservation

www.freestudentprojects.com
Booking System

UPDATE Tariff
SET Price = Price + 5
WHERE RouteNo = 13
AND FareType = 'STS' ;
INSERT

INSERT INTO Aircraft


VALUES ('S60', 'Shorts-360', 36);
DELETE

DELETE
FROM Passenger
WHERE Pid IN (91, 92, 93, 94) ;
ORDERING

SELECT TicketNo, FlightNo, FlightDate


FROM Itinerary
WHERE FlightNo IN ('BD54','BD80','BD412', 'BD582', 'BD332')
ORDER BY FlightDate DESC ;

GROUPING
SELECT TicketNo, COUNT(FlightNo)
FROM Itinerary
WHERE TicketNo BETWEEN 100010 AND 100020
GROUP BY TicketNo ;
JOINING TABLES

SELECT NoSeats
FROM Aircraft, Flight
WHERE FlightNo = 'BD80' AND Aircraft.AircraftType = Flight.AircraftType ;
TABLE REFERENCES

18

Airline Reservation

www.freestudentprojects.com
Booking System

Airline Reservation

SELECT ADescription, NoSeats


FROM Aircraft A, Flight F, Itinerary I
WHERE TicketNo = 100010
AND I.FlightNo = F.FlightNo
AND F.AircraftType = A.AircraftType;
DROP TABLES

DROP TABLE Passenger;


VIEWS

CREATE VIEW PassengerItinerary


AS SELECT I.LegNo, I.TicketNo, I.FlightNo, I.FlightDate
FROM Passenger P, Itinerary I
WHERE P.Pid = user
AND P.TicketNo = I.TicketNo
ORDER BY TicketNo, LegNo ;
SUB QUERIES

SELECT AircraftType
FROM Aircraft
WHERE NoSeats = ( SELECT MAX(NoSeats)
FROM Aircraft );

4. Form Snapshots

19

www.freestudentprojects.com
Booking System

Main Form

Flight Info Form

20

Airline Reservation

www.freestudentprojects.com
Booking System

Reservation Form

21

Airline Reservation

www.freestudentprojects.com
Booking System

Airline Reservation

CONCLUSION
This software project takes care of all aspect of a typical domestic airline
reservation system. This software is not suitable for continental airline reservation.
The scope of this project has been limited to relation database management
systems. We do not explore the object oriented design of database. The project aims for a
specific application (domestic airline reservation) and not for a generic purpose. The
scope of this project is limited to the use of relational design and implementation. We do
not go into concepts of storage management, data retrieval and record storage.
The standards followed during the implementation enables new programmers to
handle the source code, easily and efficiently.
Resource:
www.freestudentprojects.com
www.studentprojectcode.com
www.studentprojectideas.com

22

www.freestudentprojects.com
Booking System

23

Airline Reservation

S-ar putea să vă placă și