This is a project documentation titled: Online Railway Reservation System.
This documentation was submitted by me as my assignment in my 6th sem (2013) in APIIT SD INDIA, Panipat along with a full-fledged working system i.e., a website built using ASP.NET & SQL SERVER 2008
Railway management system, database mini projectshashank reddy
The Railway Reservation System facilitates the passengers to enquire about the trains available on the basis of source and destination, Booking and Cancellation of tickets, enquire about the status of the booked ticket, etc. The aim of case study is to design and develop a database maintaining the records of different trains, train status, and passengers.
This project is about ' ONLINE RAILWAY RESERVATION SYSTEM ' that automates the process of generating tickets to the passengers. This System allows passengers to view Trains and Available seats(options like Berth availability , class are also included) , view , book & cancel the tickets online.
This is a presantation on railway reservation system project in php. project report and source code will be available soon . you can find it at www.avhishekblog.wordpress.com . hope this is useful to you
This software project is aimed at automation of online ticket booking. Objective of the project is to develop customize software package for ticket booking.
When we do this task manually then it become very hard to manage the ticket booking .So are developing this system to manage booking of ticket automatically. In this Bus Ticket Booking project we develop the system that can help the user to book their ticket online. In this project we take care of every services related to travelling and online ticket booking .When you start your traveling tour you have to book ticket so we help you in booking your traveling ticket
A train ticket is a ticket issued by a railway operator that enables the bearer to travel on the operator's network or a partner's network. Tickets can authorize the bearer to travel a set itinerary at a specific time (common for long-distance railroads), a set itinerary at any time (common for commuter railroads), a set itinerary at multiple times, or an arbitrary itinerary at specific times. The last two categories are often called passes: the former is often sold as a discounted block of trips for commuters; the latter is often sold to vacationers, such as European Eurail passes.
In some countries, like Italy, and some local railways in Germany, conductors are not used. Instead passengers are expected to validate tickets in a special stamping machine before entering the train. A system of coupons that are validated with a special machine exists on the Mumbai Suburban Railway where combinations of coupons of different denominations are used to get the corresponding ticket value.[1] There may or may not be a conductor later on double-checking that correct tickets are actually held. Yet further systems are possible, for example in Japan, the London Underground and in local traffic in Stockholm, the platforms are physically blocked, forcing the acquisition of a ticket before entering the platform.
Some train tickets are available with an option to add bus travel at either end of the train ticketed journey, as part of a wider transport network. For instance, the PLUSBUS scheme in the United Kingdom offers bus travel on an integrated ticket for an additional fee.[2] In Germany, most long distance train tickets include a "city ticket" valid on the public transit system of origin and destination. This is automatically included at no extra charge in all tickets purchased by Bahn Card holders and is indicated on the ticket.[3]train ticket reservation in c.i hope it will be helpful. Railway Reservation System is a complex online distributed transaction application based on client server architecture. The salient features of the software include allowing user from anywhere to do a booking for a journey in any train in any class from anywhere to anywhere; handling reservation, modifications cancellation/refunds.
Railway Reservation System - Requirement EngineeringDanish Javed
It's a presentation which is dealing with the requirements of the railway ticket reservation system with all details.
Topic: Requirement Engineering in Software Engineering
Railway management system, database mini projectshashank reddy
The Railway Reservation System facilitates the passengers to enquire about the trains available on the basis of source and destination, Booking and Cancellation of tickets, enquire about the status of the booked ticket, etc. The aim of case study is to design and develop a database maintaining the records of different trains, train status, and passengers.
This project is about ' ONLINE RAILWAY RESERVATION SYSTEM ' that automates the process of generating tickets to the passengers. This System allows passengers to view Trains and Available seats(options like Berth availability , class are also included) , view , book & cancel the tickets online.
This is a presantation on railway reservation system project in php. project report and source code will be available soon . you can find it at www.avhishekblog.wordpress.com . hope this is useful to you
This software project is aimed at automation of online ticket booking. Objective of the project is to develop customize software package for ticket booking.
When we do this task manually then it become very hard to manage the ticket booking .So are developing this system to manage booking of ticket automatically. In this Bus Ticket Booking project we develop the system that can help the user to book their ticket online. In this project we take care of every services related to travelling and online ticket booking .When you start your traveling tour you have to book ticket so we help you in booking your traveling ticket
A train ticket is a ticket issued by a railway operator that enables the bearer to travel on the operator's network or a partner's network. Tickets can authorize the bearer to travel a set itinerary at a specific time (common for long-distance railroads), a set itinerary at any time (common for commuter railroads), a set itinerary at multiple times, or an arbitrary itinerary at specific times. The last two categories are often called passes: the former is often sold as a discounted block of trips for commuters; the latter is often sold to vacationers, such as European Eurail passes.
In some countries, like Italy, and some local railways in Germany, conductors are not used. Instead passengers are expected to validate tickets in a special stamping machine before entering the train. A system of coupons that are validated with a special machine exists on the Mumbai Suburban Railway where combinations of coupons of different denominations are used to get the corresponding ticket value.[1] There may or may not be a conductor later on double-checking that correct tickets are actually held. Yet further systems are possible, for example in Japan, the London Underground and in local traffic in Stockholm, the platforms are physically blocked, forcing the acquisition of a ticket before entering the platform.
Some train tickets are available with an option to add bus travel at either end of the train ticketed journey, as part of a wider transport network. For instance, the PLUSBUS scheme in the United Kingdom offers bus travel on an integrated ticket for an additional fee.[2] In Germany, most long distance train tickets include a "city ticket" valid on the public transit system of origin and destination. This is automatically included at no extra charge in all tickets purchased by Bahn Card holders and is indicated on the ticket.[3]train ticket reservation in c.i hope it will be helpful. Railway Reservation System is a complex online distributed transaction application based on client server architecture. The salient features of the software include allowing user from anywhere to do a booking for a journey in any train in any class from anywhere to anywhere; handling reservation, modifications cancellation/refunds.
Railway Reservation System - Requirement EngineeringDanish Javed
It's a presentation which is dealing with the requirements of the railway ticket reservation system with all details.
Topic: Requirement Engineering in Software Engineering
Purpose Statement:
To provide an overview of Design for Manufacturing and Assembly (DFMA) techniques, which are used to minimize product cost through design and process improvements.
ONLINE BUS RESERVATION SYSTEM PROJECT REPORT.docx.docxKamal Acharya
The ticket machines would end the use of the hefty 1.5-kg ticket racks carried by conductors. It would also end the practice of tearing out tickets and marking fare stages. The Conductor would just have to key in the details about the fare stage and the ticket machine would print out the ticket. The machine weighs only 800 grams and is convenient to carry. The parameters are almost like that of a railway ticket, the only difference being that the machine is portable. The machine can print out 2,300 tickets, including the journey report in order to facilitate inspection by the corporation's checking inspectors. The ticket machines would help prevent loss on account of malpractice. It would also help in providing adequate data to the corporation, particularly with regard to the boarding of passengers from fare stages and important points. This would help the corporation prepare and organize its schedules more efficiently on the basis of traffic demand. Besides, it would provide data on concessions given to various sections. Another additional feature is that the data in the ticket machine could be fed into the computer. More over the depots of the corporation would be fully computerized so we want to add some other modules in our domain for depot’s verification.
Intelligent approach for smart car parking reservation and security maintenan...eSAT Journals
Abstract We approach a special system for smart parking reservation and security maintenance in a commercial car parking area in an urban environment. This system mainly designed to avoid unnecessary time conception to find an empty lot in a car parking area. By the same case we can also save more than 80% of fuel wastage in a car parking area to finds the empty parking slot. The reservation process is happening only by user. Hence the user finds the empty parking lot and makes the action of reservation through an internet access by an embedded process control unit (EPCU) with driver’s own knowledge. Here we give the major response to user’s reservation action and hence the driver can reserve his own likely parking slot based on the cost function. Instead of efficient car parking we need a special security options to make our vehicle very safe. By this case we have provided a best security guidance of barrier gate control security system (BGCSS) with the help of embedded process control unit (EPCU). There are number of steps taken to make a reservation with different lighting scheme mechanism (DLSM). We have proposed a system with multi-processing queuing mechanism (MPQM) to avoid multi-user approach problem (MUAP) during reservation process in our smart parking reservation system. Keywords: embedded process control unit (EPCU), multi-user approach problem (MUAP), different light scheme mechanism (DLSM), barrier gate control security system (BGCSS) and multi-processing queuing mechanism (MPQM).
Intelligent approach for smart car parking reservation and security maintenan...eSAT Publishing House
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology
Database project design report of Centro bus transit systemAnkur Gupta
The project focuses on helping the Syracuse (Central New York Regional Transportation Authority (Centro) Bus transit system by creating an online database and connect all the residents via mobile and online website, considering the recent trend, to enable the cell phones users to receive a text message when your bus is approaching your stop.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Online railway reservation system
1. Database and Web Database System
PT1081156 - Individual Assignment Page 1
APIIT SD INDIA
CE00318-2 (DWDS)
Database and Web Database Systems
INDIVIDUAL ASSIGNMENT
ONLINE RAILWAY RESERVATION SYSTEM
Submitted By: - Module Lecturer:-
Piyush Kumar Sulekh Sharma
PT1081156
2. Database and Web Database System
PT1081156 - Individual Assignment Page 2
Table of Contents
1. INTRODUCTION.....................................................................................................................................3
2. PROPOSED SOLUTION...........................................................................................................................4
3. Entity Relationship Diagram..................................................................................................................5
3.1 List Of Entity types: .............................................................................................................................5
3.2 List of Relationships: ...........................................................................................................................5
3.3 Entity Relationship Diagram: ..............................................................................................................6
4. Mapping of ERD to Relational Model....................................................................................................7
5. Normalization........................................................................................................................................9
Initial Database Schema............................................................................................................................9
5.1 FIRST NORMAL FORM(1NF) ..............................................................................................................10
5.2 SECOND NORMAL FORM (2NF).........................................................................................................11
5.3 RELATIONS IN THIRD NORMAL FORM (3NF).....................................................................................11
6. TABLE DESIGN & STRUCTURE .............................................................................................................12
7. QUERIES ..............................................................................................................................................18
7.1 DDL_STATEMENTS ............................................................................................................................18
7.2 DML STATEMENTS ............................................................................................................................20
8. FORM DESIGN .....................................................................................................................................24
9. REPORTS..............................................................................................................................................30
10. TOOLBAR.........................................................................................................................................32
11. REFERENCES AND CITATION ...........................................................................................................33
3. Database and Web Database System
PT1081156 - Individual Assignment Page 3
1.INTRODUCTION
This system is basically concerned with the reservation and cancellation of railway tickets to the
passenger. The need of this system arouse because as is the known fact that India has the largest
railway network in the whole world and it is not possible to handle such a large system manually.
By computerizing it, it became possible to overcome the limitations and make the system
operations more efficient. The complexity in handling data and records of such a vast system got
reduced and became easier by computerizing the system.
Being more specific, this online railway reservation system can perform the basic functions like
reservation and cancellation. The users are required to register on the server for getting access to
the database and query result retrieval. Upon registration completion, each user has an account
which is essentially referred to as the ‘view level’ of the customer. The account contains
comprehensive information of the user entered during the registration and allows the user to
access their past reservations, cancellations, enquire about trains and train schedule, seat
availability and make afresh reservations. The user will also be able to update their account
details, etc.
The master user of this system is the Railway Administrator who can login using a master
password and once a user is authenticated as the admin, he/she can access and modify
information stored in the database of this system. This includes adding and updating of train,
station, train routes and also managing the user and the passenger details.
4. Database and Web Database System
PT1081156 - Individual Assignment Page 4
2.PROPOSED SOLUTION
The railway network is a very vast system to be handled manually and its computerization will
prove to be of great help to both the employees and the passengers. The customer and the admin
are the two parties which are allowed to have access to the database of the system and have
different view level schemas’ to the database information.
The customers are privileged with the following services:
Register as a customer by providing certain personal details.
Make fresh reservations and book one or more (limited to 3 seats per ticket) seats.
View past booking and can even do cancellation of booked ticket.
See trains between a pair of stations, check seat availability in trains and get the fare
details.
Administrator is privileged with the following services:
Login as the master user using a master password
Add train, station, and route
See user and passenger details and can even delete their profiles after which the user will
not be able to login to the system as a user.
The system’s security has been kept into consideration well. The database of the system cannot
be accessed by any user either admin or customer without being authenticated by correct
username and password. The password set can also be modified and in case if the user forgets the
password, it can be recovered by giving a correct answer to a security question.
This project has been designed in such a way so that it overcomes problems like data
redundancy.
5. Database and Web Database System
PT1081156 - Individual Assignment Page 5
3.Entity Relationship Diagram
3.1 List of Entity types:
S. no Entity Attributes
1 User Email_ID, password, Fullname, Gender, Age, Mobile,City, State
2 Passenger PNR ,Passenger_name,Age, Gender,
Reservation_status,Booked_By
4 Train Train_ID, Train_name,Train_type,Available_days,Seat_available
5 Route Source_distance, Stop_number, Arrival_time, Departure_time
6 Station Station_ID, Station_Name
7 Train_Status Available_Date, Booked_seats1, Waiting_seats1,
Available_seats1, Booked_seats2, Waiting_seats2,
Available_seats2, Booked_seats3, Waiting_seats3,
Available_seats3
3.2 List of Relationships:
S.no. Relation Type Entity Types Involved
1 Enquires User, Train
2 Consists Of Station, Route
3 Has Train, Train_Status
4 Checks User, Train_Status
5 Has Train, Route
6 Starts from/ Ends on Train, Station
7 Assigns User, Passenger
6. Database and Web Database System
PT1081156 - Individual Assignment Page 6
3.3 Entity Relationship Diagram:
User
Email IdPassword
State
Mobile
Age
Gender
Full Name
Security-Question
City
Available_Date
Waiting_seats1
Security-Answer
Waiting_seats2
Waiting_seats3
Available_seats1
Available_seats2
Available_seats3
Booked_seats1
Booked_seats2
Booked_seats3
Books
Has
Dates
Status
M
1
Passenger
Passenger_Name
PNR
Age
Gender
Booked_By
Reservation_status
Seat_number
Show
source
Show
Destination
Station
Station_Id
Station_Name
Train
Train_Id
Train_Name
Train_Type
Available_Class
HasStrars
From
End At
Consist Of
Arrival_Time
Departure_Time
Stop_Number
Source_Distance
Has
Fare_Class1
Fare_Class2
Fare_Class3
Seat_Class1 Seat_Class2
Seat_Class1
N
M
1
M
N
N
N
N
N
N
1
1
1
1
1
N M
1
1
M
Train_Status
RouteRoute
RouteTrain_Class
7. Database and Web Database System
PT1081156 - Individual Assignment Page 7
4.Mapping of ERD to Relational Model
Step 1: Mapping of Strong Entity Type
S.no Entity Type Relation
1 User User (Email_ID, username, gender, age, mobile, Password)
2 Passenger Passenger (PNR ,Gender, Passenger_name, Age,Booked_By)
3 Train Train (Train_id, Train_name, Days_available, Train_type)
4 Station Station (Station_ID, Station_name)
Step 2: Mapping of Weak Entity Type:
S.no Entity Type Relation
1 Route Route(Train_ID, Stop_number ,Source_distance, Arrival_time,
Departure_time)
2 Train_status Train_status(Train_ID, Available_Date, Booked_seats1,
Waiting_seats1, Available_seats1, Booked_seats2, Waiting_seats2,
Available_seats2, Booked_seats3, Waiting_seats3, Available_seats3)
Step 3: Mapping Of 1:M Relationship:
Relation Entities Approach Relation
Starts
From
Train,Station Foreign Key Train(Train_ID,Train_name,Days_available,
Train_type,Fare_class1, Fare_class2,
Fare_class3, Seats_class1, Seats_class2,
Seats_class3)
Ends at Train, Station Foreign Key Train(Train_ID,Train_name,Days_available,
Train_type,Fare_class1, Fare_class2,
Fare_class3, Seats_class1, Seats_class2,
Seats_class3)
Show
Source
Station,
Passenger
Foreign Key Passenger (PNR, Seat_number, Class, Name,
Age, Gender, Fare , Source_ ID)
Show
Destination
Station,
Passenger
Foreign Key Passenger (PNR, Seat_number, Class, Name,
Age, Gender, Fare , Destination_ ID)
8. Database and Web Database System
PT1081156 - Individual Assignment Page 8
Step 3: Mapping Of M:N Relationship:
Relation Entities Approach Relation
Consists
of
Station, Route Cross-reference Route_HAS_Station(Station_ID,Train_ID,
Stop_number)
Step 5: Mapping Of n-ary Relationship:
Relation Entities Approach Relation
Books User, Passenger,
Train_status
Cross-reference Books(EmailID, PNR , Train_ID,
Available_Date, Reservation_Date,
Reservation_status)
9. Database and Web Database System
PT1081156 - Individual Assignment Page 9
5. Normalization
Initial Database Schema
User
EmailID FullName Password Age Gender Mobile City
State Security_question Security_answer
Train
Train_ID Train_name Train_type Seats_class1 Seats_class2
Seats_ class3 Fare_class1 Fare_class2 Fare_class3 Available_days
Source_ID Destination_ID
Station
Station_ID Station_Name
Passenger
PNR Passenger_name Gender Age Seat_no Class Fare Source_
ID
Destination
ID
Route
Train_ID Stop_number Source_distance Arrival_time Departure_time
Train Status
Train_ID Available_ Date Booked_
seat1
Booked_
seat2
Booked_
seat3
Waiting_
seat1
Waiting_seat2 Waiting_seats3 Available
_seats1
Available
_seats2
Available
_seats3
Consist_of
Station_ID Train_ID Stop_number
Reservation
EmailID, PNR Train_ID Available_Date
Reserved_status Reservation_Date
10. Database and Web Database System
PT1081156 - Individual Assignment Page 10
5.1 FIRST NORMAL FORM(1NF)
Relations already in 1NF
USER
STATION
TRAIN_STATUS
ROUTE
RESERVATION
ROUTE_HAS_STATION
Relations not in 1NF
PASSENGER
TRAIN
RELATIONS AFTER FIRST NORMAL FORM(1NF)
(PASSENGER) after 1NF
Passenger_ticket
PNR Class Type Fare Source_ID Destination_ID
Passenger
PNR Seat number Passenger_name Age Gender
(TRAIN) after 1NF
Train_days
Train_ID Days_Available
Train
Train_ID Train_Name Train_type Source_ID
Destination_ID Seats_class1 Fare_class1 Seats_class2
Fare_class2 Seats_class3 Fare_class3
11. Database and Web Database System
PT1081156 - Individual Assignment Page 11
5.2 SECOND NORMAL FORM (2NF)
RELATIONS IN 2NF
User
Station
Route_HAS_Station
Train_status
Route
Reservation
Passenger
Passenger_ticket
Train
Train_class
5.3 RELATIONS IN THIRD NORMAL FORM (3NF)
RELATIONS IN 3NF
User
Station
Route_HAS_Station
Train_status
Route
Reservation
Passenger
Passenger_ticket
Train
Train_class
16. Database and Web Database System
PT1081156 - Individual Assignment Page 16
9) ROUTE_HAS_STATION
CONSTRAINTS:
PRIMARY KEY: Train_ID,Station_ID
FOREIGN KEY: Station_ID
10) USER
CONSTRAINTS:
PRIMARY KEY: EmailID
FOREIGN KEY:
17. Database and Web Database System
PT1081156 - Individual Assignment Page 17
11) ADMIN
CONSTRAINTS:
PRIMARY KEY: UserID
FOREIGN KEY:
12) RESERVATION
CONSTRAINTS:
PRIMARY KEY: PNR,EmailID,Available_Date,PNR
FOREIGN KEY:--
18. Database and Web Database System
PT1081156 - Individual Assignment Page 18
7.QUERIES
7.1 DDL_STATEMENTS
1) TRAIN
create table Train (Train_ID int not null, Train_name varchar(50) not null, Train_type
varchar(50) not null, Source_stn varchar(30) null, Destination_stn varchar(30) null, Source_ID
varchar(8) null, Destination_ID varchar(8) null, primary key(Train_ID), foreign key(Source_ID)
references Station(Station_ID) on update cascade on delete cascade, foreign key
(Destination_ID) references Station(Station_ID) on update no action on delete no action)
2) TRAIN_CLASS
create table Train_class (Train_ID int not null, Fare_Class1 int not null, Seat_Class1 int not null,
Fare_Class2 int not null, Seat_Class2 int not null,Fare_Class3 int not null, Seat_Class3 int not
null, primary key(Train_ID))
3) DAYS_AVAILABLE
Create table Days_Available(Train_ID int not null, Available_days varchar(20), primary
key(Train_ID))
4) STATION
Create table Station(Staiton_ID int not null, Station_Name varchar(25), primary key(Station_ID)
)
5) PASSENGER
create table Passenger ( PNR varchar(25) not null, Seat_number int not null, Passenger_name
varchar(30) not null, Age int not null, Gender varchar(8) not null, Train_ID int not null,foreign
key(Train_ID) references Train(Train_ID) on update cascade on delete cascade, primary
19. Database and Web Database System
PT1081156 - Individual Assignment Page 19
key(PNR, Seat_number) )
6) PASSENGER_TICKET
create table Passenger_ticket ( PNR varchar(25) not null, Source_ID varchar(8) not null,
Destination_ID varchar(8) not null, Class_type varchar(50) not null, Reservation_status
varchar(25) not null, Train_ID int not null,foreign key(Train_ID) references Train(Train_ID) on
update cascade on delete cascade, primary key(PNR) )
7) RESERVATION
create table Reservation (Train_ID int not null, Available_Date varchar(20) not null, EmailID
varchar(30) not null, PNR varchar(20) not null, Reservation_Date text not null,
Reservation_Status varchar(20) null, foreign key(Train_ID,Available_Date) references
Train_status1 (Train_ID,Available_Date) on update cascade on delete cascade, foreign
key(EmailID) references User_table(EmailID) on update cascade on delete cascade, primary
key(Train_ID,Available_Date,EmailID,PNR) )
8) TRAIN_STATUS
create table Train_status3 (Train_ID int not null, Available_Date varchar(20) not null,
Booked_seats3 int null, Waiting_seats3 int null, Available_seats3 int null, primary
key(Train_ID,Available_Date), foreign key(Train_ID) references Train(Train_ID) on update
cascade on delete cascade)
9) ROUTE
create table Route (Train_ID int not null, Stop_number int not null, Station_ID varchar(8) not
null , Arrival_time text not null, Departure_time text not null, Source_distance int not null,
primary key(Train_ID,Stop_number), foreign key(Train_ID) references Train(Train_ID) on
update cascade on delete cascade)
20. Database and Web Database System
PT1081156 - Individual Assignment Page 20
10) ROUTE_HAS_STATION
create table Route_HAS_Station (Train_ID int not null,Station_ID varchar(20) not null,
Stop_number int not null, primary key(Train_ID, Station_ID))
11) USER
Create table User_table ( EmailID varchar(30) not null, Password varchar(15) not null, FullName
varchar(30) not null, Gender varchar(8) not null, Age int not null, Mobile varchar(14) not null,
City varchar(20) not null, State varchar(25) not null, Security_question varchar(40) not null,
Security_answer varchar(20) not null )
12) ADMIN
create table Admin_table (User_ID varchar(20) not null, Password varchar(15) not null, primary
key(User_ID))
7.2 DML STATEMENTS
INSERT STATEMENTS
Adding a new Station – This step is used to add a new station to the station table where the
admin provides the station name and the station id by which it will be recognized.
insert into Station values('" + txt_id.Text + "','" + txt_name.Text + "' )
Adding a Route – Data is inserted into the Route table.
Table route receive entries of train id, stop number, station id, arrival time, departure time and
the source distance.
insert into Route values('" + txt_trainid2.Text + "','" + txt_stopno.Text + "','"+txt_stnid.Text +"','"
+ txt_arrival.Text + "','" + txt_departure.Text + "','" + txt_distance.Text + "')
UPDATE STATEMENTS
21. Database and Web Database System
PT1081156 - Individual Assignment Page 21
Update Station
update Station set Station_ID='" + txt_id.Text + "' where Station_name ='" + txt_name.Text + "'
Update Train
update Train set Train_name= '" + txt_trainname.Text + "', Train_type='" +
ddl_type.SelectedItem + "',Source_stn='" + ddl_source.SelectedItem + "',
Destination_stn='" + ddl_dest.SelectedItem + "' where Train_ID='"+txt_trainid.Text +"'
RESERVATION QUERIES
RESERVATION
Read data from Station table and get Source Station ID
SqlCommand cmd = new SqlCommand("Select * from Station where Station_name ='" +
ddl_source.SelectedItem.ToString() + "'", con1);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txt_sid.Text = dr["Station_ID"].ToString();
}
dr.Close();
Read data from Station table and get Destination Station ID
SqlCommand cmd = new SqlCommand("Select * from Station where Station_name ='" +
ddl_dest.SelectedItem.ToString() + "'", con1);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txt_did.Text = dr["Station_ID"].ToString();
}
dr.Close();
22. Database and Web Database System
PT1081156 - Individual Assignment Page 22
Get list of trains available on a particular date between a pair of stations
Select Route.Train_ID, Train.Train_name ,Train_status.Available_Date
FROM
Route INNER JOIN Train ON Route.Train_ID=Train.Train_ID
INNER JOIN
Train_status ON Train.Train_ID=Train_status.Train_ID
WHERE (Route.Station_ID IN
(SELECT Source.Station_ID
FROM Route AS Source INNER JOIN
Route AS Destination ON Source.Train_ID =
Destination.Train_ID
WHERE (Source.Stop_number - Destination.Stop_number < 0) AND
(Source.Station_ID = @Source) AND (Destination.Station_ID = @Dest))) AND
(Train_status.Available_Date = @Available_Date)
Get seat status from table Train_status and display it when user selects the class from
dopdownlist provided
SqlCommand cmd = new SqlCommand("Select * from Train_status where Train_ID ='" +
lbl_id.Text.ToString() + "'and Available_Date='" + txt_date.Text + "'", con1);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
lbl_seats.Text = dr["Available_seats1"].ToString();
Label7.Text = "Total available seats in "+lbl_class.Text +" are : ";
lbl_msg.Text = "Total Seats already booked: ";
lbl_booked.Text = dr["Booked_seats1"].ToString();
}
dr.Close();
Calculate Fare form the Journey distance from the selected source and destination
stations
SqlCommand K = new SqlCommand("Select * from Route where Train_ID ='" +
lbl_id.Text.ToString() + "' and Station_ID='" + txt_sid.Text + "'", kon);
SqlDataReader dr2 = K.ExecuteReader();
while (dr2.Read())
{
distance1.Text = dr2["Source_distance"].ToString();
}
dr2.Close();
SqlCommand Kk = new SqlCommand("Select * from Route where Train_ID ='" +
lbl_id.Text.ToString() + "' and Station_ID='" + txt_did.Text + "'", kon);
SqlDataReader dr3 = Kk.ExecuteReader();
23. Database and Web Database System
PT1081156 - Individual Assignment Page 23
while (dr3.Read())
{
distance2.Text = dr3["Source_distance"].ToString();
}
dr3.Close();
int distance = (Convert.ToInt32(distance2.Text) - Convert.ToInt32(distance1.Text));
SqlCommand cmd = new SqlCommand("Select * from Train_class where Train_ID ='" +
lbl_id.Text.ToString() + "'", con1);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
lbl_X.Text = dr["Fare_Class1"].ToString();
}
int Y = Convert.ToInt32(lbl_X.Text);
int fare = Y * Convert.ToInt32(ddl_seats.Text)*distance ;
After Fare calculation, add passengers details to successfully complete the reservation
process
int a = Convert.ToInt32(lbl_seats.Text);
int booked = Convert.ToInt32(lbl_booked.Text);
SqlCommand cmd = new SqlCommand("insert into Passenger values('" + pnr + "','" + a + "','" +
txt_pname1.Text + "','" + txt_age1.Text + "','" + ddl_gender1.SelectedItem + "','" + lbl_id.Text +
"','" + lbl_email.Text + "')", conn);
cmd.ExecuteNonQuery();
CANCELLATION QUERIES
CANCELLATION
When user cancels a ticket, the PNR status is set as CANCELLED
update Passenger_ticket set Reservation_status = 'CANCELLED' where PNR="+txt_PNR.Text
+""
With the cancellation of one ticked, available seats in Train_status table for that specific
train should increase and booked seats should decrease by 1
update train_status set Available_seats1=Available_seats1+1 and Booked_seats1=
Booked_seats1-1 where Train_ID=’”+lbl_id.Text+”’ and Available_Date=’”+lbl_date.Text+”’
24. Database and Web Database System
PT1081156 - Individual Assignment Page 24
8.FORM DESIGN
1) NEW REGISTRATION – USER
DESCRIPTION: Any user coming to this page can register to the website by providing required
details. The details being provided should not violate the validation rules otherwise registration
will not be allowed.
2) LOGIN PAGE – ADMIN, USER
DESCRIPTION: Registered users login to the website by using a specific EmailID and
password. This will redirect the user to a different view level where the user will be availed
various services like reservation, cancellation, etc.
25. Database and Web Database System
PT1081156 - Individual Assignment Page 25
3) ADD TRAIN
DESCRIPTION: Admin of this website can add new trains to the database which will be further
allowed for reservations. Train will be assigned a Train ID which should be unique and then a
train name will also be assigned to the train for its identification.
4) ADD STATION
DESCRIPTION: The admin is privileged to add and update new stations and station IDs to the
system’s database.
26. Database and Web Database System
PT1081156 - Individual Assignment Page 26
5) ADD ROUTE
DESCRIPTION: Already added trains require a route to be defined which it has to follow. The
admin can use this page to add new route to the train where he/she has to add station ids and stop
numbers along with arrival and departure times.
6) TRAIN STATUS
DESCRIPTION: This page can be used to see the total available seats, booked seats and waiting
seats in particular classes of a train. The train IDs is available in the dropdown list given.
27. Database and Web Database System
PT1081156 - Individual Assignment Page 27
7) MANAGE PROFILES
DESCRIPTION: Admin can view the details of registered users and can also update and delete
their accounts. Users whose account will be deleted won’t be able to use the reservation/
cancellation services of the site.
8) MANAGE TRAIN
DESCRIPTION: Admin can view and update train details that have been added to the database
of this system. The admin can find trains either by providing train id or train name.
28. Database and Web Database System
PT1081156 - Individual Assignment Page 28
9) CHECK PNR
DESCRIPTION: Users who have reserved seats in any of the trains can enter the PNR number
provided to them and can see the status of their ticket whether it is confirm, is cancelled or is
queued in the waiting slot.
10) SEAT AVAILABILITY
DESCRIPTION: This is used to view the available seats in a particular class of a train. User can
enter the source and destination station name and the date for which they want to see the
availability of seats.
29. Database and Web Database System
PT1081156 - Individual Assignment Page 29
11) VIEW SCHEDULE
DESCRIPTION: Users can search and view train schedule and other details by proving the train
number or the train name. The user will be shown the train details like arrival departure timings
along with the route it will follow to reach to the destination station.
30. Database and Web Database System
PT1081156 - Individual Assignment Page 30
9.REPORTS
1) REPORT: TRAINS
Description:
The report TRAINS is used to show the list of Trains added by the admin to the database. This
consists of the train id, train name, train type, source station name, and destination station name.
This report can be downloaded in either of .pdf form or .docs form or as an excel sheet.
Admin needs to see the detailed list of the trains like the train name, its source station and the
destination station. The report also shows the type of train it is i.e., whether it is an express train
or super fast or Rajdhani etc. This report will help in the management of trains to the admin.
31. Database and Web Database System
PT1081156 - Individual Assignment Page 31
2) REPORT: TRAIN ROUTE
Description:
The report TRAIN ROUTE displays details of the route that trains of this website will follow. It
consists of the train id, station id where the train will stop, stop number, arrival time at the stop,
departure time from the stop and the distance of the stop from the source station.
When the user(admin) will want to see the the detailed list of trains along with its stop stations
and its timings at all its stops from source to destination, this report will be helpful so that by
viewing this report, any required changes/modifications can easily be made to the database.
32. Database and Web Database System
PT1081156 - Individual Assignment Page 32
10. TOOLBAR
A toolbar has been provided in the user’s view level which consists of icons like Home, Train,
and Ticket which serves as a link to the respective pages. The Home icon if clicked, redirects the
user to the Home page of the user and similarly the Power button icon allows user a proper
logout.
This icon depicts the
Home. On click of this,
user is redirected to its
homepage.
This is the Schedule icon which
takes the user to the “Check
Schedule” page
This is the Ticket icon on click of which takes the
user to the “Check Schedule” page where the user
will be able to reserve 1 or more seats in any
particular train.
The train icon redirects the user to the search train
page which allows user to search different trains
by entering the train id or the train name or even
by entering any route station.
The user can logout of the website by clicking this
icon.
33. Database and Web Database System
PT1081156 - Individual Assignment Page 33
11. REFERENCES AND CITATION
1) SQL JOINS
w3cschoolsadmin. (2013). SQL INNER JOIN. Available:
http://www.w3schools.com/sql/sql_join_inner.asp. Last accessed 24th April
2013.
2) SQL LEFT JOIN
w3cschoolsadmin. (2013). SQL LEFT JOIN. Available:
http://www.w3schools.com/sql/sql_left_inner.asp. Last accessed 21st April
2013.
3) SQL UPDATE
w3cschoolsadmin. (2013). SQL UPDATE. Available:
http://www.w3schools.com/sql/sql_update.asp. Last accessed 15th April
2013.
4) INSERT STATEMENTS IN SQL BY C#
marc. (2012). write insert query in c#. Available:
http://stackoverflow.com/questions/9954900/how-to-write-insert-query-in-c.
Last accessed 21st April 2013.
5) GRIDVIEW DATABINDING
Msoft. (2013). GridView.DataBind Method. Available:
http://msdn.microsoft.com/en-IN/library/fkx0cy6d.aspx. Last accessed 12th
April 2013.
6) FOREGIN KEY CONSTRAINT
w3cschoolsadmin. (2013). SQL FOREIGN KEY Constraint. Available:
http://www.w3schools.com/sql/sql_foreignkey.asp. Last accessed 18th April
2013.
7) Referred to www.indianrail.gov.in/ and www.irctc.co.in .
34. Database and Web Database System
PT1081156 - Individual Assignment Page 34