1.1 Introduction To SQL: Data Query Language (DQL)
1.1 Introduction To SQL: Data Query Language (DQL)
1.1 Introduction To SQL: Data Query Language (DQL)
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION TO SQL
DROP - Used to delete an entire table, a view of a table or other object in the
database.
with the generated web page. PHP code may also be executed with a command-line
interface (CLI) and can be used to implement standalone graphical applications.
The standard PHP interpreter, powered by the Zend Engine, is free
software released under the PHP License. PHP has been widely ported and can be
deployed on most web servers on almost every operating system and platform, free of
charge.
CHAPTER 2
REQUIREMENT SPECIFICATION
2.1 SOFTWARE REQUIREMENTS
Operating System : 64bit operating system, x64-based processor
Database : MYSQL
Tools : WAMP SERVER
CHAPTER 3
OBJECTIVE OF THE PROJECT
The Bus ticket reservation system is currently maintaining the project Transport
Company’s process manually which is a very time consuming process. It deals with
transport industry’s ticket booking and transport maintenance, so it becomes a very
tedious job for the ticket booking transporter to look after these particulars to
complete the task at right time. The bus ticket booking system not only deals with
transporters owned vehicles but also takes into consideration about the other
types project of system transport vehicles available with other transporters .
The objective of my project is to make easy the ticket booking project system of
Ticket Booking Agency simple, reliable, user friendly, and corrective. Moreover less
time consuming as compared to manual work.
CHAPTER 4
IMPLEMENTATION
4.1 ER DIAGRAM EMAIL_ID LNAME
FNAME PHONE
PHONE
ROUTENO
PASS_ID PASS_ID
BUSTYPE
AVALIABLE_S
EATS
BUS_NO
1 BUS 1 MANAG N PASSENGER
ES
GENDER
1 BUS_LOCATION
BO0KING_ID BUS_ROUTE 1
TRAVELS_
THROUG
BUS_LOCATION
H
BOOKS
ROUTE_NO 1
N N
N TICKET_
DATE
NDEPART_
TIME DEPART_
HAS
DATE
SOURCE
DESTINATION
TICKET
N PASS_ID
ROUTE SEATNO
BOOKINGID
BOOKING_DETAILS TICKETNO
BOOKING_ID
NO_OF_
BOOK_DATE SEATS
PASS_ID
BUS_NO TICKET_
NO
Fig 4.1:ER Diagram
PASSENGER
ROUTE
BUS
BOOKING_DETAILS
TICKETS
CONTACT_NO
PASS_ID PHONE
BUS_LOCATION
(Pass_id varachar(20),
Phone int,
Primary key(Pid,Phone),
Foregin key (Pass_id) references passenger (pid));
Insertion Of Route
Insert into route values ('a1', 'bangalore', 'mangalore', '15-10-2018', '7:00 p.m');
Insert into route values ('b4', 'bangalore', 'kerala', '10-11-2018', '9:00 p.m');
Insert into route values ('v3', 'hyderabad', 'pune', '20-10-2018', '6:00 p.m');
Insert into route values ('c2', 'bangalore', 'mysore', '23-11-2018', '7:00 p.m');
Insert into route values ('n3', 'chennai', 'bangalore', '19-10-2018', '9:00 a.m');
Insert into route values('b2', 'bangalore', 'madkeri', '1-12-2018', '10:00 p.m');
Insertion Of Ticket
Insert into ticket values ('12', '15-10-2018', 'd:1', '500','1254', 'yh-133');
Insert into ticket values ('25', '10-11-2018', 'a:1-4 b:1,2 d:1', '10500', '2987', 'ac-112');
Insert into ticket values('73', '20-10-2018', 'c:1,2 d:1,2 b:1', '4000', '4521', 'bg-111');
Insert into ticket values ('05', '23-11-2018', 'e:1,2 f:1,2', '2800', '1241', 'ab-110');
Insert into ticket values ('47', '19-10-2018', 'a:1-4 b:11-4', '3000', '3261', 'hk-115');
Update booking_details
Set ticket_no=05
Where booking_id='1241';
Update booking_details
Set ticket_no=12
Where booking_id='1254';
Update booking_details
Set ticket_no=25
Where booking_id='2987';
Update booking_details
Set ticket_no=73
Where booking_id='4521';
Update booking_details
Set ticket_no=47
Where booking_id='3261';
Insertion Of Bus
Insert into bus values ('ap11z6','10','multi-axle semi sleeper','b2','bg-111');
Insert into bus values('tn-18v7979','10','non-a/c,seater','b4','ac-112');
Insert into bus values ('tn-46d0066','15','volvo a/c multi semi sleeper','n3','ac-112');
Insert into bus values ('ka-10a2848','20','a/c sleeper','v3','hk-115');
Insert into bus values('ka-13f3211','10','non a/c,sleeper',''a1,'ab-110');
Insert into bus values ('ka-22m6523','15','non a/c,seater','c2','yh-113');
Insert into bus values ('ka-15n1210','15','non a/c,seater','a1','rn-114');
Insertion Of Booking_details
Insert into booking_details values ('1241','4-10-2018','4','ab-110','ka-13f3211');
Insert into booking_details values ('1254','3-11-2018','2','yh-113','ka-22m6523');
Insert into booking_details values ('2987','29-10-2018','7','ac-112','tn-18v7979');
Insert into booking_details values ('4521','1-10-2018','5','bg-111','ap11z6');
Insert into booking_details values ('3261','25-09-2018','8','hk-115','ka-10a2848');
Insertion Of Bus_Location
Insert into bus_location values ('bg-111','udupi','mangalore');
Insert into bus_location values ('ac-112','arakalagud','madkeri');
Insert into bus_location values ('yh-113','ramanagar','mysore');
Insert into bus_location values ('rn-114','kunigal','bangalore');
Insert into bus_location values ('hk-115','kutta','kerala');
Insertion Of Contact_no
Insert into contact_no values ('ab-110','998654789');
Insert into contact_no values ('ac-112','974024298');
Insert into contact_no values ('bg-111','914563287');
Insert into contact_no values ('hk-115','735319609');
Insert into contact_no values ('rn-114','735315608');
Insert into contact_no values ('yh-113',779535521');
The following trigger calculates the GST. The ticket amount when entered in the front
end table Ticket, the amount will be multiplied with 18% and then added to the
initial ticket amount. If the amount entered is less than 0, then there will be no GST
calculated.
Delimiter $$
Create Trigger Bus_Fare_Charges_Check Before Insert On Ticket
For Each Row Begin
If New.Tick_Amt_In_Rs < 0 Then
Set New.Tick_Amt_In_Rs = 0;
Elseif New.Tick_Amt_In_Rs > 0 Then
Set New.Tick_Amt_In_Rs = New.Tick_Amt_In_Rs + (New.Tick_Amt_In_Rs *0.18);
End If;
End;
$$
Delimiter;
The stored procedure combines two tables Passenger and Booking_Details with the
combining key Pass_id . The resulting view would be having the Fname, Lname from
the Passenger table and Booking_id, Book_date and the Num_of_seats from
Booking_id table.
Delimiter $$
Create Procedure Proc (In Keypass_Id Varchar (20))
Begin
Select P.Fname, P.Lname, B.Booking_Id, B.Book_Date, B.Num_Of_Seats
From Passenger P ,Booking_Details B
Where P.Pass_Id= B.Pass_Id And P.Pass_Id =Keypass_Id;
End
$$
Call Proc ('AB-110')
$$
CHAPTER 5
FRONT END DESIGN
5.1 CONNECTIVITY TO DATABASE
The mysql Improved extension uses the mysqli class, which replaces the set of legacy
mysql functions.
To connect to mysql using the mysql Improved extension, follow these steps:
1 .Use the following PHP code to connect to mysql and select a database. Replace
username with your username, password with your password, and dbname with the
database name.
2. After the code connects to mysql and selects the database, you can run SQL
queries and perform other operations. For example, the following PHP code runs a
SQL query that extracts the last names from the employees table, and stores the
result in the $result variable
<?php
$result = $mysqli->query("SELECT lastname FROM employees");
?>
3. Finally, we close the connection. Although this isn’t strictly speaking
necessary.PHP will automatically close the connection when the script ends
<?php//close connection
mysqli_close($db);
Until the 1990s systems design had a crucial and respected role in the data
processing industry. In the 1990s standardization of hardware and software resulted in
the ability to build modular systems. The increasing importance of software running
on generic platforms has enhanced the discipline of software engineering.
Object-oriented analysis and design methods are becoming the most widely
used methods for computer systems design.[citation needed] The UML has become
the standard language in object-oriented analysis and design.[citation needed] It is
widely used for modeling software systems and is increasingly used for high
designing non-software systems and organizations.[citation needed]
<head>
Body {
Background-Image:Url("Https://Relaunch.Jedox.Com/Wp-
Content/Uploads/2017/01/Header-Background-Slider-1_Compressed.Jpg");
Background-Repeat: No-Repeat;
<Body>
</Form>
</Body>
</Html>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "br";
// create connection
// check connection
if ($conn->connect_error) {
$pass_id=$_post["t1"];
$fname=$_post["t2"];
$lname=$_post["t3"];
$phone=$_post["t4"];
$address=$_post["t5"];
$gender=$_post["t6"];
$email_id=$_post["t7"];
$sql = "insert into passenger (pass_id,fname,lname,phone,address,gender,email_id)
Dept. of CSE, GAT 2018-2019 20
Bus Reservation System
values ('$pass_id','$fname','$lname','$phone','$address','$gender','$email_id')";
}
$conn->close();
?>
<input type="submit"/>
</body>
</html>
<Head>
<Title>Delete Page</Title>
<Style>
Body {
Background-Image:Url("Https://Relaunch.Jedox.Com/Wp-
Content/Uploads/2017/01/Header-Background-Slider-1_Compressed.Jpg");
Background-Repeat: No-Repeat;
</Style>
<Body>
</Form>
</Body>
</Html>
<Body>
<?Php
$Servername = "Localhost";
$Username = "Root";
$Password = "";
$Dbname = "Br";
// Create Connection
// Check Connection
If ($Conn->Connect_Error) {
$Pass_Id=$_POST["T1"];
// Sql To Delete A Record
$Sql = "DELETE FROM PASSENGER WHERE PASS_ID='$Pass_Id'";
$Conn->Close();
?>
<Input Type="SUBMIT"/>
</Body>
</Html>
<Head>
<Title>Search Page</Title>
<Style>
Body {
Background-Image:Url("Https://Relaunch.Jedox.Com/Wp-
Content/Uploads/2017/01/Header-Background-Slider-1_Compressed.Jpg");
Background-Repeat: No-Repeat;
</Style>
</Head>
<Body>
<Br>
<Br>
<Br>
<Br>
<Br>
<Br>
<Br>
<Br>
<Br>
</Form>
</Body>
</Html>
CHAPTER 6
TESTING
This chapter gives the outline of all testing methods that are carried out to get
a bug free system. Quality can be achieved by testing the product using different
techniques at different phases of the project development. The purpose of testing is to
discover errors. Testing is the process of trying to discover every conceivable fault or
weakness in a work product. It provides a way to check the functionality of
components sub assemblies and/or a finished product. It is the process of exercising
software with the intent of ensuring that the Software system meets its requirements
and user expectations and does not fail in an unacceptable manner. There are various
types of test. Each test type addresses a specific testing requirement.
CHAPTER 7
RESULTS
This section describes the output of the “BUS RESERVATION DATABASE”.
The snapshots are shown below for each module.
7.1 SNAPSHOTS
Displaying the creation of tables at the back end using my sql console in wamp
server.
Displaying the insertion of tables at the back end using my sql console in wamp
server.
Displaying triggers at the back end using my sql console in wamp server.
Displaying stored procedures at the back end using my sql console in wamp server.
Displaying the bus reservation database from the front end using my sql console in
wamp
Displaying front end table layout using my sql console in wamp server
Displaying insert layout from front end using my sql console in wamp server
Displaying search layout from front end using my sql console in wamp server
Displaying the delete layout from front end using my sql console in wamp server
CONCLUSION
The main objective of proposed system is to provide for a quick and efficient
retrieval of information. Any type of information would be available whenever
the user requires. The system should be easy to operate also.To work gets
easier,when he/she can use a database on a computer, rather than managing all
the details on paper.The model can be made more customized based on
requirement. The database structure is quite simple, which makes it easy for also
other programmers to understand it.
During my database management course I have learned about the basics of
database design.This project gave me the opportunity to try our new skills in
practice.While doing this project I also gained deeper understanding on database
design and how it can be implemented in real life situations. I believe we can use
our database designing skills also in other projects.
In conclusion, a database is a far more efficient mechanism to store and organize
data than spreadsheets it allows for a centralized facility that can easily be
modified and quickly shared among multiple users. It also allows the possibility
of queries to obtain information for various surveys. Due to the number of users
reading and modifying the data in the database, it is an ideal use for such a
system
REFERENCES
[1] Elmasri, Ramez. Fundamentals of database systems. Pearson Education
India, 2008.
[2] Greken T and Ratschiller T, 2000.Web applications development with
PHP.Now riders publishing,2000.
[3] Ware B, open source development with LAMP using linux, Apache,My
SQL,And PHP Addison-wesley Longman publishing Co-,Inc.,2002
[4] Welling L and Laura Thomson PHP and My SQL web development Same
publishing,2003