Professional Documents
Culture Documents
221FJ01071 - DBMS Ieee
221FJ01071 - DBMS Ieee
221FJ01071 - DBMS Ieee
Driver Destination
One User can be associated with one Driver. Email VARCHAR(55) UNIQUE,
Driver-Ride (One-to-Many) );
Many Rides can have the same RideType, but (2,'user2', 'ABC2', 'Raja', 'Kumar',
each Ride is associated with one RideType. 'Raja@gmail.com', '9876543210', 'Driver'),
OUTPUT :-
Passenger :- Driver :-
CREATE TABLE Passenger ( CREATE TABLE Driver (
PassengerID INT PRIMARY KEY, DriverID INT PRIMARY KEY,
UserID INT UNIQUE, UserID INT UNIQUE,
Address VARCHAR(200), VehicleInfo VARCHAR(100),
FOREIGN KEY (UserID) REFERENCES AvailabilityStatus BOOLEAN,
User(UserID)
FOREIGN KEY (UserID) REFERENCES
); User(UserID)
);
INSERT INTO Passenger (PassengerID,
UserID, Address)
INSERT INTO Driver (DriverID,
VALUES UserID, VehicleInfo, AvailabilityStatus)
('P1', 1, 'Parmanadpur'), VALUES
('P2', 2, 'Murthan'), ('D1', 1, 'Maruti', TRUE),
('P3', 3, 'Harpunand'), ('D2', 2, 'Honda ', TRUE),
('P4', 4, 'Vadlamudi'), ('D3', 3, 'Ford ', FALSE),
('P5', 5, 'Patna'), ('D4', 4, 'Maruti AC', TRUE),
('D5', 5, 'Altima', FALSE), (14, 'Senior Citizen', 9.00),
('D6', 6, 'Hyundai', TRUE), (15, 'Student', 8.50);
('D7', 7, 'Kia Optima', FALSE),
('D8', 8, 'Volkswagen Passat', TRUE), select *from RideType
('D9', 9, 'BMW', TRUE), OUTPUT :-
('D10', 10, 'RR', FALSE);
OUTPUT :-
Ride :-
CREATE TABLE Ride (
RideType
RideID INT PRIMARY KEY,
CREATE TABLE RideType (
PassengerID INT,
RideTypeID INT PRIMARY KEY,
DriverID INT,
TypeName VARCHAR(50) NOT NULL,
PickupLocation VARCHAR(200) NOT
BaseFare DECIMAL(10, 2) NOT NULL
NULL,
);
Destination VARCHAR(200) NOT
NULL,
INSERT INTO RideType (RideTypeID, RideTypeID INT,
TypeName, BaseFare)
EstimatedFare DECIMAL(10, 2),
VALUES
Status VARCHAR(20) NOT NULL,
(6, 'Express', 15),
FOREIGN KEY (PassengerID)
(7, 'Standard', 12.00), REFERENCES Passenger(PassengerID),
(8, 'Deluxe', 35.00), FOREIGN KEY (DriverID)
REFERENCES Driver(DriverID),
(9, 'Airport Shuttle', 18.00),
FOREIGN KEY (RideTypeID)
(10, 'Business', 40.00), REFERENCES RideType(RideTypeID)
(11, 'Family', 22.00), );
(12, 'Electric', 27.00),
(13, 'Sports Car', 50.00),
INSERT INTO Ride (RideID, Comment TEXT,
PassengerID, DriverID, PickupLocation,
FOREIGN KEY (RideID) REFERENCES
Destination, RideTypeID, EstimatedFare,
Ride(RideID),
Status)
FOREIGN KEY (RatedUserID)
VALUES
REFERENCES User(UserID)
(1, 'P1', 'D1', 'Parmanandpur', 'Digha',
);
'RI1', 25, 'Completed'),
INSERT INTO Rating (RatingID,
(2, 'P2', 'D2', 'Murthan', 'Apshaid','RI2', 30,
RideID, RatedUserID, Stars, Comment)
'Completed'),
VALUES
(3, 'P3', 'D3','Sonpur', 'Muzafferpur', 'RI3',
20, 'In Progress'), ('RT1', 1, 1, 5, 'Great ride!'),
(4, 'P4', 'D4','Vadlamudi', 'Sitamadhi', ('RT2', 2, 2, 4, 'Good experience.'),
'RI4', 35, 'Completed'),
('RT3', 3, 3, 3, 'Average ride.'),
(5, 'P5', 'D5', 'Naya Gaon', 'Madhubani',
'RI5', 15, 'Completed'), ('RT4', 4, 4, 5, 'Excellent driver.'),
(6, 'P6', 'D6', 'Patna', 'Purnia', 'RI6', 28, ('RT5', 5, 5, 2, 'Not satisfied.'),
'Completed'), ('RT6', 6, 6, 4, 'Friendly driver.'),
(7, 'P7', 'D7', 'Chapra', 'Parmanandpur', ('RT7', 7, 7, 5, 'Smooth ride.'),
'RI7', 22, 'In Progress'),
('RT8', 8, 8, 1, 'Terrible experience.'),
(8, 'P8', 'D8', 'Gandhi Chawk', 'Hajipur',
'RI8', 32, 'Completed'), ('RT9', 9, 9, 3, 'Okay ride.'),
(9, 'P9', 'D9', 'Sitabganj', 'Nijam chawk', ('RT10', 10, 10, 4, 'Good Ride');
'RI9', 18, 'Completed'),
(10, 'P10', 'D10', 'Purnia', 'Hajipur', 'RI10', SELECT *FROM Rating;
37, 'Completed');
select *FROM Ride;
OUTPUT :-
OUTPUT :-
Rating :-
CREATE TABLE Rating (
RatingID INT PRIMARY KEY,
RideID INT UNIQUE,
RatedUserID INT,
Stars INT,
5. SCHEMA DIAGRAM :-
7. REFERENCES
1. JavaTpoint
https://www.javatpoint.com/dbms-sql -
command
2. LucidChart
https://www.lucidchart.com/pages/er-
diagrams::text=A
6. CONCLUSION
This case study outlines the design and
development of a real-time ride-sharing
system, aiming to revolutionize the way
passengers and drivers connect for efficient
transportation. By seamlessly connecting
passengers with available drivers, the system
streamlines the process of requesting and
providing rides. Key objectives include user
registration, ride request handling, real-time
driver availability updates, fare estimation,
real-time tracking, and user rating feedback.
The system is designed to accommodate
various user roles, including passengers and
drivers, with functionalities tailored to their
specific needs. Passengers can create accounts,
request rides by specifying pickup and
destination details, and choose preferred ride
types. On the other hand, drivers can register,
manage their vehicle information, update their
availability status, and offer rides to
passengers. The system’s real-time tracking
feature ensurestransparency and safety by
allowing passengers to monitor their ride’s
progress. The estimated fare calculation takes
into account factors such as distance, ride
type, and additional charges, providing
passengers with an accurate expectation of
costs.