Database Design Documentation
Database Design Documentation
Planning Phase
Entity list.
Entity structures with relevant attributes: Primary Keys & Foreign Keys.
Cardinality.
Final ER Diagram
References
Introduction
Ride Transportation Service is the leading ride-hailing company in Ethiopia, with over 500,000
satisfied customers and a fleet of over 1,000 vehicles operating in Addis Ababa and other major
cities. Their commitment to safety, reliability, and customer satisfaction has earned them a
reputation as the go-to transportation service in Ethiopia. With a strong presence in major cities
across the country, their dedicated team of drivers and customer support staff are passionate
about providing exceptional service to their customers. They offer competitive pricing,
convenient payment options, and a range of vehicle types to suit every need.
However, due to their rapid growth and increasing popularity, their manual systems are
struggling to keep up with the demand. To ensure they continue to provide the highest level of
service to their customers, they recognize the need for a comprehensive database system to
manage their operations efficiently. This system will enable them to streamline their processes,
improve their response times, and provide a more personalized experience for their customers.
Ride Transportation Service has asked our team to design a database system that will support
their continued growth and success. This project involves creating an Entity-Relationship (ER)
model, a relational diagram derived from the ER model, a normalized relational schema, sample
data, and SQL queries. The ER model will help us understand and analyze the entities,
relationships, and cardinalities of their data, while the relational schema will ensure data
redundancy is eliminated and data storage and retrieval are optimized. The final step will be to
create sample data to test the design and demonstrate its effectiveness. By implementing this
database system, Ride Transportation Service aims to enhance their customer service, improve
their operational efficiency, and maintain their position as the leading ride-hailing company in
Ethiopia.
1. Planning Phase
Primary Goal: The primary goal of the Ride Transportation Service database to support
the operations of the "Ride" Transportation Service company, which provides ride-
hailing services to customers. The database will store information about customers,
drivers, vehicles, trips, payments, and other relevant data to facilitate the efficient and
reliable operation of the service. By designing a database that addresses these
requirements, the company can improve their operational efficiency and provide better
service to their customers.
Secondary Goals:
Improve the accuracy and reliability of data management, reducing errors and
inconsistencies.
Provide real-time access to data for better decision-making and operational
efficiency.
Enhance security and privacy of customer and driver information.
Facilitate the integration of additional features such as promotions, discounts, and
customer feedback mechanisms.
B. Identify Stakeholders
Primary Stakeholders:
Management Team: Responsible for overseeing the implementation of the
database and ensuring it aligns with the company’s strategic goals.
IT and Development Team: Tasked with the design, development, and
maintenance of the database system.
Operations Team: End-users who will interact with the database on a daily basis
to manage rides, drivers, customers, and payments.
Secondary Stakeholders:
Drivers: Who will benefit from more efficient trip management and payment
processing.
Customers: Who will experience improved service reliability and better access to
ride-hailing services.
Customer Support Team: Who will use the database to resolve customer issues
more effectively.
2. Analysis Phase
Technical Feasibility:
The database system will be implemented using a robust relational database
management system (RDBMS) that can handle large volumes of data and
transactions. The chosen technology should support scalability to accommodate
future growth, offer strong security features to protect sensitive data, and provide
high availability to minimize downtime.
The Ride Transportation Service's existing IT infrastructure, including servers,
network capabilities, and data storage solutions, will be assessed to ensure
compatibility with the new database system. If necessary, upgrades or additional
resources may be recommended.
Operational Feasibility:
The database system is designed to integrate seamlessly into the company’s
current operations, enhancing the efficiency of ride management, payment
processing, and customer service. The transition from manual to automated
processes will be carefully managed to minimize disruption.
Training will be provided to the operations team, drivers, and customer support
staff to ensure they are proficient in using the new system. Ongoing support will
be available to address any issues that arise during and after implementation.
Economic Feasibility:
The cost of developing and implementing the database system will be evaluated
against the expected benefits, such as improved operational efficiency, reduced
errors, and enhanced customer satisfaction.
A cost-benefit analysis will be conducted, factoring in the initial investment,
ongoing maintenance costs, and potential savings from increased efficiency. The
database system is expected to offer a positive return on investment by enabling
Ride Transportation Service to handle more customers and trips with fewer
resources.
User Requirements:
Operations Team: Needs a user-friendly interface to manage day-to-day
operations, including booking rides, assigning drivers, and monitoring trip
progress. The system should provide real-time data access to ensure efficient
decision-making.
Drivers: Require a system that provides timely notifications about assigned trips,
payment processing, and customer feedback. They should be able to easily update
their availability and receive support when needed.
Customers: Expect a reliable service with accurate booking information, prompt
payment processing, and the ability to rate and review their experience. The
system should allow easy access to ride history and payment details.
System Requirements:
Hardware: The database will require servers with sufficient processing power,
memory, and storage to handle large volumes of data and transactions. Redundant
systems will be implemented to ensure high availability.
Software: The system will be built on an RDBMS that supports the required
functionalities, such as MySQL, PostgreSQL, or Microsoft SQL Server.
Additional software may include data backup solutions, security tools, and user
interface development platforms.
Networking: Reliable network infrastructure will be needed to ensure seamless
communication between the database, the operations team, drivers, and
customers.
Functional Requirements:
Customer Management: The system must store and retrieve customer details
efficiently, supporting updates and providing quick access to customer profiles.
Driver Management: The database should track driver information, including
their availability and assigned vehicles, and facilitate easy updates.
Trip Management: The system must record and manage trip details, ensuring
that all relevant information is accessible to both the operations team and drivers.
Payment Processing: The database must handle payment records, track payment
statuses, and support various payment methods, ensuring secure and accurate
transactions.
Reporting: The system should generate reports on operations, such as ride
statistics, driver performance, and financial summaries, to assist management in
decision-making.
3. Design Phase
Entity List
1. Employee
2. Customer
3. Driver
4. Vehicle
5. Trips
7. Rides
DropoffTime DATETIME Time when the ride was completed NOT NULL
9. Discount
Field Data Type Description Constraints
CustomerID INT The customer benefited from the discount Foreign Key
Entity Relationships:
E-R Diagram
Cardinality
No Entities Cardinality
1 Customer and Rides: 1:N
2 Driver and Rides 1:N
3 Vehicle and Rides 1:M
4 Trips and Rides 1:1
5 Rides and Payments 1:1
6 Customer and Payments 1:M
7 Driver and Feedback 1:M
8 Customer and Feedback 1:M
9 Discounts and Rides M:1
10 Discounts and Payments 1:1
Normalization Process
To normalize your database and ensure data integrity, we will go through the process of applying
the three normal forms (1NF, 2NF, and 3NF). Here's a detailed step-by-step normalization
process for your entities:
Objective: Ensure that each table contains only atomic values, meaning each column must
contain a single value, and each record must be unique.
Objective: Ensure that all non-key attributes are fully functional dependent on the primary key.
Since all entities in your database have a single-column primary key and there are no partial
dependencies (i.e., non-key attributes dependent only on a part of a composite key), they are
already in 2NF.
Objective: Ensure that all attributes are directly dependent on the primary key, and there are no
transitive dependencies (i.e., non-key attributes should not depend on other non-key attributes).
1. Employee Table:
o Already in 3NF. No transitive dependencies.
2. Customer Table:
o Already in 3NF. No transitive dependencies.
3. Driver Table:
o Transitive dependency: VehicleID is dependent on DriverID.
o Solution: Remove VehicleID from the Driver table. The relationship between
Driver and Vehicle should be handled in the Vehicle table.
4. Vehicle Table:
o Transitive dependency: DriverID is dependent on VehicleID.
o Solution: If drivers are assigned specific vehicles and vice versa, it's a valid
relationship. However, this should be modeled as a one-to-one or one-to-many
relationship in a separate table. For now, you can keep it in Vehicle.
5. Trips Table:
o Already in 3NF. No transitive dependencies.
6. Payment Table:
o PaymentMethod is functionally dependent on PaymentID.
o Solution: If each payment can have only one payment method, the table is in
3NF.
7. Rides Table:
o Already in 3NF. No transitive dependencies.
8. Feedback Table:
o Already in 3NF. No transitive dependencies.
9. Discount Table:
o Already in 3NF. No transitive dependencies.
By following these steps, your database structure is normalized to the third normal form (3NF),
ensuring minimal redundancy and maximum data integrity.
5. Create Rides ID
6. Create Trips Table
3. Update Operations
In our recent efforts to enhance query performance, we’ve outlined a systematic approach to
heuristic query optimization. This process transforms an initial query tree into a more efficient
execution plan. Below are the steps we followed:
To improve efficiency, we pushed SELECT operations closer to the base tables. This strategy
reduces the size of intermediate results and ensures that only relevant data is processed in
subsequent operations.
Next, we prioritized the application of more restrictive SELECT conditions. By executing the
most selective filters earlier, we minimized the data being processed, further enhancing
performance.
We replaced CARTESIAN PRODUCT operations with JOINs, linking tables based on key
columns. This change not only improved efficiency but also leveraged database optimization for
relational data.
Finally, we pushed PROJECT operations down the query tree. This adjustment limits the number
of columns in intermediate results, reducing the overhead for data processing. The DISTINCT
operation was applied last to ensure that duplicates were removed after all joins and filters were
applied.