A CAL Project Report on
TAXI MANAGMENT SYSTEM
Database Management Systems – ITE
1003 (A1)
by
NALLAM THANMAYIE 19BIT0160
R KARAN 19BIT0163
BRUNDHA K 19BIT0357
1
DECLARATION
We the undersigned solemnly declare that the project report TAXI MANAGEMENT
SYSTEM is based our own work carried out during the course of our study under the
supervision of Dharmendra Singh Rajput.
We assert the statements made and conclusions drawn are an
outcome of our research work. We further certify that
I. The work contained in the report is original and has been done by our
team under the general supervision of Dharmendra Singh Rajput.
II. We have followed the guidelines provided by
the university in writing the report.
2
1 Introduction.......................................................................................01
2 Review 1 (Survey, Analysis).............................................................02
3 Review 2 (Design of Diagrams & Prototype Design).......................09
4 Review 3 (Development of Model)...................................................17
5 Conclusion........................................................................................39
6 References........................................................................................39
3
ABSTRACT
The general abstract of TAXI MANAGEMENT SYSTEM [DBMS] project is
renting a cab/taxi and getting cash from the respective clients who use it. Here
we demonstrate usage of create, read, update and delete MYSQL operations.
Project begins by adding a cab and then adding the details of the driver using the
taxi. Owner (person in charge) provides the cab to the drivers. Expense id also
added on daily basis. During booking customer/client books a taxi for their
requirement to get to the specific and desired locations. In this project we have
been analyzing and insert the data requirements and functional requirements
needed and have perfectly implemented the system. The data requirements, apart
from data to be stored in the database has been taken into consideration, and some
are taken in to account which are necessary integrity constraints that are
reasonable for the database.
DBMS PROJECT --A TECHNICAL BOOKING TOUR
OF TAXI MANAGEMENT SYSTEM
The Taxi management System Mini-world:
The mini-world chosen here is the taxi / cab organisation for
which we have designed the system.
And the title of our project is Taxi Management System.
1
DATA COLLECTION
The taxi reservation system has TAXI,which has unique TAXI_NO which would be the key
Attribute uniquely used to identify the NAME OF THE
TAXI,MODEL_NAME,LICENSE_NO.
Also whether STORAGE for luggage is available or not, who is the MANUFACTURER,and
YEAR OF MANUFACTURER TYPE and gives us the details NO_OF SEATS available for the
passengers who book a drive. Also taxi management has a reservation system.
A collection of USERS. Each USER has a unique ID, PASSWORD, MOBILE NO and
can GIVE_RATINGS of the service provided by the drivers.
User can get the RESERVATION option which has PNR(unique attribute), STARTING
POINT, DESTINATION POINT, DATE OF JOURNEY, FARE,PREFERRED LANGUAGE,
TYPE OF
BOOKING which is more beneficial and time saving for passengers.
There are certain EMPLOYEES who works on taxi has NAME, ID(unique-attribute),
AGE, PHONE NO, DEPARTMENT, ADDRESS, SALARY.
RESERVATION contains details of the passengers like SERIAL_NO (unique attribute),
NAME, AGE, STATUS of the reservation like confirmed, waiting, cancelled.
TAXI uses a TRACKING system so is to make the passenger comfortable gives the information
about TAXI_NO, GEOLOCATION of the TAXI and PASSENGER, PHONE_NO (driver no,
passenger_no ,alternate number of the passenger), DRIVER_ID, DISTANCE, ESTIMATED,
ARRIVAL_TIME.
User can make PAYMENTS for booking the taxi has unique TRANSACTION_ID,
TAX, ACCOUNT_NO, BASE_FARE, FACILTY_FEE.
The EMPLOYEE who works on TAXI has SUPERVISORS, SUPERVISED BY SOMEONE in
itself only.
The information of the DRIVER who drive the
TAXI has NAME, ID, PHONE_NO, RATINGS.
2
Data Requirement for Taxi management system:
1) Taxi_no Data stored: Taxi_no of each taxi
Constraint: Taxi_no is primary key and hence cannot be null, Name of taxi, Model
Name, License_No, Storage,year of manufacturer Type Data stored, No_of_seat Data
stored.
2) Passenger Data stored: Passenger’s id, Passenger’s Name, Passenger’s
Age,Blood group, Reservation status.
Constraints: The passenger table should have unique id for each tuple. Tabular form is
conventionally chosen, Passenger id cannot be NULL value, Passenger id can take only value
having data type as number and that too limited assigned value only,Passenger name can take
only value having data type as varchar and that too limited assigned value only (ex varchar(20)),
Passenger age can take only value having data type as number and that too limited assigned value
only (ex-age(3)).
Date of travel can take only value having data type as number and that too limited assigned
value [Link] group can take the value of varchar2(5).
Reservation status can take only value having data type as
varchar and that too limited assigned value only (ex varchar(20)).
3) User Data stored: Date of Birth, rating, ID, Password, Mobile_No.
Constraints: The user table should have unique id for each tuple, Tabular form is
conventionally chosen.
Passenger id cannot be NULL value. User id can take onlyvalue having data type as number
and that too limited assigned value only.
Password can take only value having data type as varchar and that too limited assigned
value only(ex varchar(20)).
Mobile_No. can take only value having data type as number and that too limited assigned value
only (ex-number (10)).
Date of birth can take only value having data type as timestamp and that too limited
assigned value only.
Rating can take only value having data type as number and that too limited assigned value
only (ex number (10))
4) Reservation Data stored: Date_of_journey, PNR, Starting_Point,
Destination_Point, Fare,preferred language, Type_of_booking, No_of_seats.
Constraints: The reservation table should have unique PNR for each tuple. Tabular form
is conventionally chosen.
Passenger id cannot be NULL value. PNR, fare can take only value having data type as
number and that too limited assigned value only.
Starting_point, type_of_booking and destination_point can take only value having data type
as varchar and that too limited assigned value only (ex varchar(20)).
3
No. of seats can take only value having data type as number and that too limited assigned
value only (ex-number(10)).preferred language can take the data type varchar2(20).
Date of journey can take only value having data type as timestamp and that too limited
assigned value only.
5) Driver Data stored: Driver_id, Ratings, Phone_no.
Constraints: The driver table should have unique driver_id for each tuple. Tabular form
is conventionally chosen.
Passenger id cannot be NULL value.
Driver_id, phone_no, rating can take only value having data type as number and that too
limited assigned value only.
6) Employee Data stored: Employee’s id, Employee’s Name, Employee’s Age (for
retirement purpose), Department number, Salary.
Constraints: The Employee table should have unique id for each tuple. Relational model
is conventionally chosen.
Tabular form is conventionally
chosen. Employee id cannot be NULL
value.
Employee id can take only value having data type as number and that too limited assigned
value only.
Employee name can take only value having data type as varchar and that too limited
assigned value only (ex-varchar(20)).
Employee age can take only value having data type as number and that too limited
assigned value only (ex-age(3)).
Department number can take only value having data type as number and that too
limited assigned value only.
Salary can take only value having datat ype as number and that too limited assigned value only.
Department number is a foreign key.
7) Payment Data stored: Taxi Id, base Fare, Tax Service, Other charge, Account_No.
Constraints: Taxi id is a foreign key.
Domain Constraint: base Fare, Tax_service and other charge can take only value having
data type as number and that too limited assigned value only.
8) Tracking Data stored: Taxi id, Geolocation of taxi, Geolocation of passenger, Id of
driver, Arrival time, Depart time, Distance.
Constraint: Taxi number is a foreign key.
4
Relational model is conventionally
chosen. Tabular form is conventionally
chosen.
Distance can take only value having data type as number and that too limited assigned
value only.
Arrival time, Departure time can only take data type timestamp.
Geolocation of taxi, Geolocation of passenger, Taxi id, day can take only value having data type
as varchar and that too limited assigned value only(ex-varchar(20)).
5
Functional Requirement for Taxi Management System:
1) Making sure availability of taxi of almost all type at all time. Taxi management system
should make sure that taxis could be made available to customers at all time for smooth
business. Availability of variety of taxis should also be ensured(3-seater,4-seater,6-seater).
2) Assigning multiple stops as per customer's demanded multiple stops facility to
facilitate customer's demand of multiple stoppages. For instance: While visiting relatives,
customer wish to visit stores to purchase certain items and then visit relatives, now provides
this facility to customer.
3) Online Booking of Taxi provides online booking to passengers and
ensures confirmation through messages and email.
Do certain steps like:
• Takes passenger's phone number
• Takes name
• Takes email id
• Takes current location
• Asks for destination
• Asks for payment mode followed by payment
(ifmode Support)
4) Maintaining Customer's database and driver's database Customer details are
kept in account Driver's details along with driver's photo is kept in account. Rating of
drivers and passengers are also taken in account.
5) Stating the reservation status of passengers. Message confirming passenger's travel is
sent to passengers Messages like "Your is on the way. Mohan (taxi Driver name) 4.75 stars
(rating as per customer to driver) will arrive in 5 minutes" is sent once a travel is confirmed.
6) Updating taxi location every 5 sec Once a travel is booked. The taxi management
system makes sure that passenger's get the live location of taxi every 5 sec. This facility is
continued till the travel is completed. Travel must be cancelled if passengers requests
cancellation. The reservation status of passenger should also be updated as per
cancellation or confirm booking.
7) Assigning work to each department and employee. The Management System should
make sure that employees like technical staffs, engineers and managers should be
appointed with a proper verification so that they could be helpful in providing facilities in a
desired manner. Employees at ground level like that for sanitation and cleanliness must
also be appointed in a different manner.
6
8) Good Communication System's Customer Care number helps customers 24*7. Hence
a good communication support system is required.
9) Deciding taxi's fare Travel cost per kilometer is to be decided by management
system in such a way that both customer and company runs in profit and smoothly.
10) Taking payments and ensuring traveller's security
Taking payments and ensuring traveller's safety and security of money and individual.
7
SCENARIOS
Updating
1) Drop location
2) Accordingly increase fare
3) Geo-location of cab and passenger
4) Passenger status
Insertion
1) Data for Taxi table
2) Data for User table
3) Data for passenger table
4) Data for driver table
5) Data for Reservation table
Retrieval
1) Details of Passenger
2) Details of Driver
3) Details of Taxi
4) Details of Tracking –> Geo-location of taxi with estimated arrival and departure time
5) Details of employee
6) Payment Receipt
7) Reservation Status and type of booking for the user
8) Department and address of employee who works for taxi management.
8
3. DESIGN
ER
DIAGRAM
9
RELATIONAL DATABASE SCHEMA
USER
USER_ID PASSWORD DOB MOBILE_NO GIVE_RATINGS TRANSACTION_ID
RESERVATION
PNR STARING DESTINATION FARE DOJ TYPE OF NO OF P_ID T_NO
POINT POINT BOOKING SEATS
PASSENGER
SERIAL_NO NAME AGE STATUS
PAYMENT
TRANSACTION_ID BASE_FARE TAX ACCOUNT_NO FACILITY_FEE USER
PAYMENT_ID
TAXI
TAXI_NO NAME MODEL_NAME LICENSE_NO STORAGE SEATS TYPE
TRACKING
TRACKING GEOLOGICAL GEOLOGICAL DRIVER_ID DEPARTURE ESTIMATED DISTAN
TAXI_NO TAXI PASSENGER TIME ARRIVAL CE
TIME
DRIVER
DRIVER_ID NAME PHONE_NO RATINGS
1
EMPLOYEE
E_ID E_NAME SALARY ADDRESS EMAIL PHONE_NO DEPARTMENT AGE RATING SUPERVISOR_ID
PHONE_NO
TRACKING_TAXI_NO PHONE_NO
CONTAINS
PNR_NO SERIAL_NO
USES
TAXI_NO TRACKING_NO
DRIVES
DRIVER_ID TAXI_NO
WORKS_ON
EMPLOYEE_ID TAXI_NO
1
1
Normalisation
User
User_ID Password DOB Mobile_no Give_ratings Transaction_ID
R = (User_ID, Password, DOB, Mobile_no, Give_ratings,
Transaction_ID) Functional Dependencies:
User_ID, Password → DOB, Mobile_no,
Transaction_ID; Transaction_ID → Give_ratings;
Candidate Key is {User_ID, Password}.
The relation R is currently in 2NF since there are no partial dependencies.
To convert it into 3NF, we would have to get rid of transitive
dependencies.
In this relation, the transitive dependency is Transaction_ID → Give_ratings, to get rid of it we decompose this
relation R into:
R1 = (User_ID, Password, DOB, Mobile_no, Transaction_ID)
User_ID Password DOB Mobile_no Transaction_ID
R2 = (Transaction_ID, Give_ratings)
Transaction_ID Give_ratings
This relation is in BCNF since for every non-trivial FD A→B, A is the superkey.
Reservation
PNR Starting_ Destination_ Fare Date_of_ Type_of_ No_of_ Passenger Taxi_No Preferred_
Point Point Journey Booking Seats _ID Language
R=(PNR, Starting_Point, Destination_Point, Fare, Date_of_Journey, Type_of_Booking,
1
No_of_Seats, Passenger_ID, Taxi_no, Preferred_Language)
1
Functional Dependencies:
PNR → Starting_Point, Destination_Point, Date_of_Journey,
Passenger_ID PNR, Type_of_Booking → Fare, No_of_Seats, Taxi_No
Passenger_ID → Preferred_Language
Candidate Key is {PNR,
Type_of_Booking}
The relation R is currently in 1NF since there are only atomic
values. To convert it into 2NF we have to get rid of partial
dependencies.
In relation R, the partial dependency is PNR → Starting_Point, Destination_Point,
Date_of_Journey, Passenger_ID, to get rid of it we decompose R into:
R1 = (PNR, Starting_Point, Destination_Point, Date_of_Journey, Passenger_ID, Preferred_Language)
PNR Starting_Point Destination_Point Date_of_Journey Passenger_ID Preferred_Language
R2 = (PNR, Type_of_Booking, Fare, No_of_Seats, Taxi_No)
PNR Type_of_Booking Fare No_of_seats Taxi_no
Now to convert it into 3NF, we have to get rid of transitive dependencies.
In relation R1, the transitive dependency is Passenger_ID → Preferred_Language, to get rid of it we decompose
R1 into:
R3 = (PNR, Starting_Point, Destination_Point, Date_of_Journey, Passenger_ID)
PNR Starting_Point Destination_Point Date_of_Journey Passenger_ID
R4 = (Passenger_ID, Preferred_Language)
Passenger_ID Preferred_Language
This is also now in BCNF since for every non-trivial FD A→B, A is the superkey.
Payment
Transaction_ID Base_Fare Tax Account_No Facility_Fee User_Payment_ID
R = (Transaction_ID, Base_Fare, Tax, Account_No, Facility_Fee,
User_Payment_ID) Functional Dependencies:
Transaction_ID → Base_Fare, Tax, Facility_Fee,
User_Payment_ID User_Payment_ID → Account_No
1
Candidate Key is {Transaction_ID}
1
The relation R is in 2NF since it doesn’t have any partial dependencies.
To convert this into 3NF, we have to get rid of transitive dependencies.
In relation R, the transitive dependency is User_Payment_ID → Account_No, to get rid of it we decompose R
Into
R1 = (Transaction_ID, Base_Fare, Tax, Facility_Fee, User_Payment_ID)
Transaction_ID Base_Fare Tax Facility_Fee User_Payment_ID
R2 = (User_Payment_ID, Account_No)
User_Payment_ID Account_No
R is also now in BCNF since for every non-trivial FD A→B, A is the superkey.
Tracking
Tracking_Taxi_ Geolocation_T Geolocation_ Driver_ID Departure_Time Estimated_Arrival_Time Distance
No axi Passenger
R = (Tracking_Taxi_No, Geolocation_Taxi, Geolocation_Passenger, Driver_ID,
Departure_Time, Estimated_Arrival_Time, Distance)
Functional Dependencies:
Tracking_Taxi_No → Geolocation_Taxi, Geolocation_Passenger, Driver_ID,
Departure_Time; Geolocation_Taxi, Geolocation_Passenger, Departure_Time → Distance;
Distance → Estimated_Arrival_Time;
Candidate Key is
{Tracking_Taxi_No}.
The relation R is in 2NF since it doesn’t have any partial dependencies.
To convert this into 3NF, we have to get rid of transitive dependencies.
In relation R, the transitive dependencies are Geolocation_Taxi, Geolocation_Passenger, Departure_Time →
Distance and Distance → Estimated_Arrival_Time, which can be removed by decomposing R into:
R1 = (Tracking_Taxi_No, Geolocation_Taxi, Geolocation_Passenger, Driver_ID, Departure_Time)
Tracking_Taxi_No Geolocation_Taxi Geolocation_Passenger Driver_ID Departure_Time
R2 = (Geolocation_Taxi, Geolocation_Passenger, Departure_Time, Distance)
Geolocation_Taxi Geolocation_Passenger Departure_Time Distance
1
R3 = (Distance, Estimated_Arrival_Time)
1
Distance Estimated_Arrival_Time
This now also is in BCNF since for every non-trivial FD A→B, A is
the superkey.
TAXI
Taxi_ Model_Name Name License_No Year_of_Manufacture Storage Seats Type
No
R = (Taxi_No, Model_Name, Licence_No, Year_of_Manufacture, Storage, Seats,
Type) Functional dependencies:
Taxi_No → Model_Name, License_No, Year_of_Manufacture,
Type; License_No→Name
Type → Storage, Seats;
Candidate key
is{Taxi_no}
The relation R is in 2NF since it doesn’t have any partial dependencies.
To convert this into 3NF, we have to get rid of transitive dependencies.
In relation R, the transitive dependencies are License_No → Name and Type → Storage, Seats, which can be
Removed by using R into:
R1 = (Taxi_No, Model_Name, License_No, Year_of_Manufacture, Type)
Taxi_No Model_Name License_No Year_of_Manufacture Type
R2 = (License_No, Name)
License_No Name
R3 = (Type, Storage, Seats)
Type Storage Seats
Now, R is also in BCNF since for every non-trivial FD A→B, A is the superkey.
1
4. DEVELOPMENT OF MODEL
User Table
create table user_(user_id varchar2(8) primary key check(substr(user_id,1,1) =
'U'),pass varchar2(8),dob date,mobile_no number(10) unique not
null,gives_rating number(2),transaction_id varchar2(8) not null);
Constraint
alter table user_ add constraint trans_fk foreign key(transaction_id)
references payment(transaction_id);
Data Inserted
insert into user_ values('U001', 'sjaljk', '21-Mar-2000', 9865157412, 4, 'T001');
insert into user_ values('U002', 'fadjdfl', '19-Jul-2002', 9965147895, 5, 'T002');
insert into user_ values('U003', 'shyalfa', '02-Aug-1990', 9984361254, 5, 'T003');
insert into user_ values('U004', 'husfknv', '12-Jan-1993', 7651024965, 3, 'T004');
2
Reservation Table
create table reservation(pnr number(5) primary key, starting_point
varchar2(20) not null, destination_point varchar2(20) not null, fare number(5)
, doj date, no_of_seats number(2), preferred_lan varchar2(10));
Data Inserted
insert into reservation values(1001,'abc', 'def', 243, '06-Oct-2020', 1, 'english');
insert into reservation values(1002,'ghi', 'jkl', 128, '10-Oct-2020', 1, 'hindi');
insert into reservation values(1003,'mno', 'pqr', 568, '20-Oct-2020', 1, 'tamil');
insert into reservation values(1004,'uvw', 'xyz', 321, '22-Oct-2020', 2, 'english');
2
Passenger Table
create table passenger(pass_id varchar2(8) primary key check(substr(pass_id,1,1)
= 'P'), pass_name varchar2(20), age number(2), status varchar2(20),
blood_grp varchar2(5));
Data Inserted
insert into passenger values('P001', 'Ram', 20, 'confirmed', 'B+');
insert into passenger values('P002', 'Manoj', 18, 'confirmed',
'AB+'); insert into passenger values('P003', 'Neeraj', 30,
'confirmed', 'B-'); insert into passenger values('P004', 'Harshit', 27,
'confirmed', 'A+'); insert into passenger values('P005', 'Harsh', 29,
'confirmed', 'A-');
2
Payment Table
create table payment(transaction_id varchar2(8) primary key
check(substr(transaction_id,1,1) = 'T'), base_fare number(5), tax
number(5), account_no number(7), facility_fee number(5), distance
number(5));
Data Inserted
insert into payment values('T001', 200, 33, 183920, 10, 20);
insert into payment values('T002', 100, 23, 983920, 5, 10);
insert into payment values('T003', 500, 53, 593920, 15, 32);
insert into payment values('T004', 270, 35, 691750, 16, 27);
2
Taxi Table
create table taxi(taxi_no number(5) primary key , reg_name varchar2(20),
model_name varchar2(20), license_no number(8), year_of_man
number(4), taxi_storage varchar2(10),
no_of_seats number(2), taxi_type varchar2(8));
Data Inserted
insert into taxi values('2001', 'abc', 'Swift', '12345', '2005', 'no', 4, 'compact');
insert into taxi values('2002', 'xyz', 'Alto', '54321', '2010', 'no', 4, 'compact');
insert into taxi values('2003', 'pqr', 'Nano', '98756', '2007', 'no', 4, 'compact');
insert into taxi values('2004', 'mno', 'Innova', '96541', '2015', 'yes', 8, 'SUV');
2
Taxi Tracking Table
create table taxi_tracking(tracking_taxi_no number(5), geolocation_taxi
varchar2(20), geolocation_pass varchar2(20), driver_id varchar2(8) not
null, departure varchar2(10) not null, estimated_arrival_time varchar2(10),
distance_left number(5));
Constraints
alter table taxi_tracking add constraint track_fk foreign
key(tracking_taxi_no) references taxi(taxi_no);
alter table taxi_tracking add constraint driver1_fk foreign key(driver_id)
references driver(driver_id);
Data Inserted
insert into taxi_tracking values('2001', 'jkh', 'klj', 'D001', '5:00pm', '1hr', '7');
insert into taxi_tracking values('2002', 'pot', 'poy', 'D002', '6:30pm', '40mins', '5');
insert into taxi_tracking values('2003', 'ads', 'aps', 'D003', '2:00pm', '2hr', '13');
insert into taxi_tracking values('2004', 'lop', 'hop', 'D004', '9:00am', '1hr', '7');
2
Driver Table
create table driver(driver_id varchar2(8) primary key
check(substr(driver_id,1,1)='D'), driver_name varchar2(20), phone_no
number(10) not null, ratings number(1), blood_grp varchar2(6), lang
varchar2(10));
Data Inserted
insert into driver values('D001', 'Sam', 7650452598, 4, 'AB+', 'english');
insert into driver values ('D002', 'Manu', 7750452598, 3, 'B+', 'hindi');
insert into driver values ('D003', 'Prabhu', 9650452598, 4, 'O-', 'tamil');
insert into driver values ('D004', 'Akshat', 7950452598, 5, 'A+',
'english');
2
Employee Table
create table employee(emp_id varchar2(8) primary key check(substr(emp_id,1,1)
= 'E'), emp_name varchar2(20), salary number(5), email varchar2(20), phone_no
number(10) not null, department varchar2(20));
Data Inserted
insert into employee values('E001', 'Sam', 20000, 'sam@[Link]',
7650452598, 'driver');
insert into employee values('E002', 'Harshita', 15000,
'harshita@[Link]', 8550452598, 'customerservice');
insert into employee values('E003', 'Manu', 19000, 'manu@[Link]',
7750452598, 'driver');
insert into employee values('E004', 'Prabhu', 21000, 'prabhu@[Link]',
9650452598, 'driver');
insert into employee values('E005', 'Akshat', 22000, 'akshat@[Link]',
7950452598, 'driver');
2
Contains Table
create table contains(pnr number(5) not null, pass_id varchar2(8) not null);
Constraints
alter table contains add constraint pnr1_fk foreign key(pnr)
references reservation(pnr);
alter table contains add constraint passid1_fk foreign key(pass_id)
references passenger(pass_id);
Data Inserted
insert into contains
values(1001,'P001'); insert into
contains values(1002,'P002'); insert
into contains values(1003,'P003');
insert into contains
values(1004,'P004'); insert into
2
contains values(1004,'P005');
2
Drives Table
create table drives(driver_id varchar2(8) not null, taxi_no number(5),
pnr number(5) not null);
Constraints
alter table drives add constraint driverid1_fk foreign key(driver_id)
references driver(driver_id);
alter table drives add constraint taxino1_fk foreign key(taxi_no) references
taxi(taxi_no);
alter table drives add constraint pnr2_fk foreign key(pnr)
references reservation(pnr);
Data Inserted
insert into drives values('D001', 2001, 1001);
insert into drives values('D002', 2002, 1002);
insert into drives values('D003', 2003, 1003);
insert into drives values('D004', 2004, 1004);
3
Reserves Table
create table reserves(user_id varchar2(8) not null, pnr number(5) not null);
Constraints
alter table reserves add constraint userid1_fk foreign key(user_id)
references user_(user_id);
alter table reserves add constraint pnr3_fk foreign key(pnr)
references reservation(pnr);
Data Inserted
insert into reserves values('U001',
'1001'); insert into reserves
values('U002', '1002'); insert into
reserves values('U003', '1003'); insert
3
into reserves values('U004', '1004');
3
Rating Table
create table rating(user_id varchar2(8) not null, driver_id varchar2(8) not null);
Constraints
alter table rating add constraint userid2_fk foreign key(user_id)
references user_(user_id);
alter table rating add constraint driverid2_fk foreign key(driver_id)
references driver(driver_id);
Data Inserted
insert into rating
values('U001','D001'); insert into
rating values('U002','D002'); insert
into rating values('U003','D003');
insert into rating
values('U004','D004');
28
Implementation of Functional Requirements
Discount of 20% when basefare is greater or equal to 500
update payment set base_fare = base_fare - base_fare*0.2
where base_fare >= 500;
Before
2
After(Base_Fare of T003 changes from 500 to 400 after 20%
discount)
3
Phone no. Of Driver if only PNR is known
select phone_no from driver inner join drives on driver.driver_id
= drives.driver_id
where pnr =
1002;
Updating ratings of a driver after a user gives a rating
update driver
set ratings = ((select gives_rating from user_ where user_id
= 'U003') + ratings)/2
where driver_id = (select driver_id from rating where user_id
= 'U003');
3
Before
3
After(Ratings of D003 changes from 4 to 5)
Blood group of driver given taxi no
select driver.blood_grp from driver inner join drives
on driver.driver_id = drives.driver_id
where taxi_no = 2002;
3
Change starting point given user id
update reservation
set starting_point = 'Chennai'
where pnr = (select pnr from reserves where user_id = 'U004');
3
Before
3
After
Updating email-id of driver
update employee
set email = 'sam123@[Link]'
where emp_name = (select driver_name from driver where
driver_id = 'D001')
3
Distance left given pnr
select distance_left from taxi_tracking
inner join drives on taxi_tracking.tracking_taxi_no
= drives.taxi_no
where pnr = '1002';
3
3
Conclusion:
This project helps the user to book a taxi by entering his address and other id information. This system keeps all the
Details of taxi booking and when coming to booking comes then he/she can check the system for available taxi and confirm
The booking if taxi is available on the booking date. This taxi management system is a very effective,efficient,reliable and
Economic web application from all aspects.
References:
1. Liu Yong. Information system analysis and design [M]. Science Press, 2002
2. Sa Shixuan, Wang Shan. Database system [M]. Higher Education Press, 2000
3. Liu Wentao. Visual Basic + Access database development and examples [M]. Tsinghua University Press, 2006
4. Liu Bingwen. Visual Basic programming tutorial [M]. Tsinghua University Press, 2006